From 97a095884b05d093ff52feadb8cf9cc0a7a9e3cb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 27 Oct 2022 15:38:09 -0400 Subject: [PATCH] feat: [dialogflow] Added StreamingAnalyzeContent API (#8684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added StreamingAnalyzeContent API feat: Added obfuscated_external_user_id to Participant feat: Can directly set Cloud Speech model on the SpeechToTextConfig PiperOrigin-RevId: 483696090 Source-Link: https://github.com/googleapis/googleapis/commit/3772bf3656425cb32ed3525894f8b1a2a5dfa789 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e358d269b1f0eb9964189d18768823bc9e8ab41c Copy-Tag: eyJwIjoiamF2YS1kaWFsb2dmbG93Ly5Pd2xCb3QueWFtbCIsImgiOiJlMzU4ZDI2OWIxZjBlYjk5NjQxODlkMTg3Njg4MjNiYzllOGFiNDFjIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- java-dialogflow/.gitignore | 17 + java-dialogflow/README.md | 6 +- .../dialogflow/v2/ParticipantsClient.java | 52 + .../dialogflow/v2/ParticipantsSettings.java | 14 + .../cloud/dialogflow/v2/gapic_metadata.json | 3 + .../v2/stub/GrpcParticipantsStub.java | 36 + .../v2/stub/HttpJsonIntentsStub.java | 12 +- .../dialogflow/v2/stub/ParticipantsStub.java | 8 + .../v2/stub/ParticipantsStubSettings.java | 35 + .../v2beta1/stub/HttpJsonIntentsStub.java | 12 +- .../dialogflow/v2/MockParticipantsImpl.java | 37 + .../v2/ParticipantsClientHttpJsonTest.java | 13 + .../dialogflow/v2/ParticipantsClientTest.java | 91 + .../cloud/dialogflow/v2/ParticipantsGrpc.java | 124 + .../cloud/dialogflow/v2/AudioConfigProto.java | 89 +- .../cloud/dialogflow/v2/InputTextConfig.java | 628 +++ .../v2/InputTextConfigOrBuilder.java | 54 + .../cloud/dialogflow/v2/Participant.java | 324 ++ .../dialogflow/v2/ParticipantOrBuilder.java | 65 + .../cloud/dialogflow/v2/ParticipantProto.java | 565 +-- .../dialogflow/v2/SpeechToTextConfig.java | 220 ++ .../v2/SpeechToTextConfigOrBuilder.java | 37 + .../v2/StreamingAnalyzeContentRequest.java | 3460 +++++++++++++++++ ...reamingAnalyzeContentRequestOrBuilder.java | 428 ++ .../v2/StreamingAnalyzeContentResponse.java | 3323 ++++++++++++++++ ...eamingAnalyzeContentResponseOrBuilder.java | 398 ++ .../cloud/dialogflow/v2/TelephonyDtmf.java | 485 +++ .../dialogflow/v2/TelephonyDtmfEvents.java | 821 ++++ .../v2/TelephonyDtmfEventsOrBuilder.java | 88 + .../cloud/dialogflow/v2/audio_config.proto | 70 + .../cloud/dialogflow/v2/participant.proto | 221 ++ .../AsyncStreamingAnalyzeContent.java | 64 + 32 files changed, 11521 insertions(+), 279 deletions(-) create mode 100644 java-dialogflow/.gitignore create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfig.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfigOrBuilder.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequest.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequestOrBuilder.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponse.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponseOrBuilder.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmf.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEvents.java create mode 100644 java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEventsOrBuilder.java create mode 100644 java-dialogflow/samples/snippets/generated/com/google/cloud/dialogflow/v2/participantsclient/streaminganalyzecontent/AsyncStreamingAnalyzeContent.java diff --git a/java-dialogflow/.gitignore b/java-dialogflow/.gitignore new file mode 100644 index 000000000000..069d08fc73e8 --- /dev/null +++ b/java-dialogflow/.gitignore @@ -0,0 +1,17 @@ +# Maven +target/ + +# Eclipse +.classpath +.project +.settings + +# Intellij +*.iml +.idea/ + +# python utilities +*.pyc +__pycache__ + +.flattened-pom.xml diff --git a/java-dialogflow/README.md b/java-dialogflow/README.md index 268f1381ae0d..9d5786ffb77a 100644 --- a/java-dialogflow/README.md +++ b/java-dialogflow/README.md @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file: com.google.cloud google-cloud-dialogflow - 4.10.0 + 4.11.0 ``` If you are using Gradle without BOM, add this to your dependencies: ```Groovy -implementation 'com.google.cloud:google-cloud-dialogflow:4.10.0' +implementation 'com.google.cloud:google-cloud-dialogflow:4.11.0' ``` If you are using SBT, add this to your dependencies: ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow" % "4.10.0" +libraryDependencies += "com.google.cloud" % "google-cloud-dialogflow" % "4.11.0" ``` ## Authentication diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsClient.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsClient.java index d7acb004e02a..fc912d993d6b 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsClient.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsClient.java @@ -22,6 +22,7 @@ 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.BidiStreamingCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.v2.stub.ParticipantsStub; @@ -945,6 +946,57 @@ public final AnalyzeContentResponse analyzeContent(AnalyzeContentRequest request return stub.analyzeContentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Adds a text (chat, for example), or audio (phone recording, for example) message from a + * participant into the conversation. Note: This method is only available through the gRPC API + * (not REST). + * + *

The top-level message sent to the client by the server is `StreamingAnalyzeContentResponse`. + * Multiple response messages can be returned in order. The first one or more messages contain the + * `recognition_result` field. Each result represents a more complete transcript of what the user + * said. The next message contains the `reply_text` field and potentially the `reply_audio` field. + * The message can also contain the `automated_agent_reply` field. + * + *

Note: Always use agent versions for production traffic sent to virtual agents. See [Versions + * and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + * + *

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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
+   *   BidiStream bidiStream =
+   *       participantsClient.streamingAnalyzeContentCallable().call();
+   *   StreamingAnalyzeContentRequest request =
+   *       StreamingAnalyzeContentRequest.newBuilder()
+   *           .setParticipant(
+   *               ParticipantName.ofProjectConversationParticipantName(
+   *                       "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
+   *                   .toString())
+   *           .setReplyAudioConfig(OutputAudioConfig.newBuilder().build())
+   *           .setQueryParams(QueryParameters.newBuilder().build())
+   *           .setAssistQueryParams(AssistQueryParameters.newBuilder().build())
+   *           .setCxParameters(Struct.newBuilder().build())
+   *           .setEnablePartialAutomatedAgentReply(true)
+   *           .build();
+   *   bidiStream.send(request);
+   *   for (StreamingAnalyzeContentResponse response : bidiStream) {
+   *     // Do something when a response is received.
+   *   }
+   * }
+   * }
+ */ + public final BidiStreamingCallable< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentCallable() { + return stub.streamingAnalyzeContentCallable(); + } + // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested articles for a participant based on specific historical messages. diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsSettings.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsSettings.java index 9d72fd69b35d..d208c8c65b2d 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsSettings.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsSettings.java @@ -29,6 +29,7 @@ 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.StreamingCallSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; import com.google.cloud.dialogflow.v2.stub.ParticipantsStubSettings; @@ -103,6 +104,12 @@ public UnaryCallSettings analyzeC return ((ParticipantsStubSettings) getStubSettings()).analyzeContentSettings(); } + /** Returns the object with the settings used for calls to streamingAnalyzeContent. */ + public StreamingCallSettings + streamingAnalyzeContentSettings() { + return ((ParticipantsStubSettings) getStubSettings()).streamingAnalyzeContentSettings(); + } + /** Returns the object with the settings used for calls to suggestArticles. */ public UnaryCallSettings suggestArticlesSettings() { @@ -277,6 +284,13 @@ public UnaryCallSettings.Builder getParticip return getStubSettingsBuilder().analyzeContentSettings(); } + /** Returns the builder for the settings used for calls to streamingAnalyzeContent. */ + public StreamingCallSettings.Builder< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentSettings() { + return getStubSettingsBuilder().streamingAnalyzeContentSettings(); + } + /** Returns the builder for the settings used for calls to suggestArticles. */ public UnaryCallSettings.Builder suggestArticlesSettings() { diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/gapic_metadata.json b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/gapic_metadata.json index 95bab3d6e164..dcb148daddf5 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/gapic_metadata.json +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/gapic_metadata.json @@ -466,6 +466,9 @@ "ListParticipants": { "methods": ["listParticipants", "listParticipants", "listParticipants", "listParticipantsPagedCallable", "listParticipantsCallable"] }, + "StreamingAnalyzeContent": { + "methods": ["streamingAnalyzeContentCallable"] + }, "SuggestArticles": { "methods": ["suggestArticles", "suggestArticles", "suggestArticles", "suggestArticlesCallable"] }, diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/GrpcParticipantsStub.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/GrpcParticipantsStub.java index cfe85173f77e..a486e4cde36d 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/GrpcParticipantsStub.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/GrpcParticipantsStub.java @@ -23,6 +23,7 @@ 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.UnaryCallable; import com.google.cloud.dialogflow.v2.AnalyzeContentRequest; @@ -32,6 +33,8 @@ import com.google.cloud.dialogflow.v2.ListParticipantsRequest; import com.google.cloud.dialogflow.v2.ListParticipantsResponse; import com.google.cloud.dialogflow.v2.Participant; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; import com.google.cloud.dialogflow.v2.SuggestArticlesRequest; import com.google.cloud.dialogflow.v2.SuggestArticlesResponse; import com.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; @@ -111,6 +114,19 @@ public class GrpcParticipantsStub extends ParticipantsStub { ProtoUtils.marshaller(AnalyzeContentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName("google.cloud.dialogflow.v2.Participants/StreamingAnalyzeContent") + .setRequestMarshaller( + ProtoUtils.marshaller(StreamingAnalyzeContentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(StreamingAnalyzeContentResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor suggestArticlesMethodDescriptor = MethodDescriptor.newBuilder() @@ -171,6 +187,9 @@ public class GrpcParticipantsStub extends ParticipantsStub { listParticipantsPagedCallable; private final UnaryCallable updateParticipantCallable; private final UnaryCallable analyzeContentCallable; + private final BidiStreamingCallable< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentCallable; private final UnaryCallable suggestArticlesCallable; private final UnaryCallable @@ -277,6 +296,12 @@ protected GrpcParticipantsStub( return params.build(); }) .build(); + GrpcCallSettings + streamingAnalyzeContentTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(streamingAnalyzeContentMethodDescriptor) + .build(); GrpcCallSettings suggestArticlesTransportSettings = GrpcCallSettings.newBuilder() @@ -353,6 +378,11 @@ protected GrpcParticipantsStub( this.analyzeContentCallable = callableFactory.createUnaryCallable( analyzeContentTransportSettings, settings.analyzeContentSettings(), clientContext); + this.streamingAnalyzeContentCallable = + callableFactory.createBidiStreamingCallable( + streamingAnalyzeContentTransportSettings, + settings.streamingAnalyzeContentSettings(), + clientContext); this.suggestArticlesCallable = callableFactory.createUnaryCallable( suggestArticlesTransportSettings, settings.suggestArticlesSettings(), clientContext); @@ -416,6 +446,12 @@ public UnaryCallable analyzeConte return analyzeContentCallable; } + @Override + public BidiStreamingCallable + streamingAnalyzeContentCallable() { + return streamingAnalyzeContentCallable; + } + @Override public UnaryCallable suggestArticlesCallable() { return suggestArticlesCallable; diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/HttpJsonIntentsStub.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/HttpJsonIntentsStub.java index 2277d716407e..0d8124def874 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/HttpJsonIntentsStub.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/HttpJsonIntentsStub.java @@ -102,7 +102,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam( fields, "languageCode", request.getLanguageCode()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); @@ -140,7 +141,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam(fields, "languageCode", request.getLanguageCode()); return fields; }) @@ -176,7 +178,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam( fields, "languageCode", request.getLanguageCode()); return fields; @@ -218,7 +221,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam( fields, "languageCode", request.getLanguageCode()); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStub.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStub.java index 757098d1c7b5..b19e791abfa9 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStub.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStub.java @@ -20,6 +20,7 @@ import static com.google.cloud.dialogflow.v2.ParticipantsClient.ListParticipantsPagedResponse; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.BidiStreamingCallable; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.v2.AnalyzeContentRequest; import com.google.cloud.dialogflow.v2.AnalyzeContentResponse; @@ -28,6 +29,8 @@ import com.google.cloud.dialogflow.v2.ListParticipantsRequest; import com.google.cloud.dialogflow.v2.ListParticipantsResponse; import com.google.cloud.dialogflow.v2.Participant; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; import com.google.cloud.dialogflow.v2.SuggestArticlesRequest; import com.google.cloud.dialogflow.v2.SuggestArticlesResponse; import com.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; @@ -76,6 +79,11 @@ public UnaryCallable analyzeConte throw new UnsupportedOperationException("Not implemented: analyzeContentCallable()"); } + public BidiStreamingCallable + streamingAnalyzeContentCallable() { + throw new UnsupportedOperationException("Not implemented: streamingAnalyzeContentCallable()"); + } + public UnaryCallable suggestArticlesCallable() { throw new UnsupportedOperationException("Not implemented: suggestArticlesCallable()"); } diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStubSettings.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStubSettings.java index 9ff6e34e582a..92dd1f0c7dc3 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStubSettings.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2/stub/ParticipantsStubSettings.java @@ -40,6 +40,7 @@ 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.StreamingCallSettings; import com.google.api.gax.rpc.StubSettings; import com.google.api.gax.rpc.TransportChannelProvider; import com.google.api.gax.rpc.UnaryCallSettings; @@ -51,6 +52,8 @@ import com.google.cloud.dialogflow.v2.ListParticipantsRequest; import com.google.cloud.dialogflow.v2.ListParticipantsResponse; import com.google.cloud.dialogflow.v2.Participant; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; import com.google.cloud.dialogflow.v2.SuggestArticlesRequest; import com.google.cloud.dialogflow.v2.SuggestArticlesResponse; import com.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; @@ -122,6 +125,9 @@ public class ParticipantsStubSettings extends StubSettings updateParticipantSettings; private final UnaryCallSettings analyzeContentSettings; + private final StreamingCallSettings< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentSettings; private final UnaryCallSettings suggestArticlesSettings; private final UnaryCallSettings @@ -272,6 +278,12 @@ public UnaryCallSettings analyzeC return analyzeContentSettings; } + /** Returns the object with the settings used for calls to streamingAnalyzeContent. */ + public StreamingCallSettings + streamingAnalyzeContentSettings() { + return streamingAnalyzeContentSettings; + } + /** Returns the object with the settings used for calls to suggestArticles. */ public UnaryCallSettings suggestArticlesSettings() { @@ -412,6 +424,7 @@ protected ParticipantsStubSettings(Builder settingsBuilder) throws IOException { listParticipantsSettings = settingsBuilder.listParticipantsSettings().build(); updateParticipantSettings = settingsBuilder.updateParticipantSettings().build(); analyzeContentSettings = settingsBuilder.analyzeContentSettings().build(); + streamingAnalyzeContentSettings = settingsBuilder.streamingAnalyzeContentSettings().build(); suggestArticlesSettings = settingsBuilder.suggestArticlesSettings().build(); suggestFaqAnswersSettings = settingsBuilder.suggestFaqAnswersSettings().build(); suggestSmartRepliesSettings = settingsBuilder.suggestSmartRepliesSettings().build(); @@ -433,6 +446,9 @@ public static class Builder extends StubSettings.Builder analyzeContentSettings; + private final StreamingCallSettings.Builder< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentSettings; private final UnaryCallSettings.Builder suggestArticlesSettings; private final UnaryCallSettings.Builder @@ -455,6 +471,8 @@ public static class Builder extends StubSettings.BuildernewArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_2_codes", ImmutableSet.copyOf(Lists.newArrayList())); RETRYABLE_CODE_DEFINITIONS = definitions.build(); } @@ -485,6 +503,14 @@ public static class Builder extends StubSettings.Builder getParticip return analyzeContentSettings; } + /** Returns the builder for the settings used for calls to streamingAnalyzeContent. */ + public StreamingCallSettings.Builder< + StreamingAnalyzeContentRequest, StreamingAnalyzeContentResponse> + streamingAnalyzeContentSettings() { + return streamingAnalyzeContentSettings; + } + /** Returns the builder for the settings used for calls to suggestArticles. */ public UnaryCallSettings.Builder suggestArticlesSettings() { diff --git a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/stub/HttpJsonIntentsStub.java b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/stub/HttpJsonIntentsStub.java index 87279d36caae..c121568360b8 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/stub/HttpJsonIntentsStub.java +++ b/java-dialogflow/google-cloud-dialogflow/src/main/java/com/google/cloud/dialogflow/v2beta1/stub/HttpJsonIntentsStub.java @@ -102,7 +102,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam( fields, "languageCode", request.getLanguageCode()); serializer.putQueryParam(fields, "pageSize", request.getPageSize()); @@ -140,7 +141,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam(fields, "languageCode", request.getLanguageCode()); return fields; }) @@ -176,7 +178,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam( fields, "languageCode", request.getLanguageCode()); return fields; @@ -218,7 +221,8 @@ public class HttpJsonIntentsStub extends IntentsStub { Map> fields = new HashMap<>(); ProtoRestSerializer serializer = ProtoRestSerializer.create(); - serializer.putQueryParam(fields, "intentView", request.getIntentView()); + serializer.putQueryParam( + fields, "intentView", request.getIntentViewValue()); serializer.putQueryParam( fields, "languageCode", request.getLanguageCode()); serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); diff --git a/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/MockParticipantsImpl.java b/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/MockParticipantsImpl.java index 98edd1d60906..b54d46288b03 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/MockParticipantsImpl.java +++ b/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/MockParticipantsImpl.java @@ -163,6 +163,43 @@ public void analyzeContent( } } + @Override + public StreamObserver streamingAnalyzeContent( + final StreamObserver responseObserver) { + StreamObserver requestObserver = + new StreamObserver() { + @Override + public void onNext(StreamingAnalyzeContentRequest value) { + requests.add(value); + final Object response = responses.remove(); + if (response instanceof StreamingAnalyzeContentResponse) { + responseObserver.onNext(((StreamingAnalyzeContentResponse) response)); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method StreamingAnalyzeContent, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + StreamingAnalyzeContentResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void onError(Throwable t) { + responseObserver.onError(t); + } + + @Override + public void onCompleted() { + responseObserver.onCompleted(); + } + }; + return requestObserver; + } + @Override public void suggestArticles( SuggestArticlesRequest request, StreamObserver responseObserver) { diff --git a/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientHttpJsonTest.java b/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientHttpJsonTest.java index 96a16e42f099..ed902b88bed5 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientHttpJsonTest.java +++ b/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientHttpJsonTest.java @@ -93,6 +93,7 @@ public void createParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockService.addResponse(expectedResponse); @@ -146,6 +147,7 @@ public void createParticipantTest2() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockService.addResponse(expectedResponse); @@ -197,6 +199,7 @@ public void getParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockService.addResponse(expectedResponse); @@ -250,6 +253,7 @@ public void getParticipantTest2() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockService.addResponse(expectedResponse); @@ -403,6 +407,7 @@ public void updateParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockService.addResponse(expectedResponse); @@ -414,6 +419,7 @@ public void updateParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -451,6 +457,7 @@ public void updateParticipantExceptionTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); FieldMask updateMask = FieldMask.newBuilder().build(); @@ -681,6 +688,12 @@ public void analyzeContentExceptionTest4() throws Exception { } } + @Test + public void streamingAnalyzeContentUnsupportedMethodTest() throws Exception { + // The streamingAnalyzeContent() method is not supported in REST transport. + // This empty test is generated for technical reasons. + } + @Test public void suggestArticlesTest() throws Exception { SuggestArticlesResponse expectedResponse = diff --git a/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientTest.java b/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientTest.java index 1c41292b72ba..d4c67f3165fe 100644 --- a/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientTest.java +++ b/java-dialogflow/google-cloud-dialogflow/src/test/java/com/google/cloud/dialogflow/v2/ParticipantsClientTest.java @@ -24,8 +24,12 @@ 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.cloud.location.GetLocationRequest; import com.google.cloud.location.ListLocationsRequest; import com.google.cloud.location.ListLocationsResponse; @@ -34,6 +38,7 @@ import com.google.protobuf.AbstractMessage; import com.google.protobuf.Any; import com.google.protobuf.FieldMask; +import com.google.protobuf.Struct; import io.grpc.StatusRuntimeException; import java.io.IOException; import java.util.ArrayList; @@ -41,6 +46,7 @@ import java.util.HashMap; 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; @@ -99,6 +105,7 @@ public void createParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockParticipants.addResponse(expectedResponse); @@ -147,6 +154,7 @@ public void createParticipantTest2() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockParticipants.addResponse(expectedResponse); @@ -193,6 +201,7 @@ public void getParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockParticipants.addResponse(expectedResponse); @@ -240,6 +249,7 @@ public void getParticipantTest2() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockParticipants.addResponse(expectedResponse); @@ -373,6 +383,7 @@ public void updateParticipantTest() throws Exception { "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") .toString()) .setSipRecordingMediaLabel("sipRecordingMediaLabel-1887770873") + .setObfuscatedExternalUserId("obfuscatedExternalUserId1778228693") .putAllDocumentsMetadataFilters(new HashMap()) .build(); mockParticipants.addResponse(expectedResponse); @@ -606,6 +617,86 @@ public void analyzeContentExceptionTest4() throws Exception { } } + @Test + public void streamingAnalyzeContentTest() throws Exception { + StreamingAnalyzeContentResponse expectedResponse = + StreamingAnalyzeContentResponse.newBuilder() + .setRecognitionResult(StreamingRecognitionResult.newBuilder().build()) + .setReplyText("replyText-433699017") + .setReplyAudio(OutputAudio.newBuilder().build()) + .setAutomatedAgentReply(AutomatedAgentReply.newBuilder().build()) + .setMessage(Message.newBuilder().build()) + .addAllHumanAgentSuggestionResults(new ArrayList()) + .addAllEndUserSuggestionResults(new ArrayList()) + .setDtmfParameters(DtmfParameters.newBuilder().build()) + .build(); + mockParticipants.addResponse(expectedResponse); + StreamingAnalyzeContentRequest request = + StreamingAnalyzeContentRequest.newBuilder() + .setParticipant( + ParticipantName.ofProjectConversationParticipantName( + "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") + .toString()) + .setReplyAudioConfig(OutputAudioConfig.newBuilder().build()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setAssistQueryParams(AssistQueryParameters.newBuilder().build()) + .setCxParameters(Struct.newBuilder().build()) + .setEnablePartialAutomatedAgentReply(true) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + BidiStreamingCallable + callable = client.streamingAnalyzeContentCallable(); + 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 streamingAnalyzeContentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockParticipants.addException(exception); + StreamingAnalyzeContentRequest request = + StreamingAnalyzeContentRequest.newBuilder() + .setParticipant( + ParticipantName.ofProjectConversationParticipantName( + "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") + .toString()) + .setReplyAudioConfig(OutputAudioConfig.newBuilder().build()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setAssistQueryParams(AssistQueryParameters.newBuilder().build()) + .setCxParameters(Struct.newBuilder().build()) + .setEnablePartialAutomatedAgentReply(true) + .build(); + + MockStreamObserver responseObserver = + new MockStreamObserver<>(); + + BidiStreamingCallable + callable = client.streamingAnalyzeContentCallable(); + 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()); + } + } + @Test public void suggestArticlesTest() throws Exception { SuggestArticlesResponse expectedResponse = diff --git a/java-dialogflow/grpc-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsGrpc.java b/java-dialogflow/grpc-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsGrpc.java index 431867d89be6..503b2edba946 100644 --- a/java-dialogflow/grpc-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsGrpc.java +++ b/java-dialogflow/grpc-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantsGrpc.java @@ -267,6 +267,56 @@ private ParticipantsGrpc() {} return getAnalyzeContentMethod; } + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse> + getStreamingAnalyzeContentMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StreamingAnalyzeContent", + requestType = com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.class, + responseType = com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse> + getStreamingAnalyzeContentMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse> + getStreamingAnalyzeContentMethod; + if ((getStreamingAnalyzeContentMethod = ParticipantsGrpc.getStreamingAnalyzeContentMethod) + == null) { + synchronized (ParticipantsGrpc.class) { + if ((getStreamingAnalyzeContentMethod = ParticipantsGrpc.getStreamingAnalyzeContentMethod) + == null) { + ParticipantsGrpc.getStreamingAnalyzeContentMethod = + getStreamingAnalyzeContentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "StreamingAnalyzeContent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new ParticipantsMethodDescriptorSupplier("StreamingAnalyzeContent")) + .build(); + } + } + } + return getStreamingAnalyzeContentMethod; + } + private static volatile io.grpc.MethodDescriptor< com.google.cloud.dialogflow.v2.SuggestArticlesRequest, com.google.cloud.dialogflow.v2.SuggestArticlesResponse> @@ -536,6 +586,35 @@ public void analyzeContent( getAnalyzeContentMethod(), responseObserver); } + /** + * + * + *
+     * Adds a text (chat, for example), or audio (phone recording, for example)
+     * message from a participant into the conversation.
+     * Note: This method is only available through the gRPC API (not REST).
+     * The top-level message sent to the client by the server is
+     * `StreamingAnalyzeContentResponse`. Multiple response messages can be
+     * returned in order. The first one or more messages contain the
+     * `recognition_result` field. Each result represents a more complete
+     * transcript of what the user said. The next message contains the
+     * `reply_text` field and potentially the `reply_audio` field. The message can
+     * also contain the `automated_agent_reply` field.
+     * Note: Always use agent versions for production traffic
+     * sent to virtual agents. See [Versions and
+     * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
+     * 
+ */ + public io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest> + streamingAnalyzeContent( + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse> + responseObserver) { + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall( + getStreamingAnalyzeContentMethod(), responseObserver); + } + /** * * @@ -621,6 +700,13 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.cloud.dialogflow.v2.AnalyzeContentRequest, com.google.cloud.dialogflow.v2.AnalyzeContentResponse>( this, METHODID_ANALYZE_CONTENT))) + .addMethod( + getStreamingAnalyzeContentMethod(), + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( + new MethodHandlers< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse>( + this, METHODID_STREAMING_ANALYZE_CONTENT))) .addMethod( getSuggestArticlesMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -750,6 +836,36 @@ public void analyzeContent( responseObserver); } + /** + * + * + *
+     * Adds a text (chat, for example), or audio (phone recording, for example)
+     * message from a participant into the conversation.
+     * Note: This method is only available through the gRPC API (not REST).
+     * The top-level message sent to the client by the server is
+     * `StreamingAnalyzeContentResponse`. Multiple response messages can be
+     * returned in order. The first one or more messages contain the
+     * `recognition_result` field. Each result represents a more complete
+     * transcript of what the user said. The next message contains the
+     * `reply_text` field and potentially the `reply_audio` field. The message can
+     * also contain the `automated_agent_reply` field.
+     * Note: Always use agent versions for production traffic
+     * sent to virtual agents. See [Versions and
+     * environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
+     * 
+ */ + public io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest> + streamingAnalyzeContent( + io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse> + responseObserver) { + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( + getChannel().newCall(getStreamingAnalyzeContentMethod(), getCallOptions()), + responseObserver); + } + /** * * @@ -1083,6 +1199,7 @@ protected ParticipantsFutureStub build( private static final int METHODID_SUGGEST_ARTICLES = 5; private static final int METHODID_SUGGEST_FAQ_ANSWERS = 6; private static final int METHODID_SUGGEST_SMART_REPLIES = 7; + private static final int METHODID_STREAMING_ANALYZE_CONTENT = 8; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -1161,6 +1278,12 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv public io.grpc.stub.StreamObserver invoke( io.grpc.stub.StreamObserver responseObserver) { switch (methodId) { + case METHODID_STREAMING_ANALYZE_CONTENT: + return (io.grpc.stub.StreamObserver) + serviceImpl.streamingAnalyzeContent( + (io.grpc.stub.StreamObserver< + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse>) + responseObserver); default: throw new AssertionError(); } @@ -1220,6 +1343,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .addMethod(getListParticipantsMethod()) .addMethod(getUpdateParticipantMethod()) .addMethod(getAnalyzeContentMethod()) + .addMethod(getStreamingAnalyzeContentMethod()) .addMethod(getSuggestArticlesMethod()) .addMethod(getSuggestFaqAnswersMethod()) .addMethod(getSuggestSmartRepliesMethod()) diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java index af7b46a81fae..03d876799d59 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/AudioConfigProto.java @@ -51,6 +51,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_dialogflow_v2_OutputAudioConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dialogflow_v2_OutputAudioConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -95,38 +99,47 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + ".cloud.dialogflow.v2.OutputAudioEncoding" + "B\003\340A\002\022\031\n\021sample_rate_hertz\030\002 \001(\005\022T\n\030synt" + "hesize_speech_config\030\003 \001(\01322.google.clou" - + "d.dialogflow.v2.SynthesizeSpeechConfig\"b" - + "\n\022SpeechToTextConfig\022L\n\024speech_model_var" - + "iant\030\001 \001(\0162..google.cloud.dialogflow.v2." - + "SpeechModelVariant*\373\001\n\rAudioEncoding\022\036\n\032" - + "AUDIO_ENCODING_UNSPECIFIED\020\000\022\034\n\030AUDIO_EN" - + "CODING_LINEAR_16\020\001\022\027\n\023AUDIO_ENCODING_FLA" - + "C\020\002\022\030\n\024AUDIO_ENCODING_MULAW\020\003\022\026\n\022AUDIO_E" - + "NCODING_AMR\020\004\022\031\n\025AUDIO_ENCODING_AMR_WB\020\005" - + "\022\033\n\027AUDIO_ENCODING_OGG_OPUS\020\006\022)\n%AUDIO_E" - + "NCODING_SPEEX_WITH_HEADER_BYTE\020\007*v\n\022Spee" - + "chModelVariant\022$\n SPEECH_MODEL_VARIANT_U" - + "NSPECIFIED\020\000\022\026\n\022USE_BEST_AVAILABLE\020\001\022\020\n\014" - + "USE_STANDARD\020\002\022\020\n\014USE_ENHANCED\020\003*\215\001\n\017Ssm" - + "lVoiceGender\022!\n\035SSML_VOICE_GENDER_UNSPEC" - + "IFIED\020\000\022\032\n\026SSML_VOICE_GENDER_MALE\020\001\022\034\n\030S" - + "SML_VOICE_GENDER_FEMALE\020\002\022\035\n\031SSML_VOICE_" - + "GENDER_NEUTRAL\020\003*\354\001\n\023OutputAudioEncoding" - + "\022%\n!OUTPUT_AUDIO_ENCODING_UNSPECIFIED\020\000\022" - + "#\n\037OUTPUT_AUDIO_ENCODING_LINEAR_16\020\001\022\035\n\031" - + "OUTPUT_AUDIO_ENCODING_MP3\020\002\022%\n!OUTPUT_AU" - + "DIO_ENCODING_MP3_64_KBPS\020\004\022\"\n\036OUTPUT_AUD" - + "IO_ENCODING_OGG_OPUS\020\003\022\037\n\033OUTPUT_AUDIO_E" - + "NCODING_MULAW\020\005B\334\002\n\036com.google.cloud.dia" - + "logflow.v2B\020AudioConfigProtoP\001ZDgoogle.g" - + "olang.org/genproto/googleapis/cloud/dial" - + "ogflow/v2;dialogflow\370\001\001\242\002\002DF\252\002\032Google.Cl" - + "oud.Dialogflow.V2\352AU\n\033automl.googleapis." - + "com/Model\0226projects/{project}/locations/" - + "{location}/models/{model}\352Ab\n\037speech.goo" - + "gleapis.com/PhraseSet\022?projects/{project" - + "}/locations/{location}/phraseSets/{phras" - + "e_set}b\006proto3" + + "d.dialogflow.v2.SynthesizeSpeechConfig\"U" + + "\n\023TelephonyDtmfEvents\022>\n\013dtmf_events\030\001 \003" + + "(\0162).google.cloud.dialogflow.v2.Telephon" + + "yDtmf\"q\n\022SpeechToTextConfig\022L\n\024speech_mo" + + "del_variant\030\001 \001(\0162..google.cloud.dialogf" + + "low.v2.SpeechModelVariant\022\r\n\005model\030\002 \001(\t" + + "*\373\001\n\rAudioEncoding\022\036\n\032AUDIO_ENCODING_UNS" + + "PECIFIED\020\000\022\034\n\030AUDIO_ENCODING_LINEAR_16\020\001" + + "\022\027\n\023AUDIO_ENCODING_FLAC\020\002\022\030\n\024AUDIO_ENCOD" + + "ING_MULAW\020\003\022\026\n\022AUDIO_ENCODING_AMR\020\004\022\031\n\025A" + + "UDIO_ENCODING_AMR_WB\020\005\022\033\n\027AUDIO_ENCODING" + + "_OGG_OPUS\020\006\022)\n%AUDIO_ENCODING_SPEEX_WITH" + + "_HEADER_BYTE\020\007*v\n\022SpeechModelVariant\022$\n " + + "SPEECH_MODEL_VARIANT_UNSPECIFIED\020\000\022\026\n\022US" + + "E_BEST_AVAILABLE\020\001\022\020\n\014USE_STANDARD\020\002\022\020\n\014" + + "USE_ENHANCED\020\003*\215\001\n\017SsmlVoiceGender\022!\n\035SS" + + "ML_VOICE_GENDER_UNSPECIFIED\020\000\022\032\n\026SSML_VO" + + "ICE_GENDER_MALE\020\001\022\034\n\030SSML_VOICE_GENDER_F" + + "EMALE\020\002\022\035\n\031SSML_VOICE_GENDER_NEUTRAL\020\003*\354" + + "\001\n\023OutputAudioEncoding\022%\n!OUTPUT_AUDIO_E" + + "NCODING_UNSPECIFIED\020\000\022#\n\037OUTPUT_AUDIO_EN" + + "CODING_LINEAR_16\020\001\022\035\n\031OUTPUT_AUDIO_ENCOD" + + "ING_MP3\020\002\022%\n!OUTPUT_AUDIO_ENCODING_MP3_6" + + "4_KBPS\020\004\022\"\n\036OUTPUT_AUDIO_ENCODING_OGG_OP" + + "US\020\003\022\037\n\033OUTPUT_AUDIO_ENCODING_MULAW\020\005*\224\002" + + "\n\rTelephonyDtmf\022\036\n\032TELEPHONY_DTMF_UNSPEC" + + "IFIED\020\000\022\014\n\010DTMF_ONE\020\001\022\014\n\010DTMF_TWO\020\002\022\016\n\nD" + + "TMF_THREE\020\003\022\r\n\tDTMF_FOUR\020\004\022\r\n\tDTMF_FIVE\020" + + "\005\022\014\n\010DTMF_SIX\020\006\022\016\n\nDTMF_SEVEN\020\007\022\016\n\nDTMF_" + + "EIGHT\020\010\022\r\n\tDTMF_NINE\020\t\022\r\n\tDTMF_ZERO\020\n\022\n\n" + + "\006DTMF_A\020\013\022\n\n\006DTMF_B\020\014\022\n\n\006DTMF_C\020\r\022\n\n\006DTM" + + "F_D\020\016\022\r\n\tDTMF_STAR\020\017\022\016\n\nDTMF_POUND\020\020B\334\002\n" + + "\036com.google.cloud.dialogflow.v2B\020AudioCo" + + "nfigProtoP\001ZDgoogle.golang.org/genproto/" + + "googleapis/cloud/dialogflow/v2;dialogflo" + + "w\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2\352A" + + "U\n\033automl.googleapis.com/Model\0226projects" + + "/{project}/locations/{location}/models/{" + + "model}\352Ab\n\037speech.googleapis.com/PhraseS" + + "et\022?projects/{project}/locations/{locati" + + "on}/phraseSets/{phrase_set}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -193,13 +206,21 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "AudioEncoding", "SampleRateHertz", "SynthesizeSpeechConfig", }); - internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_descriptor = + internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_descriptor = getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_descriptor, + new java.lang.String[] { + "DtmfEvents", + }); + internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_descriptor = + getDescriptor().getMessageTypes().get(7); internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SpeechToTextConfig_descriptor, new java.lang.String[] { - "SpeechModelVariant", + "SpeechModelVariant", "Model", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfig.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfig.java new file mode 100644 index 000000000000..738a0a8f71aa --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfig.java @@ -0,0 +1,628 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/participant.proto + +package com.google.cloud.dialogflow.v2; + +/** + * + * + *
+ * Defines the language used in the input text.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.InputTextConfig} + */ +public final class InputTextConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.InputTextConfig) + InputTextConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use InputTextConfig.newBuilder() to construct. + private InputTextConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InputTextConfig() { + languageCode_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InputTextConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_InputTextConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_InputTextConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.InputTextConfig.class, + com.google.cloud.dialogflow.v2.InputTextConfig.Builder.class); + } + + public static final int LANGUAGE_CODE_FIELD_NUMBER = 1; + private volatile java.lang.Object languageCode_; + /** + * + * + *
+   * Required. The language of this conversational query. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 1 [(.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 this conversational query. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 1 [(.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; + } + } + + 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(languageCode_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCode_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, languageCode_); + } + size += getUnknownFields().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.dialogflow.v2.InputTextConfig)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.InputTextConfig other = + (com.google.cloud.dialogflow.v2.InputTextConfig) obj; + + if (!getLanguageCode().equals(other.getLanguageCode())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + LANGUAGE_CODE_FIELD_NUMBER; + hash = (53 * hash) + getLanguageCode().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig 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.dialogflow.v2.InputTextConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig 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.dialogflow.v2.InputTextConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig 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.dialogflow.v2.InputTextConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig 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.dialogflow.v2.InputTextConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig 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.dialogflow.v2.InputTextConfig 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; + } + /** + * + * + *
+   * Defines the language used in the input text.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.InputTextConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.InputTextConfig) + com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_InputTextConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_InputTextConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.InputTextConfig.class, + com.google.cloud.dialogflow.v2.InputTextConfig.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.InputTextConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + languageCode_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_InputTextConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfig getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfig build() { + com.google.cloud.dialogflow.v2.InputTextConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfig buildPartial() { + com.google.cloud.dialogflow.v2.InputTextConfig result = + new com.google.cloud.dialogflow.v2.InputTextConfig(this); + 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.dialogflow.v2.InputTextConfig) { + return mergeFrom((com.google.cloud.dialogflow.v2.InputTextConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.InputTextConfig other) { + if (other == com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance()) return this; + if (!other.getLanguageCode().isEmpty()) { + languageCode_ = other.languageCode_; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + languageCode_ = input.readStringRequireUtf8(); + + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private java.lang.Object languageCode_ = ""; + /** + * + * + *
+     * Required. The language of this conversational query. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 1 [(.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 this conversational query. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 1 [(.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 this conversational query. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 1 [(.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 this conversational query. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearLanguageCode() { + + languageCode_ = getDefaultInstance().getLanguageCode(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The language of this conversational query. See [Language
+     * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+     * for a list of the currently supported language codes.
+     * 
+ * + * string language_code = 1 [(.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; + } + + @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.dialogflow.v2.InputTextConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.InputTextConfig) + private static final com.google.cloud.dialogflow.v2.InputTextConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.InputTextConfig(); + } + + public static com.google.cloud.dialogflow.v2.InputTextConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InputTextConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.dialogflow.v2.InputTextConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfigOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfigOrBuilder.java new file mode 100644 index 000000000000..1af3041f1e70 --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/InputTextConfigOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/participant.proto + +package com.google.cloud.dialogflow.v2; + +public interface InputTextConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.InputTextConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The language of this conversational query. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The languageCode. + */ + java.lang.String getLanguageCode(); + /** + * + * + *
+   * Required. The language of this conversational query. See [Language
+   * Support](https://cloud.google.com/dialogflow/docs/reference/language)
+   * for a list of the currently supported language codes.
+   * 
+ * + * string language_code = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for languageCode. + */ + com.google.protobuf.ByteString getLanguageCodeBytes(); +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Participant.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Participant.java index dc6c0ac436f1..a22fff3aa358 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Participant.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/Participant.java @@ -41,6 +41,7 @@ private Participant() { name_ = ""; role_ = 0; sipRecordingMediaLabel_ = ""; + obfuscatedExternalUserId_ = ""; } @java.lang.Override @@ -409,6 +410,95 @@ public com.google.protobuf.ByteString getSipRecordingMediaLabelBytes() { } } + public static final int OBFUSCATED_EXTERNAL_USER_ID_FIELD_NUMBER = 7; + private volatile java.lang.Object obfuscatedExternalUserId_; + /** + * + * + *
+   * Optional. Obfuscated user id that should be associated with the created participant.
+   * You can specify a user id as follows:
+   * 1. If you set this field in
+   *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+   *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+   *    Dialogflow adds the obfuscated user id with the participant.
+   * 2. If you set this field in
+   *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+   *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+   *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+   * Dialogflow returns an error if you try to add a user id for a
+   * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+   * Dialogflow uses this user id for billing and measurement purposes. For
+   * example, Dialogflow determines whether a user in one conversation returned
+   * in a later conversation.
+   * Note:
+   * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+   *   id first.
+   * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+   *   hash function like SHA-512.
+   * * The length of the user id must be <= 256 characters.
+   * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The obfuscatedExternalUserId. + */ + @java.lang.Override + public java.lang.String getObfuscatedExternalUserId() { + java.lang.Object ref = obfuscatedExternalUserId_; + 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(); + obfuscatedExternalUserId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Obfuscated user id that should be associated with the created participant.
+   * You can specify a user id as follows:
+   * 1. If you set this field in
+   *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+   *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+   *    Dialogflow adds the obfuscated user id with the participant.
+   * 2. If you set this field in
+   *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+   *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+   *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+   * Dialogflow returns an error if you try to add a user id for a
+   * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+   * Dialogflow uses this user id for billing and measurement purposes. For
+   * example, Dialogflow determines whether a user in one conversation returned
+   * in a later conversation.
+   * Note:
+   * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+   *   id first.
+   * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+   *   hash function like SHA-512.
+   * * The length of the user id must be <= 256 characters.
+   * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for obfuscatedExternalUserId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getObfuscatedExternalUserIdBytes() { + java.lang.Object ref = obfuscatedExternalUserId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + obfuscatedExternalUserId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int DOCUMENTS_METADATA_FILTERS_FIELD_NUMBER = 8; private static final class DocumentsMetadataFiltersDefaultEntryHolder { @@ -604,6 +694,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sipRecordingMediaLabel_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sipRecordingMediaLabel_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(obfuscatedExternalUserId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, obfuscatedExternalUserId_); + } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetDocumentsMetadataFilters(), @@ -627,6 +720,10 @@ public int getSerializedSize() { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sipRecordingMediaLabel_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sipRecordingMediaLabel_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(obfuscatedExternalUserId_)) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize(7, obfuscatedExternalUserId_); + } for (java.util.Map.Entry entry : internalGetDocumentsMetadataFilters().getMap().entrySet()) { com.google.protobuf.MapEntry documentsMetadataFilters__ = @@ -657,6 +754,7 @@ public boolean equals(final java.lang.Object obj) { if (!getName().equals(other.getName())) return false; if (role_ != other.role_) return false; if (!getSipRecordingMediaLabel().equals(other.getSipRecordingMediaLabel())) return false; + if (!getObfuscatedExternalUserId().equals(other.getObfuscatedExternalUserId())) return false; if (!internalGetDocumentsMetadataFilters().equals(other.internalGetDocumentsMetadataFilters())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; @@ -676,6 +774,8 @@ public int hashCode() { hash = (53 * hash) + role_; hash = (37 * hash) + SIP_RECORDING_MEDIA_LABEL_FIELD_NUMBER; hash = (53 * hash) + getSipRecordingMediaLabel().hashCode(); + hash = (37 * hash) + OBFUSCATED_EXTERNAL_USER_ID_FIELD_NUMBER; + hash = (53 * hash) + getObfuscatedExternalUserId().hashCode(); if (!internalGetDocumentsMetadataFilters().getMap().isEmpty()) { hash = (37 * hash) + DOCUMENTS_METADATA_FILTERS_FIELD_NUMBER; hash = (53 * hash) + internalGetDocumentsMetadataFilters().hashCode(); @@ -844,6 +944,8 @@ public Builder clear() { sipRecordingMediaLabel_ = ""; + obfuscatedExternalUserId_ = ""; + internalGetMutableDocumentsMetadataFilters().clear(); return this; } @@ -876,6 +978,7 @@ public com.google.cloud.dialogflow.v2.Participant buildPartial() { result.name_ = name_; result.role_ = role_; result.sipRecordingMediaLabel_ = sipRecordingMediaLabel_; + result.obfuscatedExternalUserId_ = obfuscatedExternalUserId_; result.documentsMetadataFilters_ = internalGetDocumentsMetadataFilters(); result.documentsMetadataFilters_.makeImmutable(); onBuilt(); @@ -938,6 +1041,10 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.Participant other) { sipRecordingMediaLabel_ = other.sipRecordingMediaLabel_; onChanged(); } + if (!other.getObfuscatedExternalUserId().isEmpty()) { + obfuscatedExternalUserId_ = other.obfuscatedExternalUserId_; + onChanged(); + } internalGetMutableDocumentsMetadataFilters() .mergeFrom(other.internalGetDocumentsMetadataFilters()); this.mergeUnknownFields(other.getUnknownFields()); @@ -984,6 +1091,12 @@ public Builder mergeFrom( break; } // case 50 + case 58: + { + obfuscatedExternalUserId_ = input.readStringRequireUtf8(); + + break; + } // case 58 case 66: { com.google.protobuf.MapEntry @@ -1355,6 +1468,217 @@ public Builder setSipRecordingMediaLabelBytes(com.google.protobuf.ByteString val return this; } + private java.lang.Object obfuscatedExternalUserId_ = ""; + /** + * + * + *
+     * Optional. Obfuscated user id that should be associated with the created participant.
+     * You can specify a user id as follows:
+     * 1. If you set this field in
+     *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+     *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+     *    Dialogflow adds the obfuscated user id with the participant.
+     * 2. If you set this field in
+     *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+     *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+     *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+     * Dialogflow returns an error if you try to add a user id for a
+     * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+     * Dialogflow uses this user id for billing and measurement purposes. For
+     * example, Dialogflow determines whether a user in one conversation returned
+     * in a later conversation.
+     * Note:
+     * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+     *   id first.
+     * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+     *   hash function like SHA-512.
+     * * The length of the user id must be <= 256 characters.
+     * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The obfuscatedExternalUserId. + */ + public java.lang.String getObfuscatedExternalUserId() { + java.lang.Object ref = obfuscatedExternalUserId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + obfuscatedExternalUserId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Obfuscated user id that should be associated with the created participant.
+     * You can specify a user id as follows:
+     * 1. If you set this field in
+     *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+     *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+     *    Dialogflow adds the obfuscated user id with the participant.
+     * 2. If you set this field in
+     *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+     *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+     *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+     * Dialogflow returns an error if you try to add a user id for a
+     * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+     * Dialogflow uses this user id for billing and measurement purposes. For
+     * example, Dialogflow determines whether a user in one conversation returned
+     * in a later conversation.
+     * Note:
+     * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+     *   id first.
+     * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+     *   hash function like SHA-512.
+     * * The length of the user id must be <= 256 characters.
+     * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The bytes for obfuscatedExternalUserId. + */ + public com.google.protobuf.ByteString getObfuscatedExternalUserIdBytes() { + java.lang.Object ref = obfuscatedExternalUserId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + obfuscatedExternalUserId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Obfuscated user id that should be associated with the created participant.
+     * You can specify a user id as follows:
+     * 1. If you set this field in
+     *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+     *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+     *    Dialogflow adds the obfuscated user id with the participant.
+     * 2. If you set this field in
+     *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+     *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+     *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+     * Dialogflow returns an error if you try to add a user id for a
+     * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+     * Dialogflow uses this user id for billing and measurement purposes. For
+     * example, Dialogflow determines whether a user in one conversation returned
+     * in a later conversation.
+     * Note:
+     * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+     *   id first.
+     * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+     *   hash function like SHA-512.
+     * * The length of the user id must be <= 256 characters.
+     * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The obfuscatedExternalUserId to set. + * @return This builder for chaining. + */ + public Builder setObfuscatedExternalUserId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + obfuscatedExternalUserId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Obfuscated user id that should be associated with the created participant.
+     * You can specify a user id as follows:
+     * 1. If you set this field in
+     *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+     *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+     *    Dialogflow adds the obfuscated user id with the participant.
+     * 2. If you set this field in
+     *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+     *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+     *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+     * Dialogflow returns an error if you try to add a user id for a
+     * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+     * Dialogflow uses this user id for billing and measurement purposes. For
+     * example, Dialogflow determines whether a user in one conversation returned
+     * in a later conversation.
+     * Note:
+     * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+     *   id first.
+     * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+     *   hash function like SHA-512.
+     * * The length of the user id must be <= 256 characters.
+     * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearObfuscatedExternalUserId() { + + obfuscatedExternalUserId_ = getDefaultInstance().getObfuscatedExternalUserId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Obfuscated user id that should be associated with the created participant.
+     * You can specify a user id as follows:
+     * 1. If you set this field in
+     *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+     *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+     *    Dialogflow adds the obfuscated user id with the participant.
+     * 2. If you set this field in
+     *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+     *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+     *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+     * Dialogflow returns an error if you try to add a user id for a
+     * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+     * Dialogflow uses this user id for billing and measurement purposes. For
+     * example, Dialogflow determines whether a user in one conversation returned
+     * in a later conversation.
+     * Note:
+     * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+     *   id first.
+     * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+     *   hash function like SHA-512.
+     * * The length of the user id must be <= 256 characters.
+     * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The bytes for obfuscatedExternalUserId to set. + * @return This builder for chaining. + */ + public Builder setObfuscatedExternalUserIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + obfuscatedExternalUserId_ = value; + onChanged(); + return this; + } + private com.google.protobuf.MapField documentsMetadataFilters_; diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantOrBuilder.java index c9e619d39924..eba103549fbb 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantOrBuilder.java @@ -112,6 +112,71 @@ public interface ParticipantOrBuilder */ com.google.protobuf.ByteString getSipRecordingMediaLabelBytes(); + /** + * + * + *
+   * Optional. Obfuscated user id that should be associated with the created participant.
+   * You can specify a user id as follows:
+   * 1. If you set this field in
+   *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+   *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+   *    Dialogflow adds the obfuscated user id with the participant.
+   * 2. If you set this field in
+   *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+   *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+   *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+   * Dialogflow returns an error if you try to add a user id for a
+   * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+   * Dialogflow uses this user id for billing and measurement purposes. For
+   * example, Dialogflow determines whether a user in one conversation returned
+   * in a later conversation.
+   * Note:
+   * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+   *   id first.
+   * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+   *   hash function like SHA-512.
+   * * The length of the user id must be <= 256 characters.
+   * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The obfuscatedExternalUserId. + */ + java.lang.String getObfuscatedExternalUserId(); + /** + * + * + *
+   * Optional. Obfuscated user id that should be associated with the created participant.
+   * You can specify a user id as follows:
+   * 1. If you set this field in
+   *    [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or
+   *    [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant],
+   *    Dialogflow adds the obfuscated user id with the participant.
+   * 2. If you set this field in
+   *    [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or
+   *    [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id],
+   *    Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id].
+   * Dialogflow returns an error if you try to add a user id for a
+   * non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant.
+   * Dialogflow uses this user id for billing and measurement purposes. For
+   * example, Dialogflow determines whether a user in one conversation returned
+   * in a later conversation.
+   * Note:
+   * * Please never pass raw user ids to Dialogflow. Always obfuscate your user
+   *   id first.
+   * * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a
+   *   hash function like SHA-512.
+   * * The length of the user id must be <= 256 characters.
+   * 
+ * + * string obfuscated_external_user_id = 7 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for obfuscatedExternalUserId. + */ + com.google.protobuf.ByteString getObfuscatedExternalUserIdBytes(); + /** * * diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java index 1159b14d84a5..df461ad107b8 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/ParticipantProto.java @@ -71,6 +71,14 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_dialogflow_v2_AnalyzeContentResponse_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dialogflow_v2_AnalyzeContentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dialogflow_v2_SuggestArticlesRequest_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -127,6 +135,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_dialogflow_v2_SuggestionResult_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_dialogflow_v2_SuggestionResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_dialogflow_v2_InputTextConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_dialogflow_v2_InputTextConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_dialogflow_v2_AnnotatedMessagePart_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -162,228 +174,266 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "google/protobuf/field_mask.proto\032\034google" + "/protobuf/struct.proto\032\037google/protobuf/" + "timestamp.proto\032\027google/rpc/status.proto" - + "\"\347\004\n\013Participant\022\021\n\004name\030\001 \001(\tB\003\340A\001\022?\n\004r" + + "\"\221\005\n\013Participant\022\021\n\004name\030\001 \001(\tB\003\340A\001\022?\n\004r" + "ole\030\002 \001(\0162,.google.cloud.dialogflow.v2.P" + "articipant.RoleB\003\340A\005\022&\n\031sip_recording_me" - + "dia_label\030\006 \001(\tB\003\340A\001\022n\n\032documents_metada" - + "ta_filters\030\010 \003(\0132E.google.cloud.dialogfl" - + "ow.v2.Participant.DocumentsMetadataFilte" - + "rsEntryB\003\340A\001\032?\n\035DocumentsMetadataFilters" - + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"P\n" - + "\004Role\022\024\n\020ROLE_UNSPECIFIED\020\000\022\017\n\013HUMAN_AGE" - + "NT\020\001\022\023\n\017AUTOMATED_AGENT\020\002\022\014\n\010END_USER\020\003:" - + "\330\001\352A\324\001\n%dialogflow.googleapis.com/Partic" - + "ipant\022Jprojects/{project}/conversations/" - + "{conversation}/participants/{participant" - + "}\022_projects/{project}/locations/{locatio" - + "n}/conversations/{conversation}/particip" - + "ants/{participant}\"\214\005\n\007Message\022\021\n\004name\030\001" - + " \001(\tB\003\340A\001\022\024\n\007content\030\002 \001(\tB\003\340A\002\022\032\n\rlangu" - + "age_code\030\003 \001(\tB\003\340A\001\022\030\n\013participant\030\004 \001(\t" - + "B\003\340A\003\022K\n\020participant_role\030\005 \001(\0162,.google" - + ".cloud.dialogflow.v2.Participant.RoleB\003\340" - + "A\003\0224\n\013create_time\030\006 \001(\0132\032.google.protobu" - + "f.TimestampB\003\340A\003\0222\n\tsend_time\030\t \001(\0132\032.go" - + "ogle.protobuf.TimestampB\003\340A\001\022N\n\022message_" - + "annotation\030\007 \001(\0132-.google.cloud.dialogfl" - + "ow.v2.MessageAnnotationB\003\340A\003\022T\n\022sentimen" - + "t_analysis\030\010 \001(\01323.google.cloud.dialogfl" - + "ow.v2.SentimentAnalysisResultB\003\340A\003:\304\001\352A\300" - + "\001\n!dialogflow.googleapis.com/Message\022Bpr" - + "ojects/{project}/conversations/{conversa" - + "tion}/messages/{message}\022Wprojects/{proj" - + "ect}/locations/{location}/conversations/" - + "{conversation}/messages/{message}\"\234\001\n\030Cr" - + "eateParticipantRequest\022=\n\006parent\030\001 \001(\tB-" - + "\340A\002\372A\'\022%dialogflow.googleapis.com/Partic" - + "ipant\022A\n\013participant\030\002 \001(\0132\'.google.clou" - + "d.dialogflow.v2.ParticipantB\003\340A\002\"T\n\025GetP" - + "articipantRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A\'\n" - + "%dialogflow.googleapis.com/Participant\"\211" - + "\001\n\027ListParticipantsRequest\022=\n\006parent\030\001 \001" - + "(\tB-\340A\002\372A\'\022%dialogflow.googleapis.com/Pa" - + "rticipant\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npag" - + "e_token\030\003 \001(\tB\003\340A\001\"r\n\030ListParticipantsRe" - + "sponse\022=\n\014participants\030\001 \003(\0132\'.google.cl" - + "oud.dialogflow.v2.Participant\022\027\n\017next_pa" - + "ge_token\030\002 \001(\t\"\223\001\n\030UpdateParticipantRequ" - + "est\022A\n\013participant\030\001 \001(\0132\'.google.cloud." - + "dialogflow.v2.ParticipantB\003\340A\002\0224\n\013update" - + "_mask\030\002 \001(\0132\032.google.protobuf.FieldMaskB" - + "\003\340A\002\"\202\004\n\025AnalyzeContentRequest\022B\n\013partic" - + "ipant\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow.googleap" - + "is.com/Participant\022;\n\ntext_input\030\006 \001(\0132%" - + ".google.cloud.dialogflow.v2.TextInputH\000\022" - + "=\n\013event_input\030\010 \001(\0132&.google.cloud.dial" - + "ogflow.v2.EventInputH\000\022I\n\022reply_audio_co" - + "nfig\030\005 \001(\0132-.google.cloud.dialogflow.v2." - + "OutputAudioConfig\022A\n\014query_params\030\t \001(\0132" - + "+.google.cloud.dialogflow.v2.QueryParame" - + "ters\022N\n\023assist_query_params\030\016 \001(\01321.goog" - + "le.cloud.dialogflow.v2.AssistQueryParame" - + "ters\022.\n\rcx_parameters\030\022 \001(\0132\027.google.pro" - + "tobuf.Struct\022\022\n\nrequest_id\030\013 \001(\tB\007\n\005inpu" - + "t\",\n\016DtmfParameters\022\032\n\022accepts_dtmf_inpu" - + "t\030\001 \001(\010\"\336\003\n\026AnalyzeContentResponse\022\022\n\nre" - + "ply_text\030\001 \001(\t\022<\n\013reply_audio\030\002 \001(\0132\'.go" - + "ogle.cloud.dialogflow.v2.OutputAudio\022N\n\025" - + "automated_agent_reply\030\003 \001(\0132/.google.clo" - + "ud.dialogflow.v2.AutomatedAgentReply\0224\n\007" - + "message\030\005 \001(\0132#.google.cloud.dialogflow." - + "v2.Message\022T\n\036human_agent_suggestion_res" - + "ults\030\006 \003(\0132,.google.cloud.dialogflow.v2." - + "SuggestionResult\022Q\n\033end_user_suggestion_" - + "results\030\007 \003(\0132,.google.cloud.dialogflow." - + "v2.SuggestionResult\022C\n\017dtmf_parameters\030\t" - + " \001(\0132*.google.cloud.dialogflow.v2.DtmfPa" - + "rameters\"\205\002\n\026SuggestArticlesRequest\022=\n\006p" + + "dia_label\030\006 \001(\tB\003\340A\001\022(\n\033obfuscated_exter" + + "nal_user_id\030\007 \001(\tB\003\340A\001\022n\n\032documents_meta" + + "data_filters\030\010 \003(\0132E.google.cloud.dialog" + + "flow.v2.Participant.DocumentsMetadataFil" + + "tersEntryB\003\340A\001\032?\n\035DocumentsMetadataFilte" + + "rsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"" + + "P\n\004Role\022\024\n\020ROLE_UNSPECIFIED\020\000\022\017\n\013HUMAN_A" + + "GENT\020\001\022\023\n\017AUTOMATED_AGENT\020\002\022\014\n\010END_USER\020" + + "\003:\330\001\352A\324\001\n%dialogflow.googleapis.com/Part" + + "icipant\022Jprojects/{project}/conversation" + + "s/{conversation}/participants/{participa" + + "nt}\022_projects/{project}/locations/{locat" + + "ion}/conversations/{conversation}/partic" + + "ipants/{participant}\"\214\005\n\007Message\022\021\n\004name" + + "\030\001 \001(\tB\003\340A\001\022\024\n\007content\030\002 \001(\tB\003\340A\002\022\032\n\rlan" + + "guage_code\030\003 \001(\tB\003\340A\001\022\030\n\013participant\030\004 \001" + + "(\tB\003\340A\003\022K\n\020participant_role\030\005 \001(\0162,.goog" + + "le.cloud.dialogflow.v2.Participant.RoleB" + + "\003\340A\003\0224\n\013create_time\030\006 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\003\0222\n\tsend_time\030\t \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\001\022N\n\022messag" + + "e_annotation\030\007 \001(\0132-.google.cloud.dialog" + + "flow.v2.MessageAnnotationB\003\340A\003\022T\n\022sentim" + + "ent_analysis\030\010 \001(\01323.google.cloud.dialog" + + "flow.v2.SentimentAnalysisResultB\003\340A\003:\304\001\352" + + "A\300\001\n!dialogflow.googleapis.com/Message\022B" + + "projects/{project}/conversations/{conver" + + "sation}/messages/{message}\022Wprojects/{pr" + + "oject}/locations/{location}/conversation" + + "s/{conversation}/messages/{message}\"\234\001\n\030" + + "CreateParticipantRequest\022=\n\006parent\030\001 \001(\t" + + "B-\340A\002\372A\'\022%dialogflow.googleapis.com/Part" + + "icipant\022A\n\013participant\030\002 \001(\0132\'.google.cl" + + "oud.dialogflow.v2.ParticipantB\003\340A\002\"T\n\025Ge" + + "tParticipantRequest\022;\n\004name\030\001 \001(\tB-\340A\002\372A" + + "\'\n%dialogflow.googleapis.com/Participant" + + "\"\211\001\n\027ListParticipantsRequest\022=\n\006parent\030\001" + + " \001(\tB-\340A\002\372A\'\022%dialogflow.googleapis.com/" + + "Participant\022\026\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\np" + + "age_token\030\003 \001(\tB\003\340A\001\"r\n\030ListParticipants" + + "Response\022=\n\014participants\030\001 \003(\0132\'.google." + + "cloud.dialogflow.v2.Participant\022\027\n\017next_" + + "page_token\030\002 \001(\t\"\223\001\n\030UpdateParticipantRe" + + "quest\022A\n\013participant\030\001 \001(\0132\'.google.clou" + + "d.dialogflow.v2.ParticipantB\003\340A\002\0224\n\013upda" + + "te_mask\030\002 \001(\0132\032.google.protobuf.FieldMas" + + "kB\003\340A\002\"\202\004\n\025AnalyzeContentRequest\022B\n\013part" + + "icipant\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow.google" + + "apis.com/Participant\022;\n\ntext_input\030\006 \001(\013" + + "2%.google.cloud.dialogflow.v2.TextInputH" + + "\000\022=\n\013event_input\030\010 \001(\0132&.google.cloud.di" + + "alogflow.v2.EventInputH\000\022I\n\022reply_audio_" + + "config\030\005 \001(\0132-.google.cloud.dialogflow.v" + + "2.OutputAudioConfig\022A\n\014query_params\030\t \001(" + + "\0132+.google.cloud.dialogflow.v2.QueryPara" + + "meters\022N\n\023assist_query_params\030\016 \001(\01321.go" + + "ogle.cloud.dialogflow.v2.AssistQueryPara" + + "meters\022.\n\rcx_parameters\030\022 \001(\0132\027.google.p" + + "rotobuf.Struct\022\022\n\nrequest_id\030\013 \001(\tB\007\n\005in" + + "put\",\n\016DtmfParameters\022\032\n\022accepts_dtmf_in" + + "put\030\001 \001(\010\"\336\003\n\026AnalyzeContentResponse\022\022\n\n" + + "reply_text\030\001 \001(\t\022<\n\013reply_audio\030\002 \001(\0132\'." + + "google.cloud.dialogflow.v2.OutputAudio\022N" + + "\n\025automated_agent_reply\030\003 \001(\0132/.google.c" + + "loud.dialogflow.v2.AutomatedAgentReply\0224" + + "\n\007message\030\005 \001(\0132#.google.cloud.dialogflo" + + "w.v2.Message\022T\n\036human_agent_suggestion_r" + + "esults\030\006 \003(\0132,.google.cloud.dialogflow.v" + + "2.SuggestionResult\022Q\n\033end_user_suggestio" + + "n_results\030\007 \003(\0132,.google.cloud.dialogflo" + + "w.v2.SuggestionResult\022C\n\017dtmf_parameters" + + "\030\t \001(\0132*.google.cloud.dialogflow.v2.Dtmf" + + "Parameters\"\261\005\n\036StreamingAnalyzeContentRe" + + "quest\022B\n\013participant\030\001 \001(\tB-\340A\002\372A\'\n%dial" + + "ogflow.googleapis.com/Participant\022D\n\014aud" + + "io_config\030\002 \001(\0132,.google.cloud.dialogflo" + + "w.v2.InputAudioConfigH\000\022B\n\013text_config\030\003" + + " \001(\0132+.google.cloud.dialogflow.v2.InputT" + + "extConfigH\000\022I\n\022reply_audio_config\030\004 \001(\0132" + + "-.google.cloud.dialogflow.v2.OutputAudio" + + "Config\022\025\n\013input_audio\030\005 \001(\014H\001\022\024\n\ninput_t" + + "ext\030\006 \001(\tH\001\022E\n\ninput_dtmf\030\t \001(\0132/.google" + + ".cloud.dialogflow.v2.TelephonyDtmfEvents" + + "H\001\022A\n\014query_params\030\007 \001(\0132+.google.cloud." + + "dialogflow.v2.QueryParameters\022N\n\023assist_" + + "query_params\030\010 \001(\01321.google.cloud.dialog" + + "flow.v2.AssistQueryParameters\022.\n\rcx_para" + + "meters\030\r \001(\0132\027.google.protobuf.Struct\022,\n" + + "$enable_partial_automated_agent_reply\030\014 " + + "\001(\010B\010\n\006configB\007\n\005input\"\273\004\n\037StreamingAnal" + + "yzeContentResponse\022R\n\022recognition_result" + + "\030\001 \001(\01326.google.cloud.dialogflow.v2.Stre" + + "amingRecognitionResult\022\022\n\nreply_text\030\002 \001" + + "(\t\022<\n\013reply_audio\030\003 \001(\0132\'.google.cloud.d" + + "ialogflow.v2.OutputAudio\022N\n\025automated_ag" + + "ent_reply\030\004 \001(\0132/.google.cloud.dialogflo" + + "w.v2.AutomatedAgentReply\0224\n\007message\030\006 \001(" + + "\0132#.google.cloud.dialogflow.v2.Message\022T" + + "\n\036human_agent_suggestion_results\030\007 \003(\0132," + + ".google.cloud.dialogflow.v2.SuggestionRe" + + "sult\022Q\n\033end_user_suggestion_results\030\010 \003(" + + "\0132,.google.cloud.dialogflow.v2.Suggestio" + + "nResult\022C\n\017dtmf_parameters\030\n \001(\0132*.googl" + + "e.cloud.dialogflow.v2.DtmfParameters\"\205\002\n" + + "\026SuggestArticlesRequest\022=\n\006parent\030\001 \001(\tB" + + "-\340A\002\372A\'\n%dialogflow.googleapis.com/Parti" + + "cipant\022A\n\016latest_message\030\002 \001(\tB)\340A\001\372A#\n!" + + "dialogflow.googleapis.com/Message\022\031\n\014con" + + "text_size\030\003 \001(\005B\003\340A\001\022N\n\023assist_query_par" + + "ams\030\004 \001(\01321.google.cloud.dialogflow.v2.A" + + "ssistQueryParameters\"\213\001\n\027SuggestArticles" + + "Response\022B\n\017article_answers\030\001 \003(\0132).goog" + + "le.cloud.dialogflow.v2.ArticleAnswer\022\026\n\016" + + "latest_message\030\002 \001(\t\022\024\n\014context_size\030\003 \001" + + "(\005\"\207\002\n\030SuggestFaqAnswersRequest\022=\n\006paren" + + "t\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow.googleapis.c" + + "om/Participant\022A\n\016latest_message\030\002 \001(\tB)" + + "\340A\001\372A#\n!dialogflow.googleapis.com/Messag" + + "e\022\031\n\014context_size\030\003 \001(\005B\003\340A\001\022N\n\023assist_q" + + "uery_params\030\004 \001(\01321.google.cloud.dialogf" + + "low.v2.AssistQueryParameters\"\205\001\n\031Suggest" + + "FaqAnswersResponse\022:\n\013faq_answers\030\001 \003(\0132" + + "%.google.cloud.dialogflow.v2.FaqAnswer\022\026" + + "\n\016latest_message\030\002 \001(\t\022\024\n\014context_size\030\003" + + " \001(\005\"\364\001\n\032SuggestSmartRepliesRequest\022=\n\006p" + "arent\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow.googleap" - + "is.com/Participant\022A\n\016latest_message\030\002 \001" - + "(\tB)\340A\001\372A#\n!dialogflow.googleapis.com/Me" - + "ssage\022\031\n\014context_size\030\003 \001(\005B\003\340A\001\022N\n\023assi" - + "st_query_params\030\004 \001(\01321.google.cloud.dia" - + "logflow.v2.AssistQueryParameters\"\213\001\n\027Sug" - + "gestArticlesResponse\022B\n\017article_answers\030" - + "\001 \003(\0132).google.cloud.dialogflow.v2.Artic" - + "leAnswer\022\026\n\016latest_message\030\002 \001(\t\022\024\n\014cont" - + "ext_size\030\003 \001(\005\"\207\002\n\030SuggestFaqAnswersRequ" - + "est\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n%dialogflow." - + "googleapis.com/Participant\022A\n\016latest_mes" - + "sage\030\002 \001(\tB)\340A\001\372A#\n!dialogflow.googleapi" - + "s.com/Message\022\031\n\014context_size\030\003 \001(\005B\003\340A\001" - + "\022N\n\023assist_query_params\030\004 \001(\01321.google.c" - + "loud.dialogflow.v2.AssistQueryParameters" - + "\"\205\001\n\031SuggestFaqAnswersResponse\022:\n\013faq_an" - + "swers\030\001 \003(\0132%.google.cloud.dialogflow.v2" - + ".FaqAnswer\022\026\n\016latest_message\030\002 \001(\t\022\024\n\014co" - + "ntext_size\030\003 \001(\005\"\364\001\n\032SuggestSmartReplies" - + "Request\022=\n\006parent\030\001 \001(\tB-\340A\002\372A\'\n%dialogf" - + "low.googleapis.com/Participant\022A\n\022curren" - + "t_text_input\030\004 \001(\0132%.google.cloud.dialog" - + "flow.v2.TextInput\022>\n\016latest_message\030\002 \001(" - + "\tB&\372A#\n!dialogflow.googleapis.com/Messag" - + "e\022\024\n\014context_size\030\003 \001(\005\"\303\001\n\033SuggestSmart" - + "RepliesResponse\022N\n\023smart_reply_answers\030\001" - + " \003(\0132,.google.cloud.dialogflow.v2.SmartR" - + "eplyAnswerB\003\340A\003\022>\n\016latest_message\030\002 \001(\tB" - + "&\372A#\n!dialogflow.googleapis.com/Message\022" - + "\024\n\014context_size\030\003 \001(\005\"[\n\013OutputAudio\022=\n\006" - + "config\030\001 \001(\0132-.google.cloud.dialogflow.v" - + "2.OutputAudioConfig\022\r\n\005audio\030\002 \001(\014\"\317\002\n\023A" - + "utomatedAgentReply\022P\n\026detect_intent_resp" - + "onse\030\001 \001(\01320.google.cloud.dialogflow.v2." - + "DetectIntentResponse\022k\n\032automated_agent_" - + "reply_type\030\007 \001(\0162G.google.cloud.dialogfl" - + "ow.v2.AutomatedAgentReply.AutomatedAgent" - + "ReplyType\022\032\n\022allow_cancellation\030\010 \001(\010\"]\n" - + "\027AutomatedAgentReplyType\022*\n&AUTOMATED_AG" - + "ENT_REPLY_TYPE_UNSPECIFIED\020\000\022\013\n\007PARTIAL\020" - + "\001\022\t\n\005FINAL\020\002\"\344\001\n\rArticleAnswer\022\r\n\005title\030" - + "\001 \001(\t\022\013\n\003uri\030\002 \001(\t\022\020\n\010snippets\030\003 \003(\t\022\022\n\n" - + "confidence\030\004 \001(\002\022I\n\010metadata\030\005 \003(\01327.goo" - + "gle.cloud.dialogflow.v2.ArticleAnswer.Me" - + "tadataEntry\022\025\n\ranswer_record\030\006 \001(\t\032/\n\rMe" - + "tadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" - + "\0028\001\"\340\001\n\tFaqAnswer\022\016\n\006answer\030\001 \001(\t\022\022\n\ncon" - + "fidence\030\002 \001(\002\022\020\n\010question\030\003 \001(\t\022\016\n\006sourc" - + "e\030\004 \001(\t\022E\n\010metadata\030\005 \003(\01323.google.cloud" - + ".dialogflow.v2.FaqAnswer.MetadataEntry\022\025" - + "\n\ranswer_record\030\006 \001(\t\032/\n\rMetadataEntry\022\013" - + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"y\n\020SmartR" - + "eplyAnswer\022\r\n\005reply\030\001 \001(\t\022\022\n\nconfidence\030" - + "\002 \001(\002\022B\n\ranswer_record\030\003 \001(\tB+\372A(\n&dialo" - + "gflow.googleapis.com/AnswerRecord\"\352\002\n\020Su" - + "ggestionResult\022#\n\005error\030\001 \001(\0132\022.google.r" - + "pc.StatusH\000\022X\n\031suggest_articles_response" - + "\030\002 \001(\01323.google.cloud.dialogflow.v2.Sugg" - + "estArticlesResponseH\000\022]\n\034suggest_faq_ans" - + "wers_response\030\003 \001(\01325.google.cloud.dialo" - + "gflow.v2.SuggestFaqAnswersResponseH\000\022a\n\036" - + "suggest_smart_replies_response\030\004 \001(\01327.g" - + "oogle.cloud.dialogflow.v2.SuggestSmartRe" - + "pliesResponseH\000B\025\n\023suggestion_response\"j" - + "\n\024AnnotatedMessagePart\022\014\n\004text\030\001 \001(\t\022\023\n\013" - + "entity_type\030\002 \001(\t\022/\n\017formatted_value\030\003 \001" - + "(\0132\026.google.protobuf.Value\"n\n\021MessageAnn" - + "otation\022?\n\005parts\030\001 \003(\01320.google.cloud.di" - + "alogflow.v2.AnnotatedMessagePart\022\030\n\020cont" - + "ain_entities\030\002 \001(\010\"\315\001\n\025AssistQueryParame" - + "ters\022s\n\032documents_metadata_filters\030\001 \003(\013" - + "2O.google.cloud.dialogflow.v2.AssistQuer" - + "yParameters.DocumentsMetadataFiltersEntr" - + "y\032?\n\035DocumentsMetadataFiltersEntry\022\013\n\003ke" - + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\337\024\n\014Participa" - + "nts\022\245\002\n\021CreateParticipant\0224.google.cloud" - + ".dialogflow.v2.CreateParticipantRequest\032" - + "\'.google.cloud.dialogflow.v2.Participant" - + "\"\260\001\202\323\344\223\002\224\001\"4/v2/{parent=projects/*/conve" - + "rsations/*}/participants:\013participantZO\"" - + "@/v2/{parent=projects/*/locations/*/conv" - + "ersations/*}/participants:\013participant\332A" - + "\022parent,participant\022\366\001\n\016GetParticipant\0221" - + ".google.cloud.dialogflow.v2.GetParticipa" - + "ntRequest\032\'.google.cloud.dialogflow.v2.P" - + "articipant\"\207\001\202\323\344\223\002z\0224/v2/{name=projects/" - + "*/conversations/*/participants/*}ZB\022@/v2" - + "/{name=projects/*/locations/*/conversati" - + "ons/*/participants/*}\332A\004name\022\211\002\n\020ListPar" - + "ticipants\0223.google.cloud.dialogflow.v2.L" - + "istParticipantsRequest\0324.google.cloud.di" - + "alogflow.v2.ListParticipantsResponse\"\211\001\202" - + "\323\344\223\002z\0224/v2/{parent=projects/*/conversati" - + "ons/*}/participantsZB\022@/v2/{parent=proje" - + "cts/*/locations/*/conversations/*}/parti" - + "cipants\332A\006parent\022\302\002\n\021UpdateParticipant\0224" - + ".google.cloud.dialogflow.v2.UpdatePartic" - + "ipantRequest\032\'.google.cloud.dialogflow.v" - + "2.Participant\"\315\001\202\323\344\223\002\254\0012@/v2/{participan" - + "t.name=projects/*/conversations/*/partic" - + "ipants/*}:\013participantZ[2L/v2/{participa" - + "nt.name=projects/*/locations/*/conversat" - + "ions/*/participants/*}:\013participant\332A\027pa" - + "rticipant,update_mask\022\340\002\n\016AnalyzeContent" - + "\0221.google.cloud.dialogflow.v2.AnalyzeCon" - + "tentRequest\0322.google.cloud.dialogflow.v2" - + ".AnalyzeContentResponse\"\346\001\202\323\344\223\002\254\001\"J/v2/{" - + "participant=projects/*/conversations/*/p" - + "articipants/*}:analyzeContent:\001*Z[\"V/v2/" - + "{participant=projects/*/locations/*/conv" - + "ersations/*/participants/*}:analyzeConte" - + "nt:\001*\332A\026participant,text_input\332A\027partici" - + "pant,event_input\022\311\002\n\017SuggestArticles\0222.g" - + "oogle.cloud.dialogflow.v2.SuggestArticle" - + "sRequest\0323.google.cloud.dialogflow.v2.Su" - + "ggestArticlesResponse\"\314\001\202\323\344\223\002\274\001\"R/v2/{pa" - + "rent=projects/*/conversations/*/particip" - + "ants/*}/suggestions:suggestArticles:\001*Zc" - + "\"^/v2/{parent=projects/*/locations/*/con" - + "versations/*/participants/*}/suggestions" - + ":suggestArticles:\001*\332A\006parent\022\323\002\n\021Suggest" - + "FaqAnswers\0224.google.cloud.dialogflow.v2." - + "SuggestFaqAnswersRequest\0325.google.cloud." - + "dialogflow.v2.SuggestFaqAnswersResponse\"" - + "\320\001\202\323\344\223\002\300\001\"T/v2/{parent=projects/*/conver" - + "sations/*/participants/*}/suggestions:su" - + "ggestFaqAnswers:\001*Ze\"`/v2/{parent=projec" - + "ts/*/locations/*/conversations/*/partici" - + "pants/*}/suggestions:suggestFaqAnswers:\001" - + "*\332A\006parent\022\335\002\n\023SuggestSmartReplies\0226.goo" - + "gle.cloud.dialogflow.v2.SuggestSmartRepl" - + "iesRequest\0327.google.cloud.dialogflow.v2." - + "SuggestSmartRepliesResponse\"\324\001\202\323\344\223\002\304\001\"V/" - + "v2/{parent=projects/*/conversations/*/pa" - + "rticipants/*}/suggestions:suggestSmartRe" - + "plies:\001*Zg\"b/v2/{parent=projects/*/locat" + + "is.com/Participant\022A\n\022current_text_input" + + "\030\004 \001(\0132%.google.cloud.dialogflow.v2.Text" + + "Input\022>\n\016latest_message\030\002 \001(\tB&\372A#\n!dial" + + "ogflow.googleapis.com/Message\022\024\n\014context" + + "_size\030\003 \001(\005\"\303\001\n\033SuggestSmartRepliesRespo" + + "nse\022N\n\023smart_reply_answers\030\001 \003(\0132,.googl" + + "e.cloud.dialogflow.v2.SmartReplyAnswerB\003" + + "\340A\003\022>\n\016latest_message\030\002 \001(\tB&\372A#\n!dialog" + + "flow.googleapis.com/Message\022\024\n\014context_s" + + "ize\030\003 \001(\005\"[\n\013OutputAudio\022=\n\006config\030\001 \001(\013" + + "2-.google.cloud.dialogflow.v2.OutputAudi" + + "oConfig\022\r\n\005audio\030\002 \001(\014\"\317\002\n\023AutomatedAgen" + + "tReply\022P\n\026detect_intent_response\030\001 \001(\01320" + + ".google.cloud.dialogflow.v2.DetectIntent" + + "Response\022k\n\032automated_agent_reply_type\030\007" + + " \001(\0162G.google.cloud.dialogflow.v2.Automa" + + "tedAgentReply.AutomatedAgentReplyType\022\032\n" + + "\022allow_cancellation\030\010 \001(\010\"]\n\027AutomatedAg" + + "entReplyType\022*\n&AUTOMATED_AGENT_REPLY_TY" + + "PE_UNSPECIFIED\020\000\022\013\n\007PARTIAL\020\001\022\t\n\005FINAL\020\002" + + "\"\344\001\n\rArticleAnswer\022\r\n\005title\030\001 \001(\t\022\013\n\003uri" + + "\030\002 \001(\t\022\020\n\010snippets\030\003 \003(\t\022\022\n\nconfidence\030\004" + + " \001(\002\022I\n\010metadata\030\005 \003(\01327.google.cloud.di" + + "alogflow.v2.ArticleAnswer.MetadataEntry\022" + + "\025\n\ranswer_record\030\006 \001(\t\032/\n\rMetadataEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\340\001\n\tFaqA" + + "nswer\022\016\n\006answer\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(" + + "\002\022\020\n\010question\030\003 \001(\t\022\016\n\006source\030\004 \001(\t\022E\n\010m" + + "etadata\030\005 \003(\01323.google.cloud.dialogflow." + + "v2.FaqAnswer.MetadataEntry\022\025\n\ranswer_rec" + + "ord\030\006 \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022" + + "\r\n\005value\030\002 \001(\t:\0028\001\"y\n\020SmartReplyAnswer\022\r" + + "\n\005reply\030\001 \001(\t\022\022\n\nconfidence\030\002 \001(\002\022B\n\rans" + + "wer_record\030\003 \001(\tB+\372A(\n&dialogflow.google" + + "apis.com/AnswerRecord\"\352\002\n\020SuggestionResu" + + "lt\022#\n\005error\030\001 \001(\0132\022.google.rpc.StatusH\000\022" + + "X\n\031suggest_articles_response\030\002 \001(\01323.goo" + + "gle.cloud.dialogflow.v2.SuggestArticlesR" + + "esponseH\000\022]\n\034suggest_faq_answers_respons" + + "e\030\003 \001(\01325.google.cloud.dialogflow.v2.Sug" + + "gestFaqAnswersResponseH\000\022a\n\036suggest_smar" + + "t_replies_response\030\004 \001(\01327.google.cloud." + + "dialogflow.v2.SuggestSmartRepliesRespons" + + "eH\000B\025\n\023suggestion_response\"-\n\017InputTextC" + + "onfig\022\032\n\rlanguage_code\030\001 \001(\tB\003\340A\002\"j\n\024Ann" + + "otatedMessagePart\022\014\n\004text\030\001 \001(\t\022\023\n\013entit" + + "y_type\030\002 \001(\t\022/\n\017formatted_value\030\003 \001(\0132\026." + + "google.protobuf.Value\"n\n\021MessageAnnotati" + + "on\022?\n\005parts\030\001 \003(\01320.google.cloud.dialogf" + + "low.v2.AnnotatedMessagePart\022\030\n\020contain_e" + + "ntities\030\002 \001(\010\"\315\001\n\025AssistQueryParameters\022" + + "s\n\032documents_metadata_filters\030\001 \003(\0132O.go" + + "ogle.cloud.dialogflow.v2.AssistQueryPara" + + "meters.DocumentsMetadataFiltersEntry\032?\n\035" + + "DocumentsMetadataFiltersEntry\022\013\n\003key\030\001 \001" + + "(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\372\025\n\014Participants\022\245" + + "\002\n\021CreateParticipant\0224.google.cloud.dial" + + "ogflow.v2.CreateParticipantRequest\032\'.goo" + + "gle.cloud.dialogflow.v2.Participant\"\260\001\202\323" + + "\344\223\002\224\001\"4/v2/{parent=projects/*/conversati" + + "ons/*}/participants:\013participantZO\"@/v2/" + + "{parent=projects/*/locations/*/conversat" + + "ions/*}/participants:\013participant\332A\022pare" + + "nt,participant\022\366\001\n\016GetParticipant\0221.goog" + + "le.cloud.dialogflow.v2.GetParticipantReq" + + "uest\032\'.google.cloud.dialogflow.v2.Partic" + + "ipant\"\207\001\202\323\344\223\002z\0224/v2/{name=projects/*/con" + + "versations/*/participants/*}ZB\022@/v2/{nam" + + "e=projects/*/locations/*/conversations/*" + + "/participants/*}\332A\004name\022\211\002\n\020ListParticip" + + "ants\0223.google.cloud.dialogflow.v2.ListPa" + + "rticipantsRequest\0324.google.cloud.dialogf" + + "low.v2.ListParticipantsResponse\"\211\001\202\323\344\223\002z" + + "\0224/v2/{parent=projects/*/conversations/*" + + "}/participantsZB\022@/v2/{parent=projects/*" + + "/locations/*/conversations/*}/participan" + + "ts\332A\006parent\022\302\002\n\021UpdateParticipant\0224.goog" + + "le.cloud.dialogflow.v2.UpdateParticipant" + + "Request\032\'.google.cloud.dialogflow.v2.Par" + + "ticipant\"\315\001\202\323\344\223\002\254\0012@/v2/{participant.nam" + + "e=projects/*/conversations/*/participant" + + "s/*}:\013participantZ[2L/v2/{participant.na" + + "me=projects/*/locations/*/conversations/" + + "*/participants/*}:\013participant\332A\027partici" + + "pant,update_mask\022\340\002\n\016AnalyzeContent\0221.go" + + "ogle.cloud.dialogflow.v2.AnalyzeContentR" + + "equest\0322.google.cloud.dialogflow.v2.Anal" + + "yzeContentResponse\"\346\001\202\323\344\223\002\254\001\"J/v2/{parti" + + "cipant=projects/*/conversations/*/partic" + + "ipants/*}:analyzeContent:\001*Z[\"V/v2/{part" + + "icipant=projects/*/locations/*/conversat" + + "ions/*/participants/*}:analyzeContent:\001*" + + "\332A\026participant,text_input\332A\027participant," + + "event_input\022\230\001\n\027StreamingAnalyzeContent\022" + + ":.google.cloud.dialogflow.v2.StreamingAn" + + "alyzeContentRequest\032;.google.cloud.dialo" + + "gflow.v2.StreamingAnalyzeContentResponse" + + "\"\000(\0010\001\022\311\002\n\017SuggestArticles\0222.google.clou" + + "d.dialogflow.v2.SuggestArticlesRequest\0323" + + ".google.cloud.dialogflow.v2.SuggestArtic" + + "lesResponse\"\314\001\202\323\344\223\002\274\001\"R/v2/{parent=proje" + + "cts/*/conversations/*/participants/*}/su" + + "ggestions:suggestArticles:\001*Zc\"^/v2/{par" + + "ent=projects/*/locations/*/conversations" + + "/*/participants/*}/suggestions:suggestAr" + + "ticles:\001*\332A\006parent\022\323\002\n\021SuggestFaqAnswers" + + "\0224.google.cloud.dialogflow.v2.SuggestFaq" + + "AnswersRequest\0325.google.cloud.dialogflow" + + ".v2.SuggestFaqAnswersResponse\"\320\001\202\323\344\223\002\300\001\"" + + "T/v2/{parent=projects/*/conversations/*/" + + "participants/*}/suggestions:suggestFaqAn" + + "swers:\001*Ze\"`/v2/{parent=projects/*/locat" + "ions/*/conversations/*/participants/*}/s" - + "uggestions:suggestSmartReplies:\001*\332A\006pare" - + "nt\032x\312A\031dialogflow.googleapis.com\322AYhttps" - + "://www.googleapis.com/auth/cloud-platfor" - + "m,https://www.googleapis.com/auth/dialog" - + "flowB\237\001\n\036com.google.cloud.dialogflow.v2B" - + "\020ParticipantProtoP\001ZDgoogle.golang.org/g" - + "enproto/googleapis/cloud/dialogflow/v2;d" - + "ialogflow\370\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogf" - + "low.V2b\006proto3" + + "uggestions:suggestFaqAnswers:\001*\332A\006parent" + + "\022\335\002\n\023SuggestSmartReplies\0226.google.cloud." + + "dialogflow.v2.SuggestSmartRepliesRequest" + + "\0327.google.cloud.dialogflow.v2.SuggestSma" + + "rtRepliesResponse\"\324\001\202\323\344\223\002\304\001\"V/v2/{parent" + + "=projects/*/conversations/*/participants" + + "/*}/suggestions:suggestSmartReplies:\001*Zg" + + "\"b/v2/{parent=projects/*/locations/*/con" + + "versations/*/participants/*}/suggestions" + + ":suggestSmartReplies:\001*\332A\006parent\032x\312A\031dia" + + "logflow.googleapis.com\322AYhttps://www.goo" + + "gleapis.com/auth/cloud-platform,https://" + + "www.googleapis.com/auth/dialogflowB\237\001\n\036c" + + "om.google.cloud.dialogflow.v2B\020Participa" + + "ntProtoP\001ZDgoogle.golang.org/genproto/go" + + "ogleapis/cloud/dialogflow/v2;dialogflow\370" + + "\001\001\242\002\002DF\252\002\032Google.Cloud.Dialogflow.V2b\006pr" + + "oto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -406,7 +456,11 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_Participant_descriptor, new java.lang.String[] { - "Name", "Role", "SipRecordingMediaLabel", "DocumentsMetadataFilters", + "Name", + "Role", + "SipRecordingMediaLabel", + "ObfuscatedExternalUserId", + "DocumentsMetadataFilters", }); internal_static_google_cloud_dialogflow_v2_Participant_DocumentsMetadataFiltersEntry_descriptor = internal_static_google_cloud_dialogflow_v2_Participant_descriptor.getNestedTypes().get(0); @@ -510,8 +564,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "EndUserSuggestionResults", "DtmfParameters", }); - internal_static_google_cloud_dialogflow_v2_SuggestArticlesRequest_descriptor = + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_descriptor = getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_descriptor, + new java.lang.String[] { + "Participant", + "AudioConfig", + "TextConfig", + "ReplyAudioConfig", + "InputAudio", + "InputText", + "InputDtmf", + "QueryParams", + "AssistQueryParams", + "CxParameters", + "EnablePartialAutomatedAgentReply", + "Config", + "Input", + }); + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_descriptor, + new java.lang.String[] { + "RecognitionResult", + "ReplyText", + "ReplyAudio", + "AutomatedAgentReply", + "Message", + "HumanAgentSuggestionResults", + "EndUserSuggestionResults", + "DtmfParameters", + }); + internal_static_google_cloud_dialogflow_v2_SuggestArticlesRequest_descriptor = + getDescriptor().getMessageTypes().get(12); internal_static_google_cloud_dialogflow_v2_SuggestArticlesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestArticlesRequest_descriptor, @@ -519,7 +608,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "LatestMessage", "ContextSize", "AssistQueryParams", }); internal_static_google_cloud_dialogflow_v2_SuggestArticlesResponse_descriptor = - getDescriptor().getMessageTypes().get(11); + getDescriptor().getMessageTypes().get(13); internal_static_google_cloud_dialogflow_v2_SuggestArticlesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestArticlesResponse_descriptor, @@ -527,7 +616,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "ArticleAnswers", "LatestMessage", "ContextSize", }); internal_static_google_cloud_dialogflow_v2_SuggestFaqAnswersRequest_descriptor = - getDescriptor().getMessageTypes().get(12); + getDescriptor().getMessageTypes().get(14); internal_static_google_cloud_dialogflow_v2_SuggestFaqAnswersRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestFaqAnswersRequest_descriptor, @@ -535,7 +624,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "LatestMessage", "ContextSize", "AssistQueryParams", }); internal_static_google_cloud_dialogflow_v2_SuggestFaqAnswersResponse_descriptor = - getDescriptor().getMessageTypes().get(13); + getDescriptor().getMessageTypes().get(15); internal_static_google_cloud_dialogflow_v2_SuggestFaqAnswersResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestFaqAnswersResponse_descriptor, @@ -543,7 +632,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "FaqAnswers", "LatestMessage", "ContextSize", }); internal_static_google_cloud_dialogflow_v2_SuggestSmartRepliesRequest_descriptor = - getDescriptor().getMessageTypes().get(14); + getDescriptor().getMessageTypes().get(16); internal_static_google_cloud_dialogflow_v2_SuggestSmartRepliesRequest_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestSmartRepliesRequest_descriptor, @@ -551,7 +640,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parent", "CurrentTextInput", "LatestMessage", "ContextSize", }); internal_static_google_cloud_dialogflow_v2_SuggestSmartRepliesResponse_descriptor = - getDescriptor().getMessageTypes().get(15); + getDescriptor().getMessageTypes().get(17); internal_static_google_cloud_dialogflow_v2_SuggestSmartRepliesResponse_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestSmartRepliesResponse_descriptor, @@ -559,7 +648,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SmartReplyAnswers", "LatestMessage", "ContextSize", }); internal_static_google_cloud_dialogflow_v2_OutputAudio_descriptor = - getDescriptor().getMessageTypes().get(16); + getDescriptor().getMessageTypes().get(18); internal_static_google_cloud_dialogflow_v2_OutputAudio_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_OutputAudio_descriptor, @@ -567,7 +656,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Config", "Audio", }); internal_static_google_cloud_dialogflow_v2_AutomatedAgentReply_descriptor = - getDescriptor().getMessageTypes().get(17); + getDescriptor().getMessageTypes().get(19); internal_static_google_cloud_dialogflow_v2_AutomatedAgentReply_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_AutomatedAgentReply_descriptor, @@ -575,7 +664,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "DetectIntentResponse", "AutomatedAgentReplyType", "AllowCancellation", }); internal_static_google_cloud_dialogflow_v2_ArticleAnswer_descriptor = - getDescriptor().getMessageTypes().get(18); + getDescriptor().getMessageTypes().get(20); internal_static_google_cloud_dialogflow_v2_ArticleAnswer_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_ArticleAnswer_descriptor, @@ -591,7 +680,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_dialogflow_v2_FaqAnswer_descriptor = - getDescriptor().getMessageTypes().get(19); + getDescriptor().getMessageTypes().get(21); internal_static_google_cloud_dialogflow_v2_FaqAnswer_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_FaqAnswer_descriptor, @@ -607,7 +696,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Key", "Value", }); internal_static_google_cloud_dialogflow_v2_SmartReplyAnswer_descriptor = - getDescriptor().getMessageTypes().get(20); + getDescriptor().getMessageTypes().get(22); internal_static_google_cloud_dialogflow_v2_SmartReplyAnswer_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SmartReplyAnswer_descriptor, @@ -615,7 +704,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Reply", "Confidence", "AnswerRecord", }); internal_static_google_cloud_dialogflow_v2_SuggestionResult_descriptor = - getDescriptor().getMessageTypes().get(21); + getDescriptor().getMessageTypes().get(23); internal_static_google_cloud_dialogflow_v2_SuggestionResult_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_SuggestionResult_descriptor, @@ -626,8 +715,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "SuggestSmartRepliesResponse", "SuggestionResponse", }); + internal_static_google_cloud_dialogflow_v2_InputTextConfig_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_google_cloud_dialogflow_v2_InputTextConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_dialogflow_v2_InputTextConfig_descriptor, + new java.lang.String[] { + "LanguageCode", + }); internal_static_google_cloud_dialogflow_v2_AnnotatedMessagePart_descriptor = - getDescriptor().getMessageTypes().get(22); + getDescriptor().getMessageTypes().get(25); internal_static_google_cloud_dialogflow_v2_AnnotatedMessagePart_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_AnnotatedMessagePart_descriptor, @@ -635,7 +732,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Text", "EntityType", "FormattedValue", }); internal_static_google_cloud_dialogflow_v2_MessageAnnotation_descriptor = - getDescriptor().getMessageTypes().get(23); + getDescriptor().getMessageTypes().get(26); internal_static_google_cloud_dialogflow_v2_MessageAnnotation_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_MessageAnnotation_descriptor, @@ -643,7 +740,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Parts", "ContainEntities", }); internal_static_google_cloud_dialogflow_v2_AssistQueryParameters_descriptor = - getDescriptor().getMessageTypes().get(24); + getDescriptor().getMessageTypes().get(27); internal_static_google_cloud_dialogflow_v2_AssistQueryParameters_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_dialogflow_v2_AssistQueryParameters_descriptor, diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java index 62617c082edb..fff262c82a86 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfig.java @@ -39,6 +39,7 @@ private SpeechToTextConfig(com.google.protobuf.GeneratedMessageV3.Builder bui private SpeechToTextConfig() { speechModelVariant_ = 0; + model_ = ""; } @java.lang.Override @@ -115,6 +116,67 @@ public com.google.cloud.dialogflow.v2.SpeechModelVariant getSpeechModelVariant() return result == null ? com.google.cloud.dialogflow.v2.SpeechModelVariant.UNRECOGNIZED : result; } + public static final int MODEL_FIELD_NUMBER = 2; + private volatile java.lang.Object model_; + /** + * + * + *
+   * Which Speech model to select. Select the model best suited to your domain
+   * to get best results. If a model is not explicitly specified, then a default
+   * model is used.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 2; + * + * @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 Speech model to select. Select the model best suited to your domain
+   * to get best results. If a model is not explicitly specified, then a default
+   * model is used.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 2; + * + * @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; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -134,6 +196,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(1, speechModelVariant_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, model_); + } getUnknownFields().writeTo(output); } @@ -148,6 +213,9 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, speechModelVariant_); } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(model_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, model_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -165,6 +233,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.dialogflow.v2.SpeechToTextConfig) obj; if (speechModelVariant_ != other.speechModelVariant_) return false; + if (!getModel().equals(other.getModel())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -178,6 +247,8 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + SPEECH_MODEL_VARIANT_FIELD_NUMBER; hash = (53 * hash) + speechModelVariant_; + hash = (37 * hash) + MODEL_FIELD_NUMBER; + hash = (53 * hash) + getModel().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -318,6 +389,8 @@ public Builder clear() { super.clear(); speechModelVariant_ = 0; + model_ = ""; + return this; } @@ -346,6 +419,7 @@ public com.google.cloud.dialogflow.v2.SpeechToTextConfig buildPartial() { com.google.cloud.dialogflow.v2.SpeechToTextConfig result = new com.google.cloud.dialogflow.v2.SpeechToTextConfig(this); result.speechModelVariant_ = speechModelVariant_; + result.model_ = model_; onBuilt(); return result; } @@ -399,6 +473,10 @@ public Builder mergeFrom(com.google.cloud.dialogflow.v2.SpeechToTextConfig other if (other.speechModelVariant_ != 0) { setSpeechModelVariantValue(other.getSpeechModelVariantValue()); } + if (!other.getModel().isEmpty()) { + model_ = other.model_; + onChanged(); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -431,6 +509,12 @@ public Builder mergeFrom( break; } // case 8 + case 18: + { + model_ = input.readStringRequireUtf8(); + + break; + } // case 18 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -571,6 +655,142 @@ public Builder clearSpeechModelVariant() { return this; } + private java.lang.Object model_ = ""; + /** + * + * + *
+     * Which Speech model to select. Select the model best suited to your domain
+     * to get best results. If a model is not explicitly specified, then a default
+     * model is used.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 2; + * + * @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 Speech model to select. Select the model best suited to your domain
+     * to get best results. If a model is not explicitly specified, then a default
+     * model is used.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 2; + * + * @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 Speech model to select. Select the model best suited to your domain
+     * to get best results. If a model is not explicitly specified, then a default
+     * model is used.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 2; + * + * @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 Speech model to select. Select the model best suited to your domain
+     * to get best results. If a model is not explicitly specified, then a default
+     * model is used.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 2; + * + * @return This builder for chaining. + */ + public Builder clearModel() { + + model_ = getDefaultInstance().getModel(); + onChanged(); + return this; + } + /** + * + * + *
+     * Which Speech model to select. Select the model best suited to your domain
+     * to get best results. If a model is not explicitly specified, then a default
+     * model is used.
+     * Refer to
+     * [Cloud Speech API
+     * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+     * for more details.
+     * 
+ * + * string model = 2; + * + * @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; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java index 12c64f937699..41989829784c 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/SpeechToTextConfigOrBuilder.java @@ -59,4 +59,41 @@ public interface SpeechToTextConfigOrBuilder * @return The speechModelVariant. */ com.google.cloud.dialogflow.v2.SpeechModelVariant getSpeechModelVariant(); + + /** + * + * + *
+   * Which Speech model to select. Select the model best suited to your domain
+   * to get best results. If a model is not explicitly specified, then a default
+   * model is used.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 2; + * + * @return The model. + */ + java.lang.String getModel(); + /** + * + * + *
+   * Which Speech model to select. Select the model best suited to your domain
+   * to get best results. If a model is not explicitly specified, then a default
+   * model is used.
+   * Refer to
+   * [Cloud Speech API
+   * documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model)
+   * for more details.
+   * 
+ * + * string model = 2; + * + * @return The bytes for model. + */ + com.google.protobuf.ByteString getModelBytes(); } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequest.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequest.java new file mode 100644 index 000000000000..961444d7efaf --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequest.java @@ -0,0 +1,3460 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/participant.proto + +package com.google.cloud.dialogflow.v2; + +/** + * + * + *
+ * The top-level message sent by the client to the
+ * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method.
+ * Multiple request messages should be sent in order:
+ * 1.  The first message must contain
+ *     [participant][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant],
+ *     [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] and optionally
+ *     [query_params][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.query_params]. If you want
+ *     to receive an audio response, it should also contain
+ *     [reply_audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.reply_audio_config].
+ *     The message must not contain
+ *     [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input].
+ * 2.  If [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message
+ *     was set to [audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.audio_config],
+ *     all subsequent messages must contain
+ *     [input_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_audio] to continue
+ *     with Speech recognition.
+ *     However, note that:
+ *     * Dialogflow will bill you for the audio so far.
+ *     * Dialogflow discards all Speech recognition results in favor of the
+ *       text input.
+ *  3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message was set
+ *    to [StreamingAnalyzeContentRequest.text_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.text_config], then the second message
+ *    must contain only [input_text][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_text].
+ *    Moreover, you must not send more than two messages.
+ *  After you sent all input, you must half-close or abort the request stream.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} + */ +public final class StreamingAnalyzeContentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) + StreamingAnalyzeContentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingAnalyzeContentRequest.newBuilder() to construct. + private StreamingAnalyzeContentRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingAnalyzeContentRequest() { + participant_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingAnalyzeContentRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.class, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.Builder.class); + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public enum ConfigCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUDIO_CONFIG(2), + TEXT_CONFIG(3), + CONFIG_NOT_SET(0); + private final int value; + + private ConfigCase(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 ConfigCase valueOf(int value) { + return forNumber(value); + } + + public static ConfigCase forNumber(int value) { + switch (value) { + case 2: + return AUDIO_CONFIG; + case 3: + return TEXT_CONFIG; + case 0: + return CONFIG_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + private int inputCase_ = 0; + private java.lang.Object input_; + + public enum InputCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + INPUT_AUDIO(5), + INPUT_TEXT(6), + INPUT_DTMF(9), + INPUT_NOT_SET(0); + private final int value; + + private InputCase(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 InputCase valueOf(int value) { + return forNumber(value); + } + + public static InputCase forNumber(int value) { + switch (value) { + case 5: + return INPUT_AUDIO; + case 6: + return INPUT_TEXT; + case 9: + return INPUT_DTMF; + case 0: + return INPUT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public InputCase getInputCase() { + return InputCase.forNumber(inputCase_); + } + + public static final int PARTICIPANT_FIELD_NUMBER = 1; + private volatile java.lang.Object participant_; + /** + * + * + *
+   * Required. The name of the participant this text comes from.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+   * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The participant. + */ + @java.lang.Override + public java.lang.String getParticipant() { + java.lang.Object ref = participant_; + 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(); + participant_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the participant this text comes from.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+   * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for participant. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParticipantBytes() { + java.lang.Object ref = participant_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + participant_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int AUDIO_CONFIG_FIELD_NUMBER = 2; + /** + * + * + *
+   * Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * + * @return Whether the audioConfig field is set. + */ + @java.lang.Override + public boolean hasAudioConfig() { + return configCase_ == 2; + } + /** + * + * + *
+   * Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * + * @return The audioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputAudioConfig getAudioConfig() { + if (configCase_ == 2) { + return (com.google.cloud.dialogflow.v2.InputAudioConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance(); + } + /** + * + * + *
+   * Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputAudioConfigOrBuilder getAudioConfigOrBuilder() { + if (configCase_ == 2) { + return (com.google.cloud.dialogflow.v2.InputAudioConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance(); + } + + public static final int TEXT_CONFIG_FIELD_NUMBER = 3; + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * + * @return Whether the textConfig field is set. + */ + @java.lang.Override + public boolean hasTextConfig() { + return configCase_ == 3; + } + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * + * @return The textConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfig getTextConfig() { + if (configCase_ == 3) { + return (com.google.cloud.dialogflow.v2.InputTextConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder getTextConfigOrBuilder() { + if (configCase_ == 3) { + return (com.google.cloud.dialogflow.v2.InputTextConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } + + public static final int REPLY_AUDIO_CONFIG_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.v2.OutputAudioConfig replyAudioConfig_; + /** + * + * + *
+   * Speech synthesis configuration.
+   * The speech synthesis settings for a virtual agent that may be configured
+   * for the associated conversation profile are not used when calling
+   * StreamingAnalyzeContent. If this configuration is not supplied, speech
+   * synthesis is disabled.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * + * @return Whether the replyAudioConfig field is set. + */ + @java.lang.Override + public boolean hasReplyAudioConfig() { + return replyAudioConfig_ != null; + } + /** + * + * + *
+   * Speech synthesis configuration.
+   * The speech synthesis settings for a virtual agent that may be configured
+   * for the associated conversation profile are not used when calling
+   * StreamingAnalyzeContent. If this configuration is not supplied, speech
+   * synthesis is disabled.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * + * @return The replyAudioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.OutputAudioConfig getReplyAudioConfig() { + return replyAudioConfig_ == null + ? com.google.cloud.dialogflow.v2.OutputAudioConfig.getDefaultInstance() + : replyAudioConfig_; + } + /** + * + * + *
+   * Speech synthesis configuration.
+   * The speech synthesis settings for a virtual agent that may be configured
+   * for the associated conversation profile are not used when calling
+   * StreamingAnalyzeContent. If this configuration is not supplied, speech
+   * synthesis is disabled.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.OutputAudioConfigOrBuilder getReplyAudioConfigOrBuilder() { + return getReplyAudioConfig(); + } + + public static final int INPUT_AUDIO_FIELD_NUMBER = 5; + /** + * + * + *
+   * The input audio content to be recognized. Must be sent if `audio_config`
+   * is set in the first message. The complete audio over all streaming
+   * messages must not exceed 1 minute.
+   * 
+ * + * bytes input_audio = 5; + * + * @return Whether the inputAudio field is set. + */ + @java.lang.Override + public boolean hasInputAudio() { + return inputCase_ == 5; + } + /** + * + * + *
+   * The input audio content to be recognized. Must be sent if `audio_config`
+   * is set in the first message. The complete audio over all streaming
+   * messages must not exceed 1 minute.
+   * 
+ * + * bytes input_audio = 5; + * + * @return The inputAudio. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputAudio() { + if (inputCase_ == 5) { + return (com.google.protobuf.ByteString) input_; + } + return com.google.protobuf.ByteString.EMPTY; + } + + public static final int INPUT_TEXT_FIELD_NUMBER = 6; + /** + * + * + *
+   * The UTF-8 encoded natural language text to be processed. Must be sent if
+   * `text_config` is set in the first message. Text length must not exceed
+   * 256 bytes for virtual agent interactions. The `input_text` field can be
+   * only sent once.
+   * 
+ * + * string input_text = 6; + * + * @return Whether the inputText field is set. + */ + public boolean hasInputText() { + return inputCase_ == 6; + } + /** + * + * + *
+   * The UTF-8 encoded natural language text to be processed. Must be sent if
+   * `text_config` is set in the first message. Text length must not exceed
+   * 256 bytes for virtual agent interactions. The `input_text` field can be
+   * only sent once.
+   * 
+ * + * string input_text = 6; + * + * @return The inputText. + */ + public java.lang.String getInputText() { + java.lang.Object ref = ""; + if (inputCase_ == 6) { + ref = input_; + } + 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 (inputCase_ == 6) { + input_ = s; + } + return s; + } + } + /** + * + * + *
+   * The UTF-8 encoded natural language text to be processed. Must be sent if
+   * `text_config` is set in the first message. Text length must not exceed
+   * 256 bytes for virtual agent interactions. The `input_text` field can be
+   * only sent once.
+   * 
+ * + * string input_text = 6; + * + * @return The bytes for inputText. + */ + public com.google.protobuf.ByteString getInputTextBytes() { + java.lang.Object ref = ""; + if (inputCase_ == 6) { + ref = input_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (inputCase_ == 6) { + input_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INPUT_DTMF_FIELD_NUMBER = 9; + /** + * + * + *
+   * The DTMF digits used to invoke intent and fill in parameter value.
+   * This input is ignored if the previous response indicated that DTMF input
+   * is not accepted.
+   * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * + * @return Whether the inputDtmf field is set. + */ + @java.lang.Override + public boolean hasInputDtmf() { + return inputCase_ == 9; + } + /** + * + * + *
+   * The DTMF digits used to invoke intent and fill in parameter value.
+   * This input is ignored if the previous response indicated that DTMF input
+   * is not accepted.
+   * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * + * @return The inputDtmf. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEvents getInputDtmf() { + if (inputCase_ == 9) { + return (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_; + } + return com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } + /** + * + * + *
+   * The DTMF digits used to invoke intent and fill in parameter value.
+   * This input is ignored if the previous response indicated that DTMF input
+   * is not accepted.
+   * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder getInputDtmfOrBuilder() { + if (inputCase_ == 9) { + return (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_; + } + return com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } + + public static final int QUERY_PARAMS_FIELD_NUMBER = 7; + private com.google.cloud.dialogflow.v2.QueryParameters queryParams_; + /** + * + * + *
+   * Parameters for a Dialogflow virtual-agent query.
+   * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * + * @return Whether the queryParams field is set. + */ + @java.lang.Override + public boolean hasQueryParams() { + return queryParams_ != null; + } + /** + * + * + *
+   * Parameters for a Dialogflow virtual-agent query.
+   * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * + * @return The queryParams. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.QueryParameters getQueryParams() { + return queryParams_ == null + ? com.google.cloud.dialogflow.v2.QueryParameters.getDefaultInstance() + : queryParams_; + } + /** + * + * + *
+   * Parameters for a Dialogflow virtual-agent query.
+   * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.QueryParametersOrBuilder getQueryParamsOrBuilder() { + return getQueryParams(); + } + + public static final int ASSIST_QUERY_PARAMS_FIELD_NUMBER = 8; + private com.google.cloud.dialogflow.v2.AssistQueryParameters assistQueryParams_; + /** + * + * + *
+   * Parameters for a human assist query.
+   * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * + * @return Whether the assistQueryParams field is set. + */ + @java.lang.Override + public boolean hasAssistQueryParams() { + return assistQueryParams_ != null; + } + /** + * + * + *
+   * Parameters for a human assist query.
+   * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * + * @return The assistQueryParams. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.AssistQueryParameters getAssistQueryParams() { + return assistQueryParams_ == null + ? com.google.cloud.dialogflow.v2.AssistQueryParameters.getDefaultInstance() + : assistQueryParams_; + } + /** + * + * + *
+   * Parameters for a human assist query.
+   * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.AssistQueryParametersOrBuilder + getAssistQueryParamsOrBuilder() { + return getAssistQueryParams(); + } + + public static final int CX_PARAMETERS_FIELD_NUMBER = 13; + private com.google.protobuf.Struct cxParameters_; + /** + * + * + *
+   * Additional parameters to be put into Dialogflow CX session parameters. To
+   * remove a parameter from the session, clients should explicitly set the
+   * parameter value to null.
+   * Note: this field should only be used if you are connecting to a Dialogflow
+   * CX agent.
+   * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + * + * @return Whether the cxParameters field is set. + */ + @java.lang.Override + public boolean hasCxParameters() { + return cxParameters_ != null; + } + /** + * + * + *
+   * Additional parameters to be put into Dialogflow CX session parameters. To
+   * remove a parameter from the session, clients should explicitly set the
+   * parameter value to null.
+   * Note: this field should only be used if you are connecting to a Dialogflow
+   * CX agent.
+   * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + * + * @return The cxParameters. + */ + @java.lang.Override + public com.google.protobuf.Struct getCxParameters() { + return cxParameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : cxParameters_; + } + /** + * + * + *
+   * Additional parameters to be put into Dialogflow CX session parameters. To
+   * remove a parameter from the session, clients should explicitly set the
+   * parameter value to null.
+   * Note: this field should only be used if you are connecting to a Dialogflow
+   * CX agent.
+   * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getCxParametersOrBuilder() { + return getCxParameters(); + } + + public static final int ENABLE_PARTIAL_AUTOMATED_AGENT_REPLY_FIELD_NUMBER = 12; + private boolean enablePartialAutomatedAgentReply_; + /** + * + * + *
+   * Enable partial virtual agent responses. If this flag is not enabled,
+   * response stream still contains only one final response even if some
+   * `Fulfillment`s in Dialogflow virtual agent have been configured to return
+   * partial responses.
+   * 
+ * + * bool enable_partial_automated_agent_reply = 12; + * + * @return The enablePartialAutomatedAgentReply. + */ + @java.lang.Override + public boolean getEnablePartialAutomatedAgentReply() { + return enablePartialAutomatedAgentReply_; + } + + 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(participant_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, participant_); + } + if (configCase_ == 2) { + output.writeMessage(2, (com.google.cloud.dialogflow.v2.InputAudioConfig) config_); + } + if (configCase_ == 3) { + output.writeMessage(3, (com.google.cloud.dialogflow.v2.InputTextConfig) config_); + } + if (replyAudioConfig_ != null) { + output.writeMessage(4, getReplyAudioConfig()); + } + if (inputCase_ == 5) { + output.writeBytes(5, (com.google.protobuf.ByteString) input_); + } + if (inputCase_ == 6) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, input_); + } + if (queryParams_ != null) { + output.writeMessage(7, getQueryParams()); + } + if (assistQueryParams_ != null) { + output.writeMessage(8, getAssistQueryParams()); + } + if (inputCase_ == 9) { + output.writeMessage(9, (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_); + } + if (enablePartialAutomatedAgentReply_ != false) { + output.writeBool(12, enablePartialAutomatedAgentReply_); + } + if (cxParameters_ != null) { + output.writeMessage(13, getCxParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(participant_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, participant_); + } + if (configCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.dialogflow.v2.InputAudioConfig) config_); + } + if (configCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.cloud.dialogflow.v2.InputTextConfig) config_); + } + if (replyAudioConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getReplyAudioConfig()); + } + if (inputCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeBytesSize( + 5, (com.google.protobuf.ByteString) input_); + } + if (inputCase_ == 6) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, input_); + } + if (queryParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getQueryParams()); + } + if (assistQueryParams_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getAssistQueryParams()); + } + if (inputCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_); + } + if (enablePartialAutomatedAgentReply_ != false) { + size += + com.google.protobuf.CodedOutputStream.computeBoolSize( + 12, enablePartialAutomatedAgentReply_); + } + if (cxParameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getCxParameters()); + } + size += getUnknownFields().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.dialogflow.v2.StreamingAnalyzeContentRequest)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest other = + (com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) obj; + + if (!getParticipant().equals(other.getParticipant())) return false; + if (hasReplyAudioConfig() != other.hasReplyAudioConfig()) return false; + if (hasReplyAudioConfig()) { + if (!getReplyAudioConfig().equals(other.getReplyAudioConfig())) return false; + } + if (hasQueryParams() != other.hasQueryParams()) return false; + if (hasQueryParams()) { + if (!getQueryParams().equals(other.getQueryParams())) return false; + } + if (hasAssistQueryParams() != other.hasAssistQueryParams()) return false; + if (hasAssistQueryParams()) { + if (!getAssistQueryParams().equals(other.getAssistQueryParams())) return false; + } + if (hasCxParameters() != other.hasCxParameters()) return false; + if (hasCxParameters()) { + if (!getCxParameters().equals(other.getCxParameters())) return false; + } + if (getEnablePartialAutomatedAgentReply() != other.getEnablePartialAutomatedAgentReply()) + return false; + if (!getConfigCase().equals(other.getConfigCase())) return false; + switch (configCase_) { + case 2: + if (!getAudioConfig().equals(other.getAudioConfig())) return false; + break; + case 3: + if (!getTextConfig().equals(other.getTextConfig())) return false; + break; + case 0: + default: + } + if (!getInputCase().equals(other.getInputCase())) return false; + switch (inputCase_) { + case 5: + if (!getInputAudio().equals(other.getInputAudio())) return false; + break; + case 6: + if (!getInputText().equals(other.getInputText())) return false; + break; + case 9: + if (!getInputDtmf().equals(other.getInputDtmf())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + PARTICIPANT_FIELD_NUMBER; + hash = (53 * hash) + getParticipant().hashCode(); + if (hasReplyAudioConfig()) { + hash = (37 * hash) + REPLY_AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getReplyAudioConfig().hashCode(); + } + if (hasQueryParams()) { + hash = (37 * hash) + QUERY_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getQueryParams().hashCode(); + } + if (hasAssistQueryParams()) { + hash = (37 * hash) + ASSIST_QUERY_PARAMS_FIELD_NUMBER; + hash = (53 * hash) + getAssistQueryParams().hashCode(); + } + if (hasCxParameters()) { + hash = (37 * hash) + CX_PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getCxParameters().hashCode(); + } + hash = (37 * hash) + ENABLE_PARTIAL_AUTOMATED_AGENT_REPLY_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashBoolean(getEnablePartialAutomatedAgentReply()); + switch (configCase_) { + case 2: + hash = (37 * hash) + AUDIO_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAudioConfig().hashCode(); + break; + case 3: + hash = (37 * hash) + TEXT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getTextConfig().hashCode(); + break; + case 0: + default: + } + switch (inputCase_) { + case 5: + hash = (37 * hash) + INPUT_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getInputAudio().hashCode(); + break; + case 6: + hash = (37 * hash) + INPUT_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getInputText().hashCode(); + break; + case 9: + hash = (37 * hash) + INPUT_DTMF_FIELD_NUMBER; + hash = (53 * hash) + getInputDtmf().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest 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.dialogflow.v2.StreamingAnalyzeContentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest 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.dialogflow.v2.StreamingAnalyzeContentRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest 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.dialogflow.v2.StreamingAnalyzeContentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest 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.dialogflow.v2.StreamingAnalyzeContentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest 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.dialogflow.v2.StreamingAnalyzeContentRequest 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 to the
+   * [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method.
+   * Multiple request messages should be sent in order:
+   * 1.  The first message must contain
+   *     [participant][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant],
+   *     [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] and optionally
+   *     [query_params][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.query_params]. If you want
+   *     to receive an audio response, it should also contain
+   *     [reply_audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.reply_audio_config].
+   *     The message must not contain
+   *     [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input].
+   * 2.  If [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message
+   *     was set to [audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.audio_config],
+   *     all subsequent messages must contain
+   *     [input_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_audio] to continue
+   *     with Speech recognition.
+   *     However, note that:
+   *     * Dialogflow will bill you for the audio so far.
+   *     * Dialogflow discards all Speech recognition results in favor of the
+   *       text input.
+   *  3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message was set
+   *    to [StreamingAnalyzeContentRequest.text_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.text_config], then the second message
+   *    must contain only [input_text][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_text].
+   *    Moreover, you must not send more than two messages.
+   *  After you sent all input, you must half-close or abort the request stream.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.class, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + participant_ = ""; + + if (audioConfigBuilder_ != null) { + audioConfigBuilder_.clear(); + } + if (textConfigBuilder_ != null) { + textConfigBuilder_.clear(); + } + if (replyAudioConfigBuilder_ == null) { + replyAudioConfig_ = null; + } else { + replyAudioConfig_ = null; + replyAudioConfigBuilder_ = null; + } + if (inputDtmfBuilder_ != null) { + inputDtmfBuilder_.clear(); + } + if (queryParamsBuilder_ == null) { + queryParams_ = null; + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + if (assistQueryParamsBuilder_ == null) { + assistQueryParams_ = null; + } else { + assistQueryParams_ = null; + assistQueryParamsBuilder_ = null; + } + if (cxParametersBuilder_ == null) { + cxParameters_ = null; + } else { + cxParameters_ = null; + cxParametersBuilder_ = null; + } + enablePartialAutomatedAgentReply_ = false; + + configCase_ = 0; + config_ = null; + inputCase_ = 0; + input_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest build() { + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest buildPartial() { + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest result = + new com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest(this); + result.participant_ = participant_; + if (configCase_ == 2) { + if (audioConfigBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = audioConfigBuilder_.build(); + } + } + if (configCase_ == 3) { + if (textConfigBuilder_ == null) { + result.config_ = config_; + } else { + result.config_ = textConfigBuilder_.build(); + } + } + if (replyAudioConfigBuilder_ == null) { + result.replyAudioConfig_ = replyAudioConfig_; + } else { + result.replyAudioConfig_ = replyAudioConfigBuilder_.build(); + } + if (inputCase_ == 5) { + result.input_ = input_; + } + if (inputCase_ == 6) { + result.input_ = input_; + } + if (inputCase_ == 9) { + if (inputDtmfBuilder_ == null) { + result.input_ = input_; + } else { + result.input_ = inputDtmfBuilder_.build(); + } + } + if (queryParamsBuilder_ == null) { + result.queryParams_ = queryParams_; + } else { + result.queryParams_ = queryParamsBuilder_.build(); + } + if (assistQueryParamsBuilder_ == null) { + result.assistQueryParams_ = assistQueryParams_; + } else { + result.assistQueryParams_ = assistQueryParamsBuilder_.build(); + } + if (cxParametersBuilder_ == null) { + result.cxParameters_ = cxParameters_; + } else { + result.cxParameters_ = cxParametersBuilder_.build(); + } + result.enablePartialAutomatedAgentReply_ = enablePartialAutomatedAgentReply_; + result.configCase_ = configCase_; + result.inputCase_ = inputCase_; + 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.dialogflow.v2.StreamingAnalyzeContentRequest) { + return mergeFrom((com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest other) { + if (other + == com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.getDefaultInstance()) + return this; + if (!other.getParticipant().isEmpty()) { + participant_ = other.participant_; + onChanged(); + } + if (other.hasReplyAudioConfig()) { + mergeReplyAudioConfig(other.getReplyAudioConfig()); + } + if (other.hasQueryParams()) { + mergeQueryParams(other.getQueryParams()); + } + if (other.hasAssistQueryParams()) { + mergeAssistQueryParams(other.getAssistQueryParams()); + } + if (other.hasCxParameters()) { + mergeCxParameters(other.getCxParameters()); + } + if (other.getEnablePartialAutomatedAgentReply() != false) { + setEnablePartialAutomatedAgentReply(other.getEnablePartialAutomatedAgentReply()); + } + switch (other.getConfigCase()) { + case AUDIO_CONFIG: + { + mergeAudioConfig(other.getAudioConfig()); + break; + } + case TEXT_CONFIG: + { + mergeTextConfig(other.getTextConfig()); + break; + } + case CONFIG_NOT_SET: + { + break; + } + } + switch (other.getInputCase()) { + case INPUT_AUDIO: + { + setInputAudio(other.getInputAudio()); + break; + } + case INPUT_TEXT: + { + inputCase_ = 6; + input_ = other.input_; + onChanged(); + break; + } + case INPUT_DTMF: + { + mergeInputDtmf(other.getInputDtmf()); + break; + } + case INPUT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + participant_ = input.readStringRequireUtf8(); + + break; + } // case 10 + case 18: + { + input.readMessage(getAudioConfigFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 2; + break; + } // case 18 + case 26: + { + input.readMessage(getTextConfigFieldBuilder().getBuilder(), extensionRegistry); + configCase_ = 3; + break; + } // case 26 + case 34: + { + input.readMessage( + getReplyAudioConfigFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 42: + { + input_ = input.readBytes(); + inputCase_ = 5; + break; + } // case 42 + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + inputCase_ = 6; + input_ = s; + break; + } // case 50 + case 58: + { + input.readMessage(getQueryParamsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 58 + case 66: + { + input.readMessage( + getAssistQueryParamsFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 66 + case 74: + { + input.readMessage(getInputDtmfFieldBuilder().getBuilder(), extensionRegistry); + inputCase_ = 9; + break; + } // case 74 + case 96: + { + enablePartialAutomatedAgentReply_ = input.readBool(); + + break; + } // case 96 + case 106: + { + input.readMessage(getCxParametersFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 106 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int configCase_ = 0; + private java.lang.Object config_; + + public ConfigCase getConfigCase() { + return ConfigCase.forNumber(configCase_); + } + + public Builder clearConfig() { + configCase_ = 0; + config_ = null; + onChanged(); + return this; + } + + private int inputCase_ = 0; + private java.lang.Object input_; + + public InputCase getInputCase() { + return InputCase.forNumber(inputCase_); + } + + public Builder clearInput() { + inputCase_ = 0; + input_ = null; + onChanged(); + return this; + } + + private java.lang.Object participant_ = ""; + /** + * + * + *
+     * Required. The name of the participant this text comes from.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+     * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The participant. + */ + public java.lang.String getParticipant() { + java.lang.Object ref = participant_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + participant_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the participant this text comes from.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+     * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for participant. + */ + public com.google.protobuf.ByteString getParticipantBytes() { + java.lang.Object ref = participant_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + participant_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the participant this text comes from.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+     * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The participant to set. + * @return This builder for chaining. + */ + public Builder setParticipant(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + participant_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the participant this text comes from.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+     * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParticipant() { + + participant_ = getDefaultInstance().getParticipant(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the participant this text comes from.
+     * Format: `projects/<Project ID>/locations/<Location
+     * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+     * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for participant to set. + * @return This builder for chaining. + */ + public Builder setParticipantBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + participant_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.InputAudioConfig, + com.google.cloud.dialogflow.v2.InputAudioConfig.Builder, + com.google.cloud.dialogflow.v2.InputAudioConfigOrBuilder> + audioConfigBuilder_; + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * + * @return Whether the audioConfig field is set. + */ + @java.lang.Override + public boolean hasAudioConfig() { + return configCase_ == 2; + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * + * @return The audioConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputAudioConfig getAudioConfig() { + if (audioConfigBuilder_ == null) { + if (configCase_ == 2) { + return (com.google.cloud.dialogflow.v2.InputAudioConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance(); + } else { + if (configCase_ == 2) { + return audioConfigBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + public Builder setAudioConfig(com.google.cloud.dialogflow.v2.InputAudioConfig value) { + if (audioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + audioConfigBuilder_.setMessage(value); + } + configCase_ = 2; + return this; + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + public Builder setAudioConfig( + com.google.cloud.dialogflow.v2.InputAudioConfig.Builder builderForValue) { + if (audioConfigBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + audioConfigBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 2; + return this; + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + public Builder mergeAudioConfig(com.google.cloud.dialogflow.v2.InputAudioConfig value) { + if (audioConfigBuilder_ == null) { + if (configCase_ == 2 + && config_ != com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance()) { + config_ = + com.google.cloud.dialogflow.v2.InputAudioConfig.newBuilder( + (com.google.cloud.dialogflow.v2.InputAudioConfig) config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 2) { + audioConfigBuilder_.mergeFrom(value); + } else { + audioConfigBuilder_.setMessage(value); + } + } + configCase_ = 2; + return this; + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + public Builder clearAudioConfig() { + if (audioConfigBuilder_ == null) { + if (configCase_ == 2) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 2) { + configCase_ = 0; + config_ = null; + } + audioConfigBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + public com.google.cloud.dialogflow.v2.InputAudioConfig.Builder getAudioConfigBuilder() { + return getAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputAudioConfigOrBuilder getAudioConfigOrBuilder() { + if ((configCase_ == 2) && (audioConfigBuilder_ != null)) { + return audioConfigBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 2) { + return (com.google.cloud.dialogflow.v2.InputAudioConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * Instructs the speech recognizer how to process the speech audio.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.InputAudioConfig, + com.google.cloud.dialogflow.v2.InputAudioConfig.Builder, + com.google.cloud.dialogflow.v2.InputAudioConfigOrBuilder> + getAudioConfigFieldBuilder() { + if (audioConfigBuilder_ == null) { + if (!(configCase_ == 2)) { + config_ = com.google.cloud.dialogflow.v2.InputAudioConfig.getDefaultInstance(); + } + audioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.InputAudioConfig, + com.google.cloud.dialogflow.v2.InputAudioConfig.Builder, + com.google.cloud.dialogflow.v2.InputAudioConfigOrBuilder>( + (com.google.cloud.dialogflow.v2.InputAudioConfig) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 2; + onChanged(); + ; + return audioConfigBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.InputTextConfig, + com.google.cloud.dialogflow.v2.InputTextConfig.Builder, + com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder> + textConfigBuilder_; + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * + * @return Whether the textConfig field is set. + */ + @java.lang.Override + public boolean hasTextConfig() { + return configCase_ == 3; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * + * @return The textConfig. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfig getTextConfig() { + if (textConfigBuilder_ == null) { + if (configCase_ == 3) { + return (com.google.cloud.dialogflow.v2.InputTextConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } else { + if (configCase_ == 3) { + return textConfigBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + public Builder setTextConfig(com.google.cloud.dialogflow.v2.InputTextConfig value) { + if (textConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + config_ = value; + onChanged(); + } else { + textConfigBuilder_.setMessage(value); + } + configCase_ = 3; + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + public Builder setTextConfig( + com.google.cloud.dialogflow.v2.InputTextConfig.Builder builderForValue) { + if (textConfigBuilder_ == null) { + config_ = builderForValue.build(); + onChanged(); + } else { + textConfigBuilder_.setMessage(builderForValue.build()); + } + configCase_ = 3; + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + public Builder mergeTextConfig(com.google.cloud.dialogflow.v2.InputTextConfig value) { + if (textConfigBuilder_ == null) { + if (configCase_ == 3 + && config_ != com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance()) { + config_ = + com.google.cloud.dialogflow.v2.InputTextConfig.newBuilder( + (com.google.cloud.dialogflow.v2.InputTextConfig) config_) + .mergeFrom(value) + .buildPartial(); + } else { + config_ = value; + } + onChanged(); + } else { + if (configCase_ == 3) { + textConfigBuilder_.mergeFrom(value); + } else { + textConfigBuilder_.setMessage(value); + } + } + configCase_ = 3; + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + public Builder clearTextConfig() { + if (textConfigBuilder_ == null) { + if (configCase_ == 3) { + configCase_ = 0; + config_ = null; + onChanged(); + } + } else { + if (configCase_ == 3) { + configCase_ = 0; + config_ = null; + } + textConfigBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + public com.google.cloud.dialogflow.v2.InputTextConfig.Builder getTextConfigBuilder() { + return getTextConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder getTextConfigOrBuilder() { + if ((configCase_ == 3) && (textConfigBuilder_ != null)) { + return textConfigBuilder_.getMessageOrBuilder(); + } else { + if (configCase_ == 3) { + return (com.google.cloud.dialogflow.v2.InputTextConfig) config_; + } + return com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } + } + /** + * + * + *
+     * The natural language text to be processed.
+     * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.InputTextConfig, + com.google.cloud.dialogflow.v2.InputTextConfig.Builder, + com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder> + getTextConfigFieldBuilder() { + if (textConfigBuilder_ == null) { + if (!(configCase_ == 3)) { + config_ = com.google.cloud.dialogflow.v2.InputTextConfig.getDefaultInstance(); + } + textConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.InputTextConfig, + com.google.cloud.dialogflow.v2.InputTextConfig.Builder, + com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder>( + (com.google.cloud.dialogflow.v2.InputTextConfig) config_, + getParentForChildren(), + isClean()); + config_ = null; + } + configCase_ = 3; + onChanged(); + ; + return textConfigBuilder_; + } + + private com.google.cloud.dialogflow.v2.OutputAudioConfig replyAudioConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.OutputAudioConfig, + com.google.cloud.dialogflow.v2.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.v2.OutputAudioConfigOrBuilder> + replyAudioConfigBuilder_; + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * + * @return Whether the replyAudioConfig field is set. + */ + public boolean hasReplyAudioConfig() { + return replyAudioConfigBuilder_ != null || replyAudioConfig_ != null; + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * + * @return The replyAudioConfig. + */ + public com.google.cloud.dialogflow.v2.OutputAudioConfig getReplyAudioConfig() { + if (replyAudioConfigBuilder_ == null) { + return replyAudioConfig_ == null + ? com.google.cloud.dialogflow.v2.OutputAudioConfig.getDefaultInstance() + : replyAudioConfig_; + } else { + return replyAudioConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + public Builder setReplyAudioConfig(com.google.cloud.dialogflow.v2.OutputAudioConfig value) { + if (replyAudioConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replyAudioConfig_ = value; + onChanged(); + } else { + replyAudioConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + public Builder setReplyAudioConfig( + com.google.cloud.dialogflow.v2.OutputAudioConfig.Builder builderForValue) { + if (replyAudioConfigBuilder_ == null) { + replyAudioConfig_ = builderForValue.build(); + onChanged(); + } else { + replyAudioConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + public Builder mergeReplyAudioConfig(com.google.cloud.dialogflow.v2.OutputAudioConfig value) { + if (replyAudioConfigBuilder_ == null) { + if (replyAudioConfig_ != null) { + replyAudioConfig_ = + com.google.cloud.dialogflow.v2.OutputAudioConfig.newBuilder(replyAudioConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + replyAudioConfig_ = value; + } + onChanged(); + } else { + replyAudioConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + public Builder clearReplyAudioConfig() { + if (replyAudioConfigBuilder_ == null) { + replyAudioConfig_ = null; + onChanged(); + } else { + replyAudioConfig_ = null; + replyAudioConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + public com.google.cloud.dialogflow.v2.OutputAudioConfig.Builder getReplyAudioConfigBuilder() { + + onChanged(); + return getReplyAudioConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + public com.google.cloud.dialogflow.v2.OutputAudioConfigOrBuilder + getReplyAudioConfigOrBuilder() { + if (replyAudioConfigBuilder_ != null) { + return replyAudioConfigBuilder_.getMessageOrBuilder(); + } else { + return replyAudioConfig_ == null + ? com.google.cloud.dialogflow.v2.OutputAudioConfig.getDefaultInstance() + : replyAudioConfig_; + } + } + /** + * + * + *
+     * Speech synthesis configuration.
+     * The speech synthesis settings for a virtual agent that may be configured
+     * for the associated conversation profile are not used when calling
+     * StreamingAnalyzeContent. If this configuration is not supplied, speech
+     * synthesis is disabled.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.OutputAudioConfig, + com.google.cloud.dialogflow.v2.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.v2.OutputAudioConfigOrBuilder> + getReplyAudioConfigFieldBuilder() { + if (replyAudioConfigBuilder_ == null) { + replyAudioConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.OutputAudioConfig, + com.google.cloud.dialogflow.v2.OutputAudioConfig.Builder, + com.google.cloud.dialogflow.v2.OutputAudioConfigOrBuilder>( + getReplyAudioConfig(), getParentForChildren(), isClean()); + replyAudioConfig_ = null; + } + return replyAudioConfigBuilder_; + } + + /** + * + * + *
+     * The input audio content to be recognized. Must be sent if `audio_config`
+     * is set in the first message. The complete audio over all streaming
+     * messages must not exceed 1 minute.
+     * 
+ * + * bytes input_audio = 5; + * + * @return Whether the inputAudio field is set. + */ + public boolean hasInputAudio() { + return inputCase_ == 5; + } + /** + * + * + *
+     * The input audio content to be recognized. Must be sent if `audio_config`
+     * is set in the first message. The complete audio over all streaming
+     * messages must not exceed 1 minute.
+     * 
+ * + * bytes input_audio = 5; + * + * @return The inputAudio. + */ + public com.google.protobuf.ByteString getInputAudio() { + if (inputCase_ == 5) { + return (com.google.protobuf.ByteString) input_; + } + return com.google.protobuf.ByteString.EMPTY; + } + /** + * + * + *
+     * The input audio content to be recognized. Must be sent if `audio_config`
+     * is set in the first message. The complete audio over all streaming
+     * messages must not exceed 1 minute.
+     * 
+ * + * bytes input_audio = 5; + * + * @param value The inputAudio to set. + * @return This builder for chaining. + */ + public Builder setInputAudio(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + inputCase_ = 5; + input_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The input audio content to be recognized. Must be sent if `audio_config`
+     * is set in the first message. The complete audio over all streaming
+     * messages must not exceed 1 minute.
+     * 
+ * + * bytes input_audio = 5; + * + * @return This builder for chaining. + */ + public Builder clearInputAudio() { + if (inputCase_ == 5) { + inputCase_ = 0; + input_ = null; + onChanged(); + } + return this; + } + + /** + * + * + *
+     * The UTF-8 encoded natural language text to be processed. Must be sent if
+     * `text_config` is set in the first message. Text length must not exceed
+     * 256 bytes for virtual agent interactions. The `input_text` field can be
+     * only sent once.
+     * 
+ * + * string input_text = 6; + * + * @return Whether the inputText field is set. + */ + @java.lang.Override + public boolean hasInputText() { + return inputCase_ == 6; + } + /** + * + * + *
+     * The UTF-8 encoded natural language text to be processed. Must be sent if
+     * `text_config` is set in the first message. Text length must not exceed
+     * 256 bytes for virtual agent interactions. The `input_text` field can be
+     * only sent once.
+     * 
+ * + * string input_text = 6; + * + * @return The inputText. + */ + @java.lang.Override + public java.lang.String getInputText() { + java.lang.Object ref = ""; + if (inputCase_ == 6) { + ref = input_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (inputCase_ == 6) { + input_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The UTF-8 encoded natural language text to be processed. Must be sent if
+     * `text_config` is set in the first message. Text length must not exceed
+     * 256 bytes for virtual agent interactions. The `input_text` field can be
+     * only sent once.
+     * 
+ * + * string input_text = 6; + * + * @return The bytes for inputText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInputTextBytes() { + java.lang.Object ref = ""; + if (inputCase_ == 6) { + ref = input_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (inputCase_ == 6) { + input_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The UTF-8 encoded natural language text to be processed. Must be sent if
+     * `text_config` is set in the first message. Text length must not exceed
+     * 256 bytes for virtual agent interactions. The `input_text` field can be
+     * only sent once.
+     * 
+ * + * string input_text = 6; + * + * @param value The inputText to set. + * @return This builder for chaining. + */ + public Builder setInputText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + inputCase_ = 6; + input_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The UTF-8 encoded natural language text to be processed. Must be sent if
+     * `text_config` is set in the first message. Text length must not exceed
+     * 256 bytes for virtual agent interactions. The `input_text` field can be
+     * only sent once.
+     * 
+ * + * string input_text = 6; + * + * @return This builder for chaining. + */ + public Builder clearInputText() { + if (inputCase_ == 6) { + inputCase_ = 0; + input_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The UTF-8 encoded natural language text to be processed. Must be sent if
+     * `text_config` is set in the first message. Text length must not exceed
+     * 256 bytes for virtual agent interactions. The `input_text` field can be
+     * only sent once.
+     * 
+ * + * string input_text = 6; + * + * @param value The bytes for inputText to set. + * @return This builder for chaining. + */ + public Builder setInputTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + inputCase_ = 6; + input_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents, + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder, + com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder> + inputDtmfBuilder_; + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * + * @return Whether the inputDtmf field is set. + */ + @java.lang.Override + public boolean hasInputDtmf() { + return inputCase_ == 9; + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * + * @return The inputDtmf. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEvents getInputDtmf() { + if (inputDtmfBuilder_ == null) { + if (inputCase_ == 9) { + return (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_; + } + return com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } else { + if (inputCase_ == 9) { + return inputDtmfBuilder_.getMessage(); + } + return com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + public Builder setInputDtmf(com.google.cloud.dialogflow.v2.TelephonyDtmfEvents value) { + if (inputDtmfBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + input_ = value; + onChanged(); + } else { + inputDtmfBuilder_.setMessage(value); + } + inputCase_ = 9; + return this; + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + public Builder setInputDtmf( + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder builderForValue) { + if (inputDtmfBuilder_ == null) { + input_ = builderForValue.build(); + onChanged(); + } else { + inputDtmfBuilder_.setMessage(builderForValue.build()); + } + inputCase_ = 9; + return this; + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + public Builder mergeInputDtmf(com.google.cloud.dialogflow.v2.TelephonyDtmfEvents value) { + if (inputDtmfBuilder_ == null) { + if (inputCase_ == 9 + && input_ != com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance()) { + input_ = + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.newBuilder( + (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_) + .mergeFrom(value) + .buildPartial(); + } else { + input_ = value; + } + onChanged(); + } else { + if (inputCase_ == 9) { + inputDtmfBuilder_.mergeFrom(value); + } else { + inputDtmfBuilder_.setMessage(value); + } + } + inputCase_ = 9; + return this; + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + public Builder clearInputDtmf() { + if (inputDtmfBuilder_ == null) { + if (inputCase_ == 9) { + inputCase_ = 0; + input_ = null; + onChanged(); + } + } else { + if (inputCase_ == 9) { + inputCase_ = 0; + input_ = null; + } + inputDtmfBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + public com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder getInputDtmfBuilder() { + return getInputDtmfFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder getInputDtmfOrBuilder() { + if ((inputCase_ == 9) && (inputDtmfBuilder_ != null)) { + return inputDtmfBuilder_.getMessageOrBuilder(); + } else { + if (inputCase_ == 9) { + return (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_; + } + return com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } + } + /** + * + * + *
+     * The DTMF digits used to invoke intent and fill in parameter value.
+     * This input is ignored if the previous response indicated that DTMF input
+     * is not accepted.
+     * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents, + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder, + com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder> + getInputDtmfFieldBuilder() { + if (inputDtmfBuilder_ == null) { + if (!(inputCase_ == 9)) { + input_ = com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } + inputDtmfBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents, + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder, + com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder>( + (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) input_, + getParentForChildren(), + isClean()); + input_ = null; + } + inputCase_ = 9; + onChanged(); + ; + return inputDtmfBuilder_; + } + + private com.google.cloud.dialogflow.v2.QueryParameters queryParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.QueryParameters, + com.google.cloud.dialogflow.v2.QueryParameters.Builder, + com.google.cloud.dialogflow.v2.QueryParametersOrBuilder> + queryParamsBuilder_; + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * + * @return Whether the queryParams field is set. + */ + public boolean hasQueryParams() { + return queryParamsBuilder_ != null || queryParams_ != null; + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * + * @return The queryParams. + */ + public com.google.cloud.dialogflow.v2.QueryParameters getQueryParams() { + if (queryParamsBuilder_ == null) { + return queryParams_ == null + ? com.google.cloud.dialogflow.v2.QueryParameters.getDefaultInstance() + : queryParams_; + } else { + return queryParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + public Builder setQueryParams(com.google.cloud.dialogflow.v2.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + queryParams_ = value; + onChanged(); + } else { + queryParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + public Builder setQueryParams( + com.google.cloud.dialogflow.v2.QueryParameters.Builder builderForValue) { + if (queryParamsBuilder_ == null) { + queryParams_ = builderForValue.build(); + onChanged(); + } else { + queryParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + public Builder mergeQueryParams(com.google.cloud.dialogflow.v2.QueryParameters value) { + if (queryParamsBuilder_ == null) { + if (queryParams_ != null) { + queryParams_ = + com.google.cloud.dialogflow.v2.QueryParameters.newBuilder(queryParams_) + .mergeFrom(value) + .buildPartial(); + } else { + queryParams_ = value; + } + onChanged(); + } else { + queryParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + public Builder clearQueryParams() { + if (queryParamsBuilder_ == null) { + queryParams_ = null; + onChanged(); + } else { + queryParams_ = null; + queryParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + public com.google.cloud.dialogflow.v2.QueryParameters.Builder getQueryParamsBuilder() { + + onChanged(); + return getQueryParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + public com.google.cloud.dialogflow.v2.QueryParametersOrBuilder getQueryParamsOrBuilder() { + if (queryParamsBuilder_ != null) { + return queryParamsBuilder_.getMessageOrBuilder(); + } else { + return queryParams_ == null + ? com.google.cloud.dialogflow.v2.QueryParameters.getDefaultInstance() + : queryParams_; + } + } + /** + * + * + *
+     * Parameters for a Dialogflow virtual-agent query.
+     * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.QueryParameters, + com.google.cloud.dialogflow.v2.QueryParameters.Builder, + com.google.cloud.dialogflow.v2.QueryParametersOrBuilder> + getQueryParamsFieldBuilder() { + if (queryParamsBuilder_ == null) { + queryParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.QueryParameters, + com.google.cloud.dialogflow.v2.QueryParameters.Builder, + com.google.cloud.dialogflow.v2.QueryParametersOrBuilder>( + getQueryParams(), getParentForChildren(), isClean()); + queryParams_ = null; + } + return queryParamsBuilder_; + } + + private com.google.cloud.dialogflow.v2.AssistQueryParameters assistQueryParams_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.AssistQueryParameters, + com.google.cloud.dialogflow.v2.AssistQueryParameters.Builder, + com.google.cloud.dialogflow.v2.AssistQueryParametersOrBuilder> + assistQueryParamsBuilder_; + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * + * @return Whether the assistQueryParams field is set. + */ + public boolean hasAssistQueryParams() { + return assistQueryParamsBuilder_ != null || assistQueryParams_ != null; + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * + * @return The assistQueryParams. + */ + public com.google.cloud.dialogflow.v2.AssistQueryParameters getAssistQueryParams() { + if (assistQueryParamsBuilder_ == null) { + return assistQueryParams_ == null + ? com.google.cloud.dialogflow.v2.AssistQueryParameters.getDefaultInstance() + : assistQueryParams_; + } else { + return assistQueryParamsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + public Builder setAssistQueryParams( + com.google.cloud.dialogflow.v2.AssistQueryParameters value) { + if (assistQueryParamsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + assistQueryParams_ = value; + onChanged(); + } else { + assistQueryParamsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + public Builder setAssistQueryParams( + com.google.cloud.dialogflow.v2.AssistQueryParameters.Builder builderForValue) { + if (assistQueryParamsBuilder_ == null) { + assistQueryParams_ = builderForValue.build(); + onChanged(); + } else { + assistQueryParamsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + public Builder mergeAssistQueryParams( + com.google.cloud.dialogflow.v2.AssistQueryParameters value) { + if (assistQueryParamsBuilder_ == null) { + if (assistQueryParams_ != null) { + assistQueryParams_ = + com.google.cloud.dialogflow.v2.AssistQueryParameters.newBuilder(assistQueryParams_) + .mergeFrom(value) + .buildPartial(); + } else { + assistQueryParams_ = value; + } + onChanged(); + } else { + assistQueryParamsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + public Builder clearAssistQueryParams() { + if (assistQueryParamsBuilder_ == null) { + assistQueryParams_ = null; + onChanged(); + } else { + assistQueryParams_ = null; + assistQueryParamsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + public com.google.cloud.dialogflow.v2.AssistQueryParameters.Builder + getAssistQueryParamsBuilder() { + + onChanged(); + return getAssistQueryParamsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + public com.google.cloud.dialogflow.v2.AssistQueryParametersOrBuilder + getAssistQueryParamsOrBuilder() { + if (assistQueryParamsBuilder_ != null) { + return assistQueryParamsBuilder_.getMessageOrBuilder(); + } else { + return assistQueryParams_ == null + ? com.google.cloud.dialogflow.v2.AssistQueryParameters.getDefaultInstance() + : assistQueryParams_; + } + } + /** + * + * + *
+     * Parameters for a human assist query.
+     * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.AssistQueryParameters, + com.google.cloud.dialogflow.v2.AssistQueryParameters.Builder, + com.google.cloud.dialogflow.v2.AssistQueryParametersOrBuilder> + getAssistQueryParamsFieldBuilder() { + if (assistQueryParamsBuilder_ == null) { + assistQueryParamsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.AssistQueryParameters, + com.google.cloud.dialogflow.v2.AssistQueryParameters.Builder, + com.google.cloud.dialogflow.v2.AssistQueryParametersOrBuilder>( + getAssistQueryParams(), getParentForChildren(), isClean()); + assistQueryParams_ = null; + } + return assistQueryParamsBuilder_; + } + + private com.google.protobuf.Struct cxParameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + cxParametersBuilder_; + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + * + * @return Whether the cxParameters field is set. + */ + public boolean hasCxParameters() { + return cxParametersBuilder_ != null || cxParameters_ != null; + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + * + * @return The cxParameters. + */ + public com.google.protobuf.Struct getCxParameters() { + if (cxParametersBuilder_ == null) { + return cxParameters_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : cxParameters_; + } else { + return cxParametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + public Builder setCxParameters(com.google.protobuf.Struct value) { + if (cxParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cxParameters_ = value; + onChanged(); + } else { + cxParametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + public Builder setCxParameters(com.google.protobuf.Struct.Builder builderForValue) { + if (cxParametersBuilder_ == null) { + cxParameters_ = builderForValue.build(); + onChanged(); + } else { + cxParametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + public Builder mergeCxParameters(com.google.protobuf.Struct value) { + if (cxParametersBuilder_ == null) { + if (cxParameters_ != null) { + cxParameters_ = + com.google.protobuf.Struct.newBuilder(cxParameters_).mergeFrom(value).buildPartial(); + } else { + cxParameters_ = value; + } + onChanged(); + } else { + cxParametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + public Builder clearCxParameters() { + if (cxParametersBuilder_ == null) { + cxParameters_ = null; + onChanged(); + } else { + cxParameters_ = null; + cxParametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + public com.google.protobuf.Struct.Builder getCxParametersBuilder() { + + onChanged(); + return getCxParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + public com.google.protobuf.StructOrBuilder getCxParametersOrBuilder() { + if (cxParametersBuilder_ != null) { + return cxParametersBuilder_.getMessageOrBuilder(); + } else { + return cxParameters_ == null + ? com.google.protobuf.Struct.getDefaultInstance() + : cxParameters_; + } + } + /** + * + * + *
+     * Additional parameters to be put into Dialogflow CX session parameters. To
+     * remove a parameter from the session, clients should explicitly set the
+     * parameter value to null.
+     * Note: this field should only be used if you are connecting to a Dialogflow
+     * CX agent.
+     * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getCxParametersFieldBuilder() { + if (cxParametersBuilder_ == null) { + cxParametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>( + getCxParameters(), getParentForChildren(), isClean()); + cxParameters_ = null; + } + return cxParametersBuilder_; + } + + private boolean enablePartialAutomatedAgentReply_; + /** + * + * + *
+     * Enable partial virtual agent responses. If this flag is not enabled,
+     * response stream still contains only one final response even if some
+     * `Fulfillment`s in Dialogflow virtual agent have been configured to return
+     * partial responses.
+     * 
+ * + * bool enable_partial_automated_agent_reply = 12; + * + * @return The enablePartialAutomatedAgentReply. + */ + @java.lang.Override + public boolean getEnablePartialAutomatedAgentReply() { + return enablePartialAutomatedAgentReply_; + } + /** + * + * + *
+     * Enable partial virtual agent responses. If this flag is not enabled,
+     * response stream still contains only one final response even if some
+     * `Fulfillment`s in Dialogflow virtual agent have been configured to return
+     * partial responses.
+     * 
+ * + * bool enable_partial_automated_agent_reply = 12; + * + * @param value The enablePartialAutomatedAgentReply to set. + * @return This builder for chaining. + */ + public Builder setEnablePartialAutomatedAgentReply(boolean value) { + + enablePartialAutomatedAgentReply_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Enable partial virtual agent responses. If this flag is not enabled,
+     * response stream still contains only one final response even if some
+     * `Fulfillment`s in Dialogflow virtual agent have been configured to return
+     * partial responses.
+     * 
+ * + * bool enable_partial_automated_agent_reply = 12; + * + * @return This builder for chaining. + */ + public Builder clearEnablePartialAutomatedAgentReply() { + + enablePartialAutomatedAgentReply_ = 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.dialogflow.v2.StreamingAnalyzeContentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) + private static final com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest(); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingAnalyzeContentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.dialogflow.v2.StreamingAnalyzeContentRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequestOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequestOrBuilder.java new file mode 100644 index 000000000000..ce222144fe0c --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentRequestOrBuilder.java @@ -0,0 +1,428 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/participant.proto + +package com.google.cloud.dialogflow.v2; + +public interface StreamingAnalyzeContentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the participant this text comes from.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+   * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The participant. + */ + java.lang.String getParticipant(); + /** + * + * + *
+   * Required. The name of the participant this text comes from.
+   * Format: `projects/<Project ID>/locations/<Location
+   * ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
+   * 
+ * + * + * string participant = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for participant. + */ + com.google.protobuf.ByteString getParticipantBytes(); + + /** + * + * + *
+   * Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * + * @return Whether the audioConfig field is set. + */ + boolean hasAudioConfig(); + /** + * + * + *
+   * Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + * + * @return The audioConfig. + */ + com.google.cloud.dialogflow.v2.InputAudioConfig getAudioConfig(); + /** + * + * + *
+   * Instructs the speech recognizer how to process the speech audio.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputAudioConfig audio_config = 2; + */ + com.google.cloud.dialogflow.v2.InputAudioConfigOrBuilder getAudioConfigOrBuilder(); + + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * + * @return Whether the textConfig field is set. + */ + boolean hasTextConfig(); + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + * + * @return The textConfig. + */ + com.google.cloud.dialogflow.v2.InputTextConfig getTextConfig(); + /** + * + * + *
+   * The natural language text to be processed.
+   * 
+ * + * .google.cloud.dialogflow.v2.InputTextConfig text_config = 3; + */ + com.google.cloud.dialogflow.v2.InputTextConfigOrBuilder getTextConfigOrBuilder(); + + /** + * + * + *
+   * Speech synthesis configuration.
+   * The speech synthesis settings for a virtual agent that may be configured
+   * for the associated conversation profile are not used when calling
+   * StreamingAnalyzeContent. If this configuration is not supplied, speech
+   * synthesis is disabled.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * + * @return Whether the replyAudioConfig field is set. + */ + boolean hasReplyAudioConfig(); + /** + * + * + *
+   * Speech synthesis configuration.
+   * The speech synthesis settings for a virtual agent that may be configured
+   * for the associated conversation profile are not used when calling
+   * StreamingAnalyzeContent. If this configuration is not supplied, speech
+   * synthesis is disabled.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + * + * @return The replyAudioConfig. + */ + com.google.cloud.dialogflow.v2.OutputAudioConfig getReplyAudioConfig(); + /** + * + * + *
+   * Speech synthesis configuration.
+   * The speech synthesis settings for a virtual agent that may be configured
+   * for the associated conversation profile are not used when calling
+   * StreamingAnalyzeContent. If this configuration is not supplied, speech
+   * synthesis is disabled.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudioConfig reply_audio_config = 4; + */ + com.google.cloud.dialogflow.v2.OutputAudioConfigOrBuilder getReplyAudioConfigOrBuilder(); + + /** + * + * + *
+   * The input audio content to be recognized. Must be sent if `audio_config`
+   * is set in the first message. The complete audio over all streaming
+   * messages must not exceed 1 minute.
+   * 
+ * + * bytes input_audio = 5; + * + * @return Whether the inputAudio field is set. + */ + boolean hasInputAudio(); + /** + * + * + *
+   * The input audio content to be recognized. Must be sent if `audio_config`
+   * is set in the first message. The complete audio over all streaming
+   * messages must not exceed 1 minute.
+   * 
+ * + * bytes input_audio = 5; + * + * @return The inputAudio. + */ + com.google.protobuf.ByteString getInputAudio(); + + /** + * + * + *
+   * The UTF-8 encoded natural language text to be processed. Must be sent if
+   * `text_config` is set in the first message. Text length must not exceed
+   * 256 bytes for virtual agent interactions. The `input_text` field can be
+   * only sent once.
+   * 
+ * + * string input_text = 6; + * + * @return Whether the inputText field is set. + */ + boolean hasInputText(); + /** + * + * + *
+   * The UTF-8 encoded natural language text to be processed. Must be sent if
+   * `text_config` is set in the first message. Text length must not exceed
+   * 256 bytes for virtual agent interactions. The `input_text` field can be
+   * only sent once.
+   * 
+ * + * string input_text = 6; + * + * @return The inputText. + */ + java.lang.String getInputText(); + /** + * + * + *
+   * The UTF-8 encoded natural language text to be processed. Must be sent if
+   * `text_config` is set in the first message. Text length must not exceed
+   * 256 bytes for virtual agent interactions. The `input_text` field can be
+   * only sent once.
+   * 
+ * + * string input_text = 6; + * + * @return The bytes for inputText. + */ + com.google.protobuf.ByteString getInputTextBytes(); + + /** + * + * + *
+   * The DTMF digits used to invoke intent and fill in parameter value.
+   * This input is ignored if the previous response indicated that DTMF input
+   * is not accepted.
+   * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * + * @return Whether the inputDtmf field is set. + */ + boolean hasInputDtmf(); + /** + * + * + *
+   * The DTMF digits used to invoke intent and fill in parameter value.
+   * This input is ignored if the previous response indicated that DTMF input
+   * is not accepted.
+   * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + * + * @return The inputDtmf. + */ + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents getInputDtmf(); + /** + * + * + *
+   * The DTMF digits used to invoke intent and fill in parameter value.
+   * This input is ignored if the previous response indicated that DTMF input
+   * is not accepted.
+   * 
+ * + * .google.cloud.dialogflow.v2.TelephonyDtmfEvents input_dtmf = 9; + */ + com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder getInputDtmfOrBuilder(); + + /** + * + * + *
+   * Parameters for a Dialogflow virtual-agent query.
+   * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * + * @return Whether the queryParams field is set. + */ + boolean hasQueryParams(); + /** + * + * + *
+   * Parameters for a Dialogflow virtual-agent query.
+   * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + * + * @return The queryParams. + */ + com.google.cloud.dialogflow.v2.QueryParameters getQueryParams(); + /** + * + * + *
+   * Parameters for a Dialogflow virtual-agent query.
+   * 
+ * + * .google.cloud.dialogflow.v2.QueryParameters query_params = 7; + */ + com.google.cloud.dialogflow.v2.QueryParametersOrBuilder getQueryParamsOrBuilder(); + + /** + * + * + *
+   * Parameters for a human assist query.
+   * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * + * @return Whether the assistQueryParams field is set. + */ + boolean hasAssistQueryParams(); + /** + * + * + *
+   * Parameters for a human assist query.
+   * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + * + * @return The assistQueryParams. + */ + com.google.cloud.dialogflow.v2.AssistQueryParameters getAssistQueryParams(); + /** + * + * + *
+   * Parameters for a human assist query.
+   * 
+ * + * .google.cloud.dialogflow.v2.AssistQueryParameters assist_query_params = 8; + */ + com.google.cloud.dialogflow.v2.AssistQueryParametersOrBuilder getAssistQueryParamsOrBuilder(); + + /** + * + * + *
+   * Additional parameters to be put into Dialogflow CX session parameters. To
+   * remove a parameter from the session, clients should explicitly set the
+   * parameter value to null.
+   * Note: this field should only be used if you are connecting to a Dialogflow
+   * CX agent.
+   * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + * + * @return Whether the cxParameters field is set. + */ + boolean hasCxParameters(); + /** + * + * + *
+   * Additional parameters to be put into Dialogflow CX session parameters. To
+   * remove a parameter from the session, clients should explicitly set the
+   * parameter value to null.
+   * Note: this field should only be used if you are connecting to a Dialogflow
+   * CX agent.
+   * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + * + * @return The cxParameters. + */ + com.google.protobuf.Struct getCxParameters(); + /** + * + * + *
+   * Additional parameters to be put into Dialogflow CX session parameters. To
+   * remove a parameter from the session, clients should explicitly set the
+   * parameter value to null.
+   * Note: this field should only be used if you are connecting to a Dialogflow
+   * CX agent.
+   * 
+ * + * .google.protobuf.Struct cx_parameters = 13; + */ + com.google.protobuf.StructOrBuilder getCxParametersOrBuilder(); + + /** + * + * + *
+   * Enable partial virtual agent responses. If this flag is not enabled,
+   * response stream still contains only one final response even if some
+   * `Fulfillment`s in Dialogflow virtual agent have been configured to return
+   * partial responses.
+   * 
+ * + * bool enable_partial_automated_agent_reply = 12; + * + * @return The enablePartialAutomatedAgentReply. + */ + boolean getEnablePartialAutomatedAgentReply(); + + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.ConfigCase getConfigCase(); + + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.InputCase getInputCase(); +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponse.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponse.java new file mode 100644 index 000000000000..ae03fa48090a --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponse.java @@ -0,0 +1,3323 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/participant.proto + +package com.google.cloud.dialogflow.v2; + +/** + * + * + *
+ * The top-level message returned from the `StreamingAnalyzeContent` method.
+ * Multiple response messages can be returned in order:
+ * 1.  If the input was set to streaming audio, the first one or more messages
+ *     contain `recognition_result`. Each `recognition_result` represents a more
+ *     complete transcript of what the user said. The last `recognition_result`
+ *     has `is_final` set to `true`.
+ * 2.  In virtual agent stage: if `enable_partial_automated_agent_reply` is
+ *     true, the following N (currently 1 <= N <= 4) messages
+ *     contain `automated_agent_reply` and optionally `reply_audio`
+ *     returned by the virtual agent. The first (N-1)
+ *     `automated_agent_reply`s will have `automated_agent_reply_type` set to
+ *     `PARTIAL`. The last `automated_agent_reply` has
+ *     `automated_agent_reply_type` set to `FINAL`.
+ *     If `enable_partial_automated_agent_reply` is not enabled, response stream
+ *     only contains the final reply.
+ *     In human assist stage: the following N (N >= 1) messages contain
+ *     `human_agent_suggestion_results`, `end_user_suggestion_results` or
+ *     `message`.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} + */ +public final class StreamingAnalyzeContentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) + StreamingAnalyzeContentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use StreamingAnalyzeContentResponse.newBuilder() to construct. + private StreamingAnalyzeContentResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StreamingAnalyzeContentResponse() { + replyText_ = ""; + humanAgentSuggestionResults_ = java.util.Collections.emptyList(); + endUserSuggestionResults_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StreamingAnalyzeContentResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.class, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.Builder.class); + } + + public static final int RECOGNITION_RESULT_FIELD_NUMBER = 1; + private com.google.cloud.dialogflow.v2.StreamingRecognitionResult recognitionResult_; + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * + * @return Whether the recognitionResult field is set. + */ + @java.lang.Override + public boolean hasRecognitionResult() { + return recognitionResult_ != null; + } + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * + * @return The recognitionResult. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingRecognitionResult getRecognitionResult() { + return recognitionResult_ == null + ? com.google.cloud.dialogflow.v2.StreamingRecognitionResult.getDefaultInstance() + : recognitionResult_; + } + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingRecognitionResultOrBuilder + getRecognitionResultOrBuilder() { + return getRecognitionResult(); + } + + public static final int REPLY_TEXT_FIELD_NUMBER = 2; + private volatile java.lang.Object replyText_; + /** + * + * + *
+   * The output text content.
+   * This field is set if an automated agent responded with a text for the user.
+   * 
+ * + * string reply_text = 2; + * + * @return The replyText. + */ + @java.lang.Override + public java.lang.String getReplyText() { + java.lang.Object ref = replyText_; + 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(); + replyText_ = s; + return s; + } + } + /** + * + * + *
+   * The output text content.
+   * This field is set if an automated agent responded with a text for the user.
+   * 
+ * + * string reply_text = 2; + * + * @return The bytes for replyText. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReplyTextBytes() { + java.lang.Object ref = replyText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replyText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPLY_AUDIO_FIELD_NUMBER = 3; + private com.google.cloud.dialogflow.v2.OutputAudio replyAudio_; + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * This field is set if:
+   *  - The `reply_audio_config` field is specified in the request.
+   *  - The automated agent, which this output comes from, responded with audio.
+   *    In such case, the `reply_audio.config` field contains settings used to
+   *    synthesize the speech.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * + * @return Whether the replyAudio field is set. + */ + @java.lang.Override + public boolean hasReplyAudio() { + return replyAudio_ != null; + } + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * This field is set if:
+   *  - The `reply_audio_config` field is specified in the request.
+   *  - The automated agent, which this output comes from, responded with audio.
+   *    In such case, the `reply_audio.config` field contains settings used to
+   *    synthesize the speech.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * + * @return The replyAudio. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.OutputAudio getReplyAudio() { + return replyAudio_ == null + ? com.google.cloud.dialogflow.v2.OutputAudio.getDefaultInstance() + : replyAudio_; + } + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * This field is set if:
+   *  - The `reply_audio_config` field is specified in the request.
+   *  - The automated agent, which this output comes from, responded with audio.
+   *    In such case, the `reply_audio.config` field contains settings used to
+   *    synthesize the speech.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.OutputAudioOrBuilder getReplyAudioOrBuilder() { + return getReplyAudio(); + } + + public static final int AUTOMATED_AGENT_REPLY_FIELD_NUMBER = 4; + private com.google.cloud.dialogflow.v2.AutomatedAgentReply automatedAgentReply_; + /** + * + * + *
+   * Only set if a Dialogflow automated agent has responded.
+   * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+   * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+   * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+   * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * + * @return Whether the automatedAgentReply field is set. + */ + @java.lang.Override + public boolean hasAutomatedAgentReply() { + return automatedAgentReply_ != null; + } + /** + * + * + *
+   * Only set if a Dialogflow automated agent has responded.
+   * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+   * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+   * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+   * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * + * @return The automatedAgentReply. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.AutomatedAgentReply getAutomatedAgentReply() { + return automatedAgentReply_ == null + ? com.google.cloud.dialogflow.v2.AutomatedAgentReply.getDefaultInstance() + : automatedAgentReply_; + } + /** + * + * + *
+   * Only set if a Dialogflow automated agent has responded.
+   * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+   * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+   * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+   * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.AutomatedAgentReplyOrBuilder + getAutomatedAgentReplyOrBuilder() { + return getAutomatedAgentReply(); + } + + public static final int MESSAGE_FIELD_NUMBER = 6; + private com.google.cloud.dialogflow.v2.Message message_; + /** + * + * + *
+   * Message analyzed by CCAI.
+   * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + * + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return message_ != null; + } + /** + * + * + *
+   * Message analyzed by CCAI.
+   * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + * + * @return The message. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.Message getMessage() { + return message_ == null + ? com.google.cloud.dialogflow.v2.Message.getDefaultInstance() + : message_; + } + /** + * + * + *
+   * Message analyzed by CCAI.
+   * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.MessageOrBuilder getMessageOrBuilder() { + return getMessage(); + } + + public static final int HUMAN_AGENT_SUGGESTION_RESULTS_FIELD_NUMBER = 7; + private java.util.List + humanAgentSuggestionResults_; + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + @java.lang.Override + public java.util.List + getHumanAgentSuggestionResultsList() { + return humanAgentSuggestionResults_; + } + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + @java.lang.Override + public java.util.List + getHumanAgentSuggestionResultsOrBuilderList() { + return humanAgentSuggestionResults_; + } + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + @java.lang.Override + public int getHumanAgentSuggestionResultsCount() { + return humanAgentSuggestionResults_.size(); + } + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.SuggestionResult getHumanAgentSuggestionResults(int index) { + return humanAgentSuggestionResults_.get(index); + } + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder + getHumanAgentSuggestionResultsOrBuilder(int index) { + return humanAgentSuggestionResults_.get(index); + } + + public static final int END_USER_SUGGESTION_RESULTS_FIELD_NUMBER = 8; + private java.util.List endUserSuggestionResults_; + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + @java.lang.Override + public java.util.List + getEndUserSuggestionResultsList() { + return endUserSuggestionResults_; + } + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + @java.lang.Override + public java.util.List + getEndUserSuggestionResultsOrBuilderList() { + return endUserSuggestionResults_; + } + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + @java.lang.Override + public int getEndUserSuggestionResultsCount() { + return endUserSuggestionResults_.size(); + } + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.SuggestionResult getEndUserSuggestionResults(int index) { + return endUserSuggestionResults_.get(index); + } + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder + getEndUserSuggestionResultsOrBuilder(int index) { + return endUserSuggestionResults_.get(index); + } + + public static final int DTMF_PARAMETERS_FIELD_NUMBER = 10; + private com.google.cloud.dialogflow.v2.DtmfParameters dtmfParameters_; + /** + * + * + *
+   * Indicates the parameters of DTMF.
+   * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * + * @return Whether the dtmfParameters field is set. + */ + @java.lang.Override + public boolean hasDtmfParameters() { + return dtmfParameters_ != null; + } + /** + * + * + *
+   * Indicates the parameters of DTMF.
+   * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * + * @return The dtmfParameters. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.DtmfParameters getDtmfParameters() { + return dtmfParameters_ == null + ? com.google.cloud.dialogflow.v2.DtmfParameters.getDefaultInstance() + : dtmfParameters_; + } + /** + * + * + *
+   * Indicates the parameters of DTMF.
+   * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.DtmfParametersOrBuilder getDtmfParametersOrBuilder() { + return getDtmfParameters(); + } + + 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 (recognitionResult_ != null) { + output.writeMessage(1, getRecognitionResult()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replyText_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, replyText_); + } + if (replyAudio_ != null) { + output.writeMessage(3, getReplyAudio()); + } + if (automatedAgentReply_ != null) { + output.writeMessage(4, getAutomatedAgentReply()); + } + if (message_ != null) { + output.writeMessage(6, getMessage()); + } + for (int i = 0; i < humanAgentSuggestionResults_.size(); i++) { + output.writeMessage(7, humanAgentSuggestionResults_.get(i)); + } + for (int i = 0; i < endUserSuggestionResults_.size(); i++) { + output.writeMessage(8, endUserSuggestionResults_.get(i)); + } + if (dtmfParameters_ != null) { + output.writeMessage(10, getDtmfParameters()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (recognitionResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRecognitionResult()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(replyText_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, replyText_); + } + if (replyAudio_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getReplyAudio()); + } + if (automatedAgentReply_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getAutomatedAgentReply()); + } + if (message_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getMessage()); + } + for (int i = 0; i < humanAgentSuggestionResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, humanAgentSuggestionResults_.get(i)); + } + for (int i = 0; i < endUserSuggestionResults_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, endUserSuggestionResults_.get(i)); + } + if (dtmfParameters_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getDtmfParameters()); + } + size += getUnknownFields().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.dialogflow.v2.StreamingAnalyzeContentResponse)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse other = + (com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) obj; + + if (hasRecognitionResult() != other.hasRecognitionResult()) return false; + if (hasRecognitionResult()) { + if (!getRecognitionResult().equals(other.getRecognitionResult())) return false; + } + if (!getReplyText().equals(other.getReplyText())) return false; + if (hasReplyAudio() != other.hasReplyAudio()) return false; + if (hasReplyAudio()) { + if (!getReplyAudio().equals(other.getReplyAudio())) return false; + } + if (hasAutomatedAgentReply() != other.hasAutomatedAgentReply()) return false; + if (hasAutomatedAgentReply()) { + if (!getAutomatedAgentReply().equals(other.getAutomatedAgentReply())) return false; + } + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage().equals(other.getMessage())) return false; + } + if (!getHumanAgentSuggestionResultsList().equals(other.getHumanAgentSuggestionResultsList())) + return false; + if (!getEndUserSuggestionResultsList().equals(other.getEndUserSuggestionResultsList())) + return false; + if (hasDtmfParameters() != other.hasDtmfParameters()) return false; + if (hasDtmfParameters()) { + if (!getDtmfParameters().equals(other.getDtmfParameters())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRecognitionResult()) { + hash = (37 * hash) + RECOGNITION_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getRecognitionResult().hashCode(); + } + hash = (37 * hash) + REPLY_TEXT_FIELD_NUMBER; + hash = (53 * hash) + getReplyText().hashCode(); + if (hasReplyAudio()) { + hash = (37 * hash) + REPLY_AUDIO_FIELD_NUMBER; + hash = (53 * hash) + getReplyAudio().hashCode(); + } + if (hasAutomatedAgentReply()) { + hash = (37 * hash) + AUTOMATED_AGENT_REPLY_FIELD_NUMBER; + hash = (53 * hash) + getAutomatedAgentReply().hashCode(); + } + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + if (getHumanAgentSuggestionResultsCount() > 0) { + hash = (37 * hash) + HUMAN_AGENT_SUGGESTION_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getHumanAgentSuggestionResultsList().hashCode(); + } + if (getEndUserSuggestionResultsCount() > 0) { + hash = (37 * hash) + END_USER_SUGGESTION_RESULTS_FIELD_NUMBER; + hash = (53 * hash) + getEndUserSuggestionResultsList().hashCode(); + } + if (hasDtmfParameters()) { + hash = (37 * hash) + DTMF_PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getDtmfParameters().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse 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.dialogflow.v2.StreamingAnalyzeContentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse 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.dialogflow.v2.StreamingAnalyzeContentResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse 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.dialogflow.v2.StreamingAnalyzeContentResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse 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.dialogflow.v2.StreamingAnalyzeContentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse 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.dialogflow.v2.StreamingAnalyzeContentResponse 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 returned from the `StreamingAnalyzeContent` method.
+   * Multiple response messages can be returned in order:
+   * 1.  If the input was set to streaming audio, the first one or more messages
+   *     contain `recognition_result`. Each `recognition_result` represents a more
+   *     complete transcript of what the user said. The last `recognition_result`
+   *     has `is_final` set to `true`.
+   * 2.  In virtual agent stage: if `enable_partial_automated_agent_reply` is
+   *     true, the following N (currently 1 <= N <= 4) messages
+   *     contain `automated_agent_reply` and optionally `reply_audio`
+   *     returned by the virtual agent. The first (N-1)
+   *     `automated_agent_reply`s will have `automated_agent_reply_type` set to
+   *     `PARTIAL`. The last `automated_agent_reply` has
+   *     `automated_agent_reply_type` set to `FINAL`.
+   *     If `enable_partial_automated_agent_reply` is not enabled, response stream
+   *     only contains the final reply.
+   *     In human assist stage: the following N (N >= 1) messages contain
+   *     `human_agent_suggestion_results`, `end_user_suggestion_results` or
+   *     `message`.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.class, + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (recognitionResultBuilder_ == null) { + recognitionResult_ = null; + } else { + recognitionResult_ = null; + recognitionResultBuilder_ = null; + } + replyText_ = ""; + + if (replyAudioBuilder_ == null) { + replyAudio_ = null; + } else { + replyAudio_ = null; + replyAudioBuilder_ = null; + } + if (automatedAgentReplyBuilder_ == null) { + automatedAgentReply_ = null; + } else { + automatedAgentReply_ = null; + automatedAgentReplyBuilder_ = null; + } + if (messageBuilder_ == null) { + message_ = null; + } else { + message_ = null; + messageBuilder_ = null; + } + if (humanAgentSuggestionResultsBuilder_ == null) { + humanAgentSuggestionResults_ = java.util.Collections.emptyList(); + } else { + humanAgentSuggestionResults_ = null; + humanAgentSuggestionResultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + if (endUserSuggestionResultsBuilder_ == null) { + endUserSuggestionResults_ = java.util.Collections.emptyList(); + } else { + endUserSuggestionResults_ = null; + endUserSuggestionResultsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000002); + if (dtmfParametersBuilder_ == null) { + dtmfParameters_ = null; + } else { + dtmfParameters_ = null; + dtmfParametersBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.ParticipantProto + .internal_static_google_cloud_dialogflow_v2_StreamingAnalyzeContentResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse build() { + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse buildPartial() { + com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse result = + new com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse(this); + int from_bitField0_ = bitField0_; + if (recognitionResultBuilder_ == null) { + result.recognitionResult_ = recognitionResult_; + } else { + result.recognitionResult_ = recognitionResultBuilder_.build(); + } + result.replyText_ = replyText_; + if (replyAudioBuilder_ == null) { + result.replyAudio_ = replyAudio_; + } else { + result.replyAudio_ = replyAudioBuilder_.build(); + } + if (automatedAgentReplyBuilder_ == null) { + result.automatedAgentReply_ = automatedAgentReply_; + } else { + result.automatedAgentReply_ = automatedAgentReplyBuilder_.build(); + } + if (messageBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = messageBuilder_.build(); + } + if (humanAgentSuggestionResultsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + humanAgentSuggestionResults_ = + java.util.Collections.unmodifiableList(humanAgentSuggestionResults_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.humanAgentSuggestionResults_ = humanAgentSuggestionResults_; + } else { + result.humanAgentSuggestionResults_ = humanAgentSuggestionResultsBuilder_.build(); + } + if (endUserSuggestionResultsBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + endUserSuggestionResults_ = + java.util.Collections.unmodifiableList(endUserSuggestionResults_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.endUserSuggestionResults_ = endUserSuggestionResults_; + } else { + result.endUserSuggestionResults_ = endUserSuggestionResultsBuilder_.build(); + } + if (dtmfParametersBuilder_ == null) { + result.dtmfParameters_ = dtmfParameters_; + } else { + result.dtmfParameters_ = dtmfParametersBuilder_.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.dialogflow.v2.StreamingAnalyzeContentResponse) { + return mergeFrom((com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse other) { + if (other + == com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.getDefaultInstance()) + return this; + if (other.hasRecognitionResult()) { + mergeRecognitionResult(other.getRecognitionResult()); + } + if (!other.getReplyText().isEmpty()) { + replyText_ = other.replyText_; + onChanged(); + } + if (other.hasReplyAudio()) { + mergeReplyAudio(other.getReplyAudio()); + } + if (other.hasAutomatedAgentReply()) { + mergeAutomatedAgentReply(other.getAutomatedAgentReply()); + } + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + if (humanAgentSuggestionResultsBuilder_ == null) { + if (!other.humanAgentSuggestionResults_.isEmpty()) { + if (humanAgentSuggestionResults_.isEmpty()) { + humanAgentSuggestionResults_ = other.humanAgentSuggestionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.addAll(other.humanAgentSuggestionResults_); + } + onChanged(); + } + } else { + if (!other.humanAgentSuggestionResults_.isEmpty()) { + if (humanAgentSuggestionResultsBuilder_.isEmpty()) { + humanAgentSuggestionResultsBuilder_.dispose(); + humanAgentSuggestionResultsBuilder_ = null; + humanAgentSuggestionResults_ = other.humanAgentSuggestionResults_; + bitField0_ = (bitField0_ & ~0x00000001); + humanAgentSuggestionResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHumanAgentSuggestionResultsFieldBuilder() + : null; + } else { + humanAgentSuggestionResultsBuilder_.addAllMessages(other.humanAgentSuggestionResults_); + } + } + } + if (endUserSuggestionResultsBuilder_ == null) { + if (!other.endUserSuggestionResults_.isEmpty()) { + if (endUserSuggestionResults_.isEmpty()) { + endUserSuggestionResults_ = other.endUserSuggestionResults_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.addAll(other.endUserSuggestionResults_); + } + onChanged(); + } + } else { + if (!other.endUserSuggestionResults_.isEmpty()) { + if (endUserSuggestionResultsBuilder_.isEmpty()) { + endUserSuggestionResultsBuilder_.dispose(); + endUserSuggestionResultsBuilder_ = null; + endUserSuggestionResults_ = other.endUserSuggestionResults_; + bitField0_ = (bitField0_ & ~0x00000002); + endUserSuggestionResultsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndUserSuggestionResultsFieldBuilder() + : null; + } else { + endUserSuggestionResultsBuilder_.addAllMessages(other.endUserSuggestionResults_); + } + } + } + if (other.hasDtmfParameters()) { + mergeDtmfParameters(other.getDtmfParameters()); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage( + getRecognitionResultFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 10 + case 18: + { + replyText_ = input.readStringRequireUtf8(); + + break; + } // case 18 + case 26: + { + input.readMessage(getReplyAudioFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 26 + case 34: + { + input.readMessage( + getAutomatedAgentReplyFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 34 + case 50: + { + input.readMessage(getMessageFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 50 + case 58: + { + com.google.cloud.dialogflow.v2.SuggestionResult m = + input.readMessage( + com.google.cloud.dialogflow.v2.SuggestionResult.parser(), + extensionRegistry); + if (humanAgentSuggestionResultsBuilder_ == null) { + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.add(m); + } else { + humanAgentSuggestionResultsBuilder_.addMessage(m); + } + break; + } // case 58 + case 66: + { + com.google.cloud.dialogflow.v2.SuggestionResult m = + input.readMessage( + com.google.cloud.dialogflow.v2.SuggestionResult.parser(), + extensionRegistry); + if (endUserSuggestionResultsBuilder_ == null) { + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.add(m); + } else { + endUserSuggestionResultsBuilder_.addMessage(m); + } + break; + } // case 66 + case 82: + { + input.readMessage(getDtmfParametersFieldBuilder().getBuilder(), extensionRegistry); + + break; + } // case 82 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.cloud.dialogflow.v2.StreamingRecognitionResult recognitionResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.StreamingRecognitionResult, + com.google.cloud.dialogflow.v2.StreamingRecognitionResult.Builder, + com.google.cloud.dialogflow.v2.StreamingRecognitionResultOrBuilder> + recognitionResultBuilder_; + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * + * @return Whether the recognitionResult field is set. + */ + public boolean hasRecognitionResult() { + return recognitionResultBuilder_ != null || recognitionResult_ != null; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * + * @return The recognitionResult. + */ + public com.google.cloud.dialogflow.v2.StreamingRecognitionResult getRecognitionResult() { + if (recognitionResultBuilder_ == null) { + return recognitionResult_ == null + ? com.google.cloud.dialogflow.v2.StreamingRecognitionResult.getDefaultInstance() + : recognitionResult_; + } else { + return recognitionResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + public Builder setRecognitionResult( + com.google.cloud.dialogflow.v2.StreamingRecognitionResult value) { + if (recognitionResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + recognitionResult_ = value; + onChanged(); + } else { + recognitionResultBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + public Builder setRecognitionResult( + com.google.cloud.dialogflow.v2.StreamingRecognitionResult.Builder builderForValue) { + if (recognitionResultBuilder_ == null) { + recognitionResult_ = builderForValue.build(); + onChanged(); + } else { + recognitionResultBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + public Builder mergeRecognitionResult( + com.google.cloud.dialogflow.v2.StreamingRecognitionResult value) { + if (recognitionResultBuilder_ == null) { + if (recognitionResult_ != null) { + recognitionResult_ = + com.google.cloud.dialogflow.v2.StreamingRecognitionResult.newBuilder( + recognitionResult_) + .mergeFrom(value) + .buildPartial(); + } else { + recognitionResult_ = value; + } + onChanged(); + } else { + recognitionResultBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + public Builder clearRecognitionResult() { + if (recognitionResultBuilder_ == null) { + recognitionResult_ = null; + onChanged(); + } else { + recognitionResult_ = null; + recognitionResultBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + public com.google.cloud.dialogflow.v2.StreamingRecognitionResult.Builder + getRecognitionResultBuilder() { + + onChanged(); + return getRecognitionResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + public com.google.cloud.dialogflow.v2.StreamingRecognitionResultOrBuilder + getRecognitionResultOrBuilder() { + if (recognitionResultBuilder_ != null) { + return recognitionResultBuilder_.getMessageOrBuilder(); + } else { + return recognitionResult_ == null + ? com.google.cloud.dialogflow.v2.StreamingRecognitionResult.getDefaultInstance() + : recognitionResult_; + } + } + /** + * + * + *
+     * The result of speech recognition.
+     * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.StreamingRecognitionResult, + com.google.cloud.dialogflow.v2.StreamingRecognitionResult.Builder, + com.google.cloud.dialogflow.v2.StreamingRecognitionResultOrBuilder> + getRecognitionResultFieldBuilder() { + if (recognitionResultBuilder_ == null) { + recognitionResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.StreamingRecognitionResult, + com.google.cloud.dialogflow.v2.StreamingRecognitionResult.Builder, + com.google.cloud.dialogflow.v2.StreamingRecognitionResultOrBuilder>( + getRecognitionResult(), getParentForChildren(), isClean()); + recognitionResult_ = null; + } + return recognitionResultBuilder_; + } + + private java.lang.Object replyText_ = ""; + /** + * + * + *
+     * The output text content.
+     * This field is set if an automated agent responded with a text for the user.
+     * 
+ * + * string reply_text = 2; + * + * @return The replyText. + */ + public java.lang.String getReplyText() { + java.lang.Object ref = replyText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + replyText_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The output text content.
+     * This field is set if an automated agent responded with a text for the user.
+     * 
+ * + * string reply_text = 2; + * + * @return The bytes for replyText. + */ + public com.google.protobuf.ByteString getReplyTextBytes() { + java.lang.Object ref = replyText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + replyText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The output text content.
+     * This field is set if an automated agent responded with a text for the user.
+     * 
+ * + * string reply_text = 2; + * + * @param value The replyText to set. + * @return This builder for chaining. + */ + public Builder setReplyText(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + replyText_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The output text content.
+     * This field is set if an automated agent responded with a text for the user.
+     * 
+ * + * string reply_text = 2; + * + * @return This builder for chaining. + */ + public Builder clearReplyText() { + + replyText_ = getDefaultInstance().getReplyText(); + onChanged(); + return this; + } + /** + * + * + *
+     * The output text content.
+     * This field is set if an automated agent responded with a text for the user.
+     * 
+ * + * string reply_text = 2; + * + * @param value The bytes for replyText to set. + * @return This builder for chaining. + */ + public Builder setReplyTextBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + replyText_ = value; + onChanged(); + return this; + } + + private com.google.cloud.dialogflow.v2.OutputAudio replyAudio_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.OutputAudio, + com.google.cloud.dialogflow.v2.OutputAudio.Builder, + com.google.cloud.dialogflow.v2.OutputAudioOrBuilder> + replyAudioBuilder_; + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * + * @return Whether the replyAudio field is set. + */ + public boolean hasReplyAudio() { + return replyAudioBuilder_ != null || replyAudio_ != null; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * + * @return The replyAudio. + */ + public com.google.cloud.dialogflow.v2.OutputAudio getReplyAudio() { + if (replyAudioBuilder_ == null) { + return replyAudio_ == null + ? com.google.cloud.dialogflow.v2.OutputAudio.getDefaultInstance() + : replyAudio_; + } else { + return replyAudioBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + public Builder setReplyAudio(com.google.cloud.dialogflow.v2.OutputAudio value) { + if (replyAudioBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replyAudio_ = value; + onChanged(); + } else { + replyAudioBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + public Builder setReplyAudio( + com.google.cloud.dialogflow.v2.OutputAudio.Builder builderForValue) { + if (replyAudioBuilder_ == null) { + replyAudio_ = builderForValue.build(); + onChanged(); + } else { + replyAudioBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + public Builder mergeReplyAudio(com.google.cloud.dialogflow.v2.OutputAudio value) { + if (replyAudioBuilder_ == null) { + if (replyAudio_ != null) { + replyAudio_ = + com.google.cloud.dialogflow.v2.OutputAudio.newBuilder(replyAudio_) + .mergeFrom(value) + .buildPartial(); + } else { + replyAudio_ = value; + } + onChanged(); + } else { + replyAudioBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + public Builder clearReplyAudio() { + if (replyAudioBuilder_ == null) { + replyAudio_ = null; + onChanged(); + } else { + replyAudio_ = null; + replyAudioBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + public com.google.cloud.dialogflow.v2.OutputAudio.Builder getReplyAudioBuilder() { + + onChanged(); + return getReplyAudioFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + public com.google.cloud.dialogflow.v2.OutputAudioOrBuilder getReplyAudioOrBuilder() { + if (replyAudioBuilder_ != null) { + return replyAudioBuilder_.getMessageOrBuilder(); + } else { + return replyAudio_ == null + ? com.google.cloud.dialogflow.v2.OutputAudio.getDefaultInstance() + : replyAudio_; + } + } + /** + * + * + *
+     * The audio data bytes encoded as specified in the request.
+     * This field is set if:
+     *  - The `reply_audio_config` field is specified in the request.
+     *  - The automated agent, which this output comes from, responded with audio.
+     *    In such case, the `reply_audio.config` field contains settings used to
+     *    synthesize the speech.
+     * In some scenarios, multiple output audio fields may be present in the
+     * response structure. In these cases, only the top-most-level audio output
+     * has content.
+     * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.OutputAudio, + com.google.cloud.dialogflow.v2.OutputAudio.Builder, + com.google.cloud.dialogflow.v2.OutputAudioOrBuilder> + getReplyAudioFieldBuilder() { + if (replyAudioBuilder_ == null) { + replyAudioBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.OutputAudio, + com.google.cloud.dialogflow.v2.OutputAudio.Builder, + com.google.cloud.dialogflow.v2.OutputAudioOrBuilder>( + getReplyAudio(), getParentForChildren(), isClean()); + replyAudio_ = null; + } + return replyAudioBuilder_; + } + + private com.google.cloud.dialogflow.v2.AutomatedAgentReply automatedAgentReply_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.AutomatedAgentReply, + com.google.cloud.dialogflow.v2.AutomatedAgentReply.Builder, + com.google.cloud.dialogflow.v2.AutomatedAgentReplyOrBuilder> + automatedAgentReplyBuilder_; + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * + * @return Whether the automatedAgentReply field is set. + */ + public boolean hasAutomatedAgentReply() { + return automatedAgentReplyBuilder_ != null || automatedAgentReply_ != null; + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * + * @return The automatedAgentReply. + */ + public com.google.cloud.dialogflow.v2.AutomatedAgentReply getAutomatedAgentReply() { + if (automatedAgentReplyBuilder_ == null) { + return automatedAgentReply_ == null + ? com.google.cloud.dialogflow.v2.AutomatedAgentReply.getDefaultInstance() + : automatedAgentReply_; + } else { + return automatedAgentReplyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + public Builder setAutomatedAgentReply( + com.google.cloud.dialogflow.v2.AutomatedAgentReply value) { + if (automatedAgentReplyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + automatedAgentReply_ = value; + onChanged(); + } else { + automatedAgentReplyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + public Builder setAutomatedAgentReply( + com.google.cloud.dialogflow.v2.AutomatedAgentReply.Builder builderForValue) { + if (automatedAgentReplyBuilder_ == null) { + automatedAgentReply_ = builderForValue.build(); + onChanged(); + } else { + automatedAgentReplyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + public Builder mergeAutomatedAgentReply( + com.google.cloud.dialogflow.v2.AutomatedAgentReply value) { + if (automatedAgentReplyBuilder_ == null) { + if (automatedAgentReply_ != null) { + automatedAgentReply_ = + com.google.cloud.dialogflow.v2.AutomatedAgentReply.newBuilder(automatedAgentReply_) + .mergeFrom(value) + .buildPartial(); + } else { + automatedAgentReply_ = value; + } + onChanged(); + } else { + automatedAgentReplyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + public Builder clearAutomatedAgentReply() { + if (automatedAgentReplyBuilder_ == null) { + automatedAgentReply_ = null; + onChanged(); + } else { + automatedAgentReply_ = null; + automatedAgentReplyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + public com.google.cloud.dialogflow.v2.AutomatedAgentReply.Builder + getAutomatedAgentReplyBuilder() { + + onChanged(); + return getAutomatedAgentReplyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + public com.google.cloud.dialogflow.v2.AutomatedAgentReplyOrBuilder + getAutomatedAgentReplyOrBuilder() { + if (automatedAgentReplyBuilder_ != null) { + return automatedAgentReplyBuilder_.getMessageOrBuilder(); + } else { + return automatedAgentReply_ == null + ? com.google.cloud.dialogflow.v2.AutomatedAgentReply.getDefaultInstance() + : automatedAgentReply_; + } + } + /** + * + * + *
+     * Only set if a Dialogflow automated agent has responded.
+     * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+     * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+     * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+     * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.AutomatedAgentReply, + com.google.cloud.dialogflow.v2.AutomatedAgentReply.Builder, + com.google.cloud.dialogflow.v2.AutomatedAgentReplyOrBuilder> + getAutomatedAgentReplyFieldBuilder() { + if (automatedAgentReplyBuilder_ == null) { + automatedAgentReplyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.AutomatedAgentReply, + com.google.cloud.dialogflow.v2.AutomatedAgentReply.Builder, + com.google.cloud.dialogflow.v2.AutomatedAgentReplyOrBuilder>( + getAutomatedAgentReply(), getParentForChildren(), isClean()); + automatedAgentReply_ = null; + } + return automatedAgentReplyBuilder_; + } + + private com.google.cloud.dialogflow.v2.Message message_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.Message, + com.google.cloud.dialogflow.v2.Message.Builder, + com.google.cloud.dialogflow.v2.MessageOrBuilder> + messageBuilder_; + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + * + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return messageBuilder_ != null || message_ != null; + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + * + * @return The message. + */ + public com.google.cloud.dialogflow.v2.Message getMessage() { + if (messageBuilder_ == null) { + return message_ == null + ? com.google.cloud.dialogflow.v2.Message.getDefaultInstance() + : message_; + } else { + return messageBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + public Builder setMessage(com.google.cloud.dialogflow.v2.Message value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + messageBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + public Builder setMessage(com.google.cloud.dialogflow.v2.Message.Builder builderForValue) { + if (messageBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + public Builder mergeMessage(com.google.cloud.dialogflow.v2.Message value) { + if (messageBuilder_ == null) { + if (message_ != null) { + message_ = + com.google.cloud.dialogflow.v2.Message.newBuilder(message_) + .mergeFrom(value) + .buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + messageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + public Builder clearMessage() { + if (messageBuilder_ == null) { + message_ = null; + onChanged(); + } else { + message_ = null; + messageBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + public com.google.cloud.dialogflow.v2.Message.Builder getMessageBuilder() { + + onChanged(); + return getMessageFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + public com.google.cloud.dialogflow.v2.MessageOrBuilder getMessageOrBuilder() { + if (messageBuilder_ != null) { + return messageBuilder_.getMessageOrBuilder(); + } else { + return message_ == null + ? com.google.cloud.dialogflow.v2.Message.getDefaultInstance() + : message_; + } + } + /** + * + * + *
+     * Message analyzed by CCAI.
+     * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.Message, + com.google.cloud.dialogflow.v2.Message.Builder, + com.google.cloud.dialogflow.v2.MessageOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + messageBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.Message, + com.google.cloud.dialogflow.v2.Message.Builder, + com.google.cloud.dialogflow.v2.MessageOrBuilder>( + getMessage(), getParentForChildren(), isClean()); + message_ = null; + } + return messageBuilder_; + } + + private java.util.List + humanAgentSuggestionResults_ = java.util.Collections.emptyList(); + + private void ensureHumanAgentSuggestionResultsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + humanAgentSuggestionResults_ = + new java.util.ArrayList( + humanAgentSuggestionResults_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.v2.SuggestionResult, + com.google.cloud.dialogflow.v2.SuggestionResult.Builder, + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder> + humanAgentSuggestionResultsBuilder_; + + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public java.util.List + getHumanAgentSuggestionResultsList() { + if (humanAgentSuggestionResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(humanAgentSuggestionResults_); + } else { + return humanAgentSuggestionResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public int getHumanAgentSuggestionResultsCount() { + if (humanAgentSuggestionResultsBuilder_ == null) { + return humanAgentSuggestionResults_.size(); + } else { + return humanAgentSuggestionResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult getHumanAgentSuggestionResults( + int index) { + if (humanAgentSuggestionResultsBuilder_ == null) { + return humanAgentSuggestionResults_.get(index); + } else { + return humanAgentSuggestionResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder setHumanAgentSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult value) { + if (humanAgentSuggestionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.set(index, value); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder setHumanAgentSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult.Builder builderForValue) { + if (humanAgentSuggestionResultsBuilder_ == null) { + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.set(index, builderForValue.build()); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder addHumanAgentSuggestionResults( + com.google.cloud.dialogflow.v2.SuggestionResult value) { + if (humanAgentSuggestionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.add(value); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder addHumanAgentSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult value) { + if (humanAgentSuggestionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.add(index, value); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder addHumanAgentSuggestionResults( + com.google.cloud.dialogflow.v2.SuggestionResult.Builder builderForValue) { + if (humanAgentSuggestionResultsBuilder_ == null) { + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.add(builderForValue.build()); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder addHumanAgentSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult.Builder builderForValue) { + if (humanAgentSuggestionResultsBuilder_ == null) { + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.add(index, builderForValue.build()); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder addAllHumanAgentSuggestionResults( + java.lang.Iterable values) { + if (humanAgentSuggestionResultsBuilder_ == null) { + ensureHumanAgentSuggestionResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, humanAgentSuggestionResults_); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder clearHumanAgentSuggestionResults() { + if (humanAgentSuggestionResultsBuilder_ == null) { + humanAgentSuggestionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public Builder removeHumanAgentSuggestionResults(int index) { + if (humanAgentSuggestionResultsBuilder_ == null) { + ensureHumanAgentSuggestionResultsIsMutable(); + humanAgentSuggestionResults_.remove(index); + onChanged(); + } else { + humanAgentSuggestionResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult.Builder + getHumanAgentSuggestionResultsBuilder(int index) { + return getHumanAgentSuggestionResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder + getHumanAgentSuggestionResultsOrBuilder(int index) { + if (humanAgentSuggestionResultsBuilder_ == null) { + return humanAgentSuggestionResults_.get(index); + } else { + return humanAgentSuggestionResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public java.util.List + getHumanAgentSuggestionResultsOrBuilderList() { + if (humanAgentSuggestionResultsBuilder_ != null) { + return humanAgentSuggestionResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(humanAgentSuggestionResults_); + } + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult.Builder + addHumanAgentSuggestionResultsBuilder() { + return getHumanAgentSuggestionResultsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.v2.SuggestionResult.getDefaultInstance()); + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult.Builder + addHumanAgentSuggestionResultsBuilder(int index) { + return getHumanAgentSuggestionResultsFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.v2.SuggestionResult.getDefaultInstance()); + } + /** + * + * + *
+     * The suggestions for most recent human agent. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+     * 
+ * + * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + public java.util.List + getHumanAgentSuggestionResultsBuilderList() { + return getHumanAgentSuggestionResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.v2.SuggestionResult, + com.google.cloud.dialogflow.v2.SuggestionResult.Builder, + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder> + getHumanAgentSuggestionResultsFieldBuilder() { + if (humanAgentSuggestionResultsBuilder_ == null) { + humanAgentSuggestionResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.v2.SuggestionResult, + com.google.cloud.dialogflow.v2.SuggestionResult.Builder, + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder>( + humanAgentSuggestionResults_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + humanAgentSuggestionResults_ = null; + } + return humanAgentSuggestionResultsBuilder_; + } + + private java.util.List + endUserSuggestionResults_ = java.util.Collections.emptyList(); + + private void ensureEndUserSuggestionResultsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + endUserSuggestionResults_ = + new java.util.ArrayList( + endUserSuggestionResults_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.v2.SuggestionResult, + com.google.cloud.dialogflow.v2.SuggestionResult.Builder, + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder> + endUserSuggestionResultsBuilder_; + + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public java.util.List + getEndUserSuggestionResultsList() { + if (endUserSuggestionResultsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endUserSuggestionResults_); + } else { + return endUserSuggestionResultsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public int getEndUserSuggestionResultsCount() { + if (endUserSuggestionResultsBuilder_ == null) { + return endUserSuggestionResults_.size(); + } else { + return endUserSuggestionResultsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult getEndUserSuggestionResults(int index) { + if (endUserSuggestionResultsBuilder_ == null) { + return endUserSuggestionResults_.get(index); + } else { + return endUserSuggestionResultsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder setEndUserSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult value) { + if (endUserSuggestionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.set(index, value); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder setEndUserSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult.Builder builderForValue) { + if (endUserSuggestionResultsBuilder_ == null) { + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.set(index, builderForValue.build()); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder addEndUserSuggestionResults( + com.google.cloud.dialogflow.v2.SuggestionResult value) { + if (endUserSuggestionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.add(value); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder addEndUserSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult value) { + if (endUserSuggestionResultsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.add(index, value); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder addEndUserSuggestionResults( + com.google.cloud.dialogflow.v2.SuggestionResult.Builder builderForValue) { + if (endUserSuggestionResultsBuilder_ == null) { + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.add(builderForValue.build()); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder addEndUserSuggestionResults( + int index, com.google.cloud.dialogflow.v2.SuggestionResult.Builder builderForValue) { + if (endUserSuggestionResultsBuilder_ == null) { + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.add(index, builderForValue.build()); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder addAllEndUserSuggestionResults( + java.lang.Iterable values) { + if (endUserSuggestionResultsBuilder_ == null) { + ensureEndUserSuggestionResultsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endUserSuggestionResults_); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder clearEndUserSuggestionResults() { + if (endUserSuggestionResultsBuilder_ == null) { + endUserSuggestionResults_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public Builder removeEndUserSuggestionResults(int index) { + if (endUserSuggestionResultsBuilder_ == null) { + ensureEndUserSuggestionResultsIsMutable(); + endUserSuggestionResults_.remove(index); + onChanged(); + } else { + endUserSuggestionResultsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult.Builder + getEndUserSuggestionResultsBuilder(int index) { + return getEndUserSuggestionResultsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder + getEndUserSuggestionResultsOrBuilder(int index) { + if (endUserSuggestionResultsBuilder_ == null) { + return endUserSuggestionResults_.get(index); + } else { + return endUserSuggestionResultsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public java.util.List + getEndUserSuggestionResultsOrBuilderList() { + if (endUserSuggestionResultsBuilder_ != null) { + return endUserSuggestionResultsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endUserSuggestionResults_); + } + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult.Builder + addEndUserSuggestionResultsBuilder() { + return getEndUserSuggestionResultsFieldBuilder() + .addBuilder(com.google.cloud.dialogflow.v2.SuggestionResult.getDefaultInstance()); + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public com.google.cloud.dialogflow.v2.SuggestionResult.Builder + addEndUserSuggestionResultsBuilder(int index) { + return getEndUserSuggestionResultsFieldBuilder() + .addBuilder(index, com.google.cloud.dialogflow.v2.SuggestionResult.getDefaultInstance()); + } + /** + * + * + *
+     * The suggestions for end user. The order is the same as
+     * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+     * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + public java.util.List + getEndUserSuggestionResultsBuilderList() { + return getEndUserSuggestionResultsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.v2.SuggestionResult, + com.google.cloud.dialogflow.v2.SuggestionResult.Builder, + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder> + getEndUserSuggestionResultsFieldBuilder() { + if (endUserSuggestionResultsBuilder_ == null) { + endUserSuggestionResultsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.dialogflow.v2.SuggestionResult, + com.google.cloud.dialogflow.v2.SuggestionResult.Builder, + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder>( + endUserSuggestionResults_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + endUserSuggestionResults_ = null; + } + return endUserSuggestionResultsBuilder_; + } + + private com.google.cloud.dialogflow.v2.DtmfParameters dtmfParameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.DtmfParameters, + com.google.cloud.dialogflow.v2.DtmfParameters.Builder, + com.google.cloud.dialogflow.v2.DtmfParametersOrBuilder> + dtmfParametersBuilder_; + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * + * @return Whether the dtmfParameters field is set. + */ + public boolean hasDtmfParameters() { + return dtmfParametersBuilder_ != null || dtmfParameters_ != null; + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * + * @return The dtmfParameters. + */ + public com.google.cloud.dialogflow.v2.DtmfParameters getDtmfParameters() { + if (dtmfParametersBuilder_ == null) { + return dtmfParameters_ == null + ? com.google.cloud.dialogflow.v2.DtmfParameters.getDefaultInstance() + : dtmfParameters_; + } else { + return dtmfParametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + public Builder setDtmfParameters(com.google.cloud.dialogflow.v2.DtmfParameters value) { + if (dtmfParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + dtmfParameters_ = value; + onChanged(); + } else { + dtmfParametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + public Builder setDtmfParameters( + com.google.cloud.dialogflow.v2.DtmfParameters.Builder builderForValue) { + if (dtmfParametersBuilder_ == null) { + dtmfParameters_ = builderForValue.build(); + onChanged(); + } else { + dtmfParametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + public Builder mergeDtmfParameters(com.google.cloud.dialogflow.v2.DtmfParameters value) { + if (dtmfParametersBuilder_ == null) { + if (dtmfParameters_ != null) { + dtmfParameters_ = + com.google.cloud.dialogflow.v2.DtmfParameters.newBuilder(dtmfParameters_) + .mergeFrom(value) + .buildPartial(); + } else { + dtmfParameters_ = value; + } + onChanged(); + } else { + dtmfParametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + public Builder clearDtmfParameters() { + if (dtmfParametersBuilder_ == null) { + dtmfParameters_ = null; + onChanged(); + } else { + dtmfParameters_ = null; + dtmfParametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + public com.google.cloud.dialogflow.v2.DtmfParameters.Builder getDtmfParametersBuilder() { + + onChanged(); + return getDtmfParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + public com.google.cloud.dialogflow.v2.DtmfParametersOrBuilder getDtmfParametersOrBuilder() { + if (dtmfParametersBuilder_ != null) { + return dtmfParametersBuilder_.getMessageOrBuilder(); + } else { + return dtmfParameters_ == null + ? com.google.cloud.dialogflow.v2.DtmfParameters.getDefaultInstance() + : dtmfParameters_; + } + } + /** + * + * + *
+     * Indicates the parameters of DTMF.
+     * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.DtmfParameters, + com.google.cloud.dialogflow.v2.DtmfParameters.Builder, + com.google.cloud.dialogflow.v2.DtmfParametersOrBuilder> + getDtmfParametersFieldBuilder() { + if (dtmfParametersBuilder_ == null) { + dtmfParametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.dialogflow.v2.DtmfParameters, + com.google.cloud.dialogflow.v2.DtmfParameters.Builder, + com.google.cloud.dialogflow.v2.DtmfParametersOrBuilder>( + getDtmfParameters(), getParentForChildren(), isClean()); + dtmfParameters_ = null; + } + return dtmfParametersBuilder_; + } + + @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.dialogflow.v2.StreamingAnalyzeContentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) + private static final com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse(); + } + + public static com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StreamingAnalyzeContentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.dialogflow.v2.StreamingAnalyzeContentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponseOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponseOrBuilder.java new file mode 100644 index 000000000000..3afa1f21c7e3 --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/StreamingAnalyzeContentResponseOrBuilder.java @@ -0,0 +1,398 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/participant.proto + +package com.google.cloud.dialogflow.v2; + +public interface StreamingAnalyzeContentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * + * @return Whether the recognitionResult field is set. + */ + boolean hasRecognitionResult(); + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + * + * @return The recognitionResult. + */ + com.google.cloud.dialogflow.v2.StreamingRecognitionResult getRecognitionResult(); + /** + * + * + *
+   * The result of speech recognition.
+   * 
+ * + * .google.cloud.dialogflow.v2.StreamingRecognitionResult recognition_result = 1; + */ + com.google.cloud.dialogflow.v2.StreamingRecognitionResultOrBuilder + getRecognitionResultOrBuilder(); + + /** + * + * + *
+   * The output text content.
+   * This field is set if an automated agent responded with a text for the user.
+   * 
+ * + * string reply_text = 2; + * + * @return The replyText. + */ + java.lang.String getReplyText(); + /** + * + * + *
+   * The output text content.
+   * This field is set if an automated agent responded with a text for the user.
+   * 
+ * + * string reply_text = 2; + * + * @return The bytes for replyText. + */ + com.google.protobuf.ByteString getReplyTextBytes(); + + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * This field is set if:
+   *  - The `reply_audio_config` field is specified in the request.
+   *  - The automated agent, which this output comes from, responded with audio.
+   *    In such case, the `reply_audio.config` field contains settings used to
+   *    synthesize the speech.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * + * @return Whether the replyAudio field is set. + */ + boolean hasReplyAudio(); + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * This field is set if:
+   *  - The `reply_audio_config` field is specified in the request.
+   *  - The automated agent, which this output comes from, responded with audio.
+   *    In such case, the `reply_audio.config` field contains settings used to
+   *    synthesize the speech.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + * + * @return The replyAudio. + */ + com.google.cloud.dialogflow.v2.OutputAudio getReplyAudio(); + /** + * + * + *
+   * The audio data bytes encoded as specified in the request.
+   * This field is set if:
+   *  - The `reply_audio_config` field is specified in the request.
+   *  - The automated agent, which this output comes from, responded with audio.
+   *    In such case, the `reply_audio.config` field contains settings used to
+   *    synthesize the speech.
+   * In some scenarios, multiple output audio fields may be present in the
+   * response structure. In these cases, only the top-most-level audio output
+   * has content.
+   * 
+ * + * .google.cloud.dialogflow.v2.OutputAudio reply_audio = 3; + */ + com.google.cloud.dialogflow.v2.OutputAudioOrBuilder getReplyAudioOrBuilder(); + + /** + * + * + *
+   * Only set if a Dialogflow automated agent has responded.
+   * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+   * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+   * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+   * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * + * @return Whether the automatedAgentReply field is set. + */ + boolean hasAutomatedAgentReply(); + /** + * + * + *
+   * Only set if a Dialogflow automated agent has responded.
+   * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+   * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+   * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+   * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + * + * @return The automatedAgentReply. + */ + com.google.cloud.dialogflow.v2.AutomatedAgentReply getAutomatedAgentReply(); + /** + * + * + *
+   * Only set if a Dialogflow automated agent has responded.
+   * Note that: [AutomatedAgentReply.detect_intent_response.output_audio][]
+   * and [AutomatedAgentReply.detect_intent_response.output_audio_config][]
+   * are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead.
+   * 
+ * + * .google.cloud.dialogflow.v2.AutomatedAgentReply automated_agent_reply = 4; + */ + com.google.cloud.dialogflow.v2.AutomatedAgentReplyOrBuilder getAutomatedAgentReplyOrBuilder(); + + /** + * + * + *
+   * Message analyzed by CCAI.
+   * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + * + * @return Whether the message field is set. + */ + boolean hasMessage(); + /** + * + * + *
+   * Message analyzed by CCAI.
+   * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + * + * @return The message. + */ + com.google.cloud.dialogflow.v2.Message getMessage(); + /** + * + * + *
+   * Message analyzed by CCAI.
+   * 
+ * + * .google.cloud.dialogflow.v2.Message message = 6; + */ + com.google.cloud.dialogflow.v2.MessageOrBuilder getMessageOrBuilder(); + + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + java.util.List + getHumanAgentSuggestionResultsList(); + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + com.google.cloud.dialogflow.v2.SuggestionResult getHumanAgentSuggestionResults(int index); + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + int getHumanAgentSuggestionResultsCount(); + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + java.util.List + getHumanAgentSuggestionResultsOrBuilderList(); + /** + * + * + *
+   * The suggestions for most recent human agent. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult human_agent_suggestion_results = 7; + * + */ + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder getHumanAgentSuggestionResultsOrBuilder( + int index); + + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + java.util.List getEndUserSuggestionResultsList(); + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + com.google.cloud.dialogflow.v2.SuggestionResult getEndUserSuggestionResults(int index); + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + int getEndUserSuggestionResultsCount(); + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + java.util.List + getEndUserSuggestionResultsOrBuilderList(); + /** + * + * + *
+   * The suggestions for end user. The order is the same as
+   * [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of
+   * [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config].
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.SuggestionResult end_user_suggestion_results = 8; + * + */ + com.google.cloud.dialogflow.v2.SuggestionResultOrBuilder getEndUserSuggestionResultsOrBuilder( + int index); + + /** + * + * + *
+   * Indicates the parameters of DTMF.
+   * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * + * @return Whether the dtmfParameters field is set. + */ + boolean hasDtmfParameters(); + /** + * + * + *
+   * Indicates the parameters of DTMF.
+   * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + * + * @return The dtmfParameters. + */ + com.google.cloud.dialogflow.v2.DtmfParameters getDtmfParameters(); + /** + * + * + *
+   * Indicates the parameters of DTMF.
+   * 
+ * + * .google.cloud.dialogflow.v2.DtmfParameters dtmf_parameters = 10; + */ + com.google.cloud.dialogflow.v2.DtmfParametersOrBuilder getDtmfParametersOrBuilder(); +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmf.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmf.java new file mode 100644 index 000000000000..48f3867a993d --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmf.java @@ -0,0 +1,485 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/audio_config.proto + +package com.google.cloud.dialogflow.v2; + +/** + * + * + *
+ * [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling)
+ * digit in Telephony Gateway.
+ * 
+ * + * Protobuf enum {@code google.cloud.dialogflow.v2.TelephonyDtmf} + */ +public enum TelephonyDtmf implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not specified. This value may be used to indicate an absent digit.
+   * 
+ * + * TELEPHONY_DTMF_UNSPECIFIED = 0; + */ + TELEPHONY_DTMF_UNSPECIFIED(0), + /** + * + * + *
+   * Number: '1'.
+   * 
+ * + * DTMF_ONE = 1; + */ + DTMF_ONE(1), + /** + * + * + *
+   * Number: '2'.
+   * 
+ * + * DTMF_TWO = 2; + */ + DTMF_TWO(2), + /** + * + * + *
+   * Number: '3'.
+   * 
+ * + * DTMF_THREE = 3; + */ + DTMF_THREE(3), + /** + * + * + *
+   * Number: '4'.
+   * 
+ * + * DTMF_FOUR = 4; + */ + DTMF_FOUR(4), + /** + * + * + *
+   * Number: '5'.
+   * 
+ * + * DTMF_FIVE = 5; + */ + DTMF_FIVE(5), + /** + * + * + *
+   * Number: '6'.
+   * 
+ * + * DTMF_SIX = 6; + */ + DTMF_SIX(6), + /** + * + * + *
+   * Number: '7'.
+   * 
+ * + * DTMF_SEVEN = 7; + */ + DTMF_SEVEN(7), + /** + * + * + *
+   * Number: '8'.
+   * 
+ * + * DTMF_EIGHT = 8; + */ + DTMF_EIGHT(8), + /** + * + * + *
+   * Number: '9'.
+   * 
+ * + * DTMF_NINE = 9; + */ + DTMF_NINE(9), + /** + * + * + *
+   * Number: '0'.
+   * 
+ * + * DTMF_ZERO = 10; + */ + DTMF_ZERO(10), + /** + * + * + *
+   * Letter: 'A'.
+   * 
+ * + * DTMF_A = 11; + */ + DTMF_A(11), + /** + * + * + *
+   * Letter: 'B'.
+   * 
+ * + * DTMF_B = 12; + */ + DTMF_B(12), + /** + * + * + *
+   * Letter: 'C'.
+   * 
+ * + * DTMF_C = 13; + */ + DTMF_C(13), + /** + * + * + *
+   * Letter: 'D'.
+   * 
+ * + * DTMF_D = 14; + */ + DTMF_D(14), + /** + * + * + *
+   * Asterisk/star: '*'.
+   * 
+ * + * DTMF_STAR = 15; + */ + DTMF_STAR(15), + /** + * + * + *
+   * Pound/diamond/hash/square/gate/octothorpe: '#'.
+   * 
+ * + * DTMF_POUND = 16; + */ + DTMF_POUND(16), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not specified. This value may be used to indicate an absent digit.
+   * 
+ * + * TELEPHONY_DTMF_UNSPECIFIED = 0; + */ + public static final int TELEPHONY_DTMF_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Number: '1'.
+   * 
+ * + * DTMF_ONE = 1; + */ + public static final int DTMF_ONE_VALUE = 1; + /** + * + * + *
+   * Number: '2'.
+   * 
+ * + * DTMF_TWO = 2; + */ + public static final int DTMF_TWO_VALUE = 2; + /** + * + * + *
+   * Number: '3'.
+   * 
+ * + * DTMF_THREE = 3; + */ + public static final int DTMF_THREE_VALUE = 3; + /** + * + * + *
+   * Number: '4'.
+   * 
+ * + * DTMF_FOUR = 4; + */ + public static final int DTMF_FOUR_VALUE = 4; + /** + * + * + *
+   * Number: '5'.
+   * 
+ * + * DTMF_FIVE = 5; + */ + public static final int DTMF_FIVE_VALUE = 5; + /** + * + * + *
+   * Number: '6'.
+   * 
+ * + * DTMF_SIX = 6; + */ + public static final int DTMF_SIX_VALUE = 6; + /** + * + * + *
+   * Number: '7'.
+   * 
+ * + * DTMF_SEVEN = 7; + */ + public static final int DTMF_SEVEN_VALUE = 7; + /** + * + * + *
+   * Number: '8'.
+   * 
+ * + * DTMF_EIGHT = 8; + */ + public static final int DTMF_EIGHT_VALUE = 8; + /** + * + * + *
+   * Number: '9'.
+   * 
+ * + * DTMF_NINE = 9; + */ + public static final int DTMF_NINE_VALUE = 9; + /** + * + * + *
+   * Number: '0'.
+   * 
+ * + * DTMF_ZERO = 10; + */ + public static final int DTMF_ZERO_VALUE = 10; + /** + * + * + *
+   * Letter: 'A'.
+   * 
+ * + * DTMF_A = 11; + */ + public static final int DTMF_A_VALUE = 11; + /** + * + * + *
+   * Letter: 'B'.
+   * 
+ * + * DTMF_B = 12; + */ + public static final int DTMF_B_VALUE = 12; + /** + * + * + *
+   * Letter: 'C'.
+   * 
+ * + * DTMF_C = 13; + */ + public static final int DTMF_C_VALUE = 13; + /** + * + * + *
+   * Letter: 'D'.
+   * 
+ * + * DTMF_D = 14; + */ + public static final int DTMF_D_VALUE = 14; + /** + * + * + *
+   * Asterisk/star: '*'.
+   * 
+ * + * DTMF_STAR = 15; + */ + public static final int DTMF_STAR_VALUE = 15; + /** + * + * + *
+   * Pound/diamond/hash/square/gate/octothorpe: '#'.
+   * 
+ * + * DTMF_POUND = 16; + */ + public static final int DTMF_POUND_VALUE = 16; + + 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 TelephonyDtmf 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 TelephonyDtmf forNumber(int value) { + switch (value) { + case 0: + return TELEPHONY_DTMF_UNSPECIFIED; + case 1: + return DTMF_ONE; + case 2: + return DTMF_TWO; + case 3: + return DTMF_THREE; + case 4: + return DTMF_FOUR; + case 5: + return DTMF_FIVE; + case 6: + return DTMF_SIX; + case 7: + return DTMF_SEVEN; + case 8: + return DTMF_EIGHT; + case 9: + return DTMF_NINE; + case 10: + return DTMF_ZERO; + case 11: + return DTMF_A; + case 12: + return DTMF_B; + case 13: + return DTMF_C; + case 14: + return DTMF_D; + case 15: + return DTMF_STAR; + case 16: + return DTMF_POUND; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TelephonyDtmf findValueByNumber(int number) { + return TelephonyDtmf.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.dialogflow.v2.AudioConfigProto.getDescriptor().getEnumTypes().get(4); + } + + private static final TelephonyDtmf[] VALUES = values(); + + public static TelephonyDtmf 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 TelephonyDtmf(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.TelephonyDtmf) +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEvents.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEvents.java new file mode 100644 index 000000000000..e08621737910 --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEvents.java @@ -0,0 +1,821 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/audio_config.proto + +package com.google.cloud.dialogflow.v2; + +/** + * + * + *
+ * A wrapper of repeated TelephonyDtmf digits.
+ * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.TelephonyDtmfEvents} + */ +public final class TelephonyDtmfEvents extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.TelephonyDtmfEvents) + TelephonyDtmfEventsOrBuilder { + private static final long serialVersionUID = 0L; + // Use TelephonyDtmfEvents.newBuilder() to construct. + private TelephonyDtmfEvents(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TelephonyDtmfEvents() { + dtmfEvents_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new TelephonyDtmfEvents(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.AudioConfigProto + .internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.AudioConfigProto + .internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.class, + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder.class); + } + + public static final int DTMF_EVENTS_FIELD_NUMBER = 1; + private java.util.List dtmfEvents_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.dialogflow.v2.TelephonyDtmf> + dtmfEvents_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.cloud.dialogflow.v2.TelephonyDtmf>() { + public com.google.cloud.dialogflow.v2.TelephonyDtmf convert(java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.cloud.dialogflow.v2.TelephonyDtmf result = + com.google.cloud.dialogflow.v2.TelephonyDtmf.valueOf(from); + return result == null + ? com.google.cloud.dialogflow.v2.TelephonyDtmf.UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return A list containing the dtmfEvents. + */ + @java.lang.Override + public java.util.List getDtmfEventsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.dialogflow.v2.TelephonyDtmf>( + dtmfEvents_, dtmfEvents_converter_); + } + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return The count of dtmfEvents. + */ + @java.lang.Override + public int getDtmfEventsCount() { + return dtmfEvents_.size(); + } + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index of the element to return. + * @return The dtmfEvents at the given index. + */ + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmf getDtmfEvents(int index) { + return dtmfEvents_converter_.convert(dtmfEvents_.get(index)); + } + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return A list containing the enum numeric values on the wire for dtmfEvents. + */ + @java.lang.Override + public java.util.List getDtmfEventsValueList() { + return dtmfEvents_; + } + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of dtmfEvents at the given index. + */ + @java.lang.Override + public int getDtmfEventsValue(int index) { + return dtmfEvents_.get(index); + } + + private int dtmfEventsMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (getDtmfEventsList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(dtmfEventsMemoizedSerializedSize); + } + for (int i = 0; i < dtmfEvents_.size(); i++) { + output.writeEnumNoTag(dtmfEvents_.get(i)); + } + getUnknownFields().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 < dtmfEvents_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(dtmfEvents_.get(i)); + } + size += dataSize; + if (!getDtmfEventsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + dtmfEventsMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().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.dialogflow.v2.TelephonyDtmfEvents)) { + return super.equals(obj); + } + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents other = + (com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) obj; + + if (!dtmfEvents_.equals(other.dtmfEvents_)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDtmfEventsCount() > 0) { + hash = (37 * hash) + DTMF_EVENTS_FIELD_NUMBER; + hash = (53 * hash) + dtmfEvents_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents 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.dialogflow.v2.TelephonyDtmfEvents parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents 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.dialogflow.v2.TelephonyDtmfEvents parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents 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.dialogflow.v2.TelephonyDtmfEvents parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents 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.dialogflow.v2.TelephonyDtmfEvents parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents 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.dialogflow.v2.TelephonyDtmfEvents 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 wrapper of repeated TelephonyDtmf digits.
+   * 
+ * + * Protobuf type {@code google.cloud.dialogflow.v2.TelephonyDtmfEvents} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.TelephonyDtmfEvents) + com.google.cloud.dialogflow.v2.TelephonyDtmfEventsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.dialogflow.v2.AudioConfigProto + .internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.dialogflow.v2.AudioConfigProto + .internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.class, + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.Builder.class); + } + + // Construct using com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + dtmfEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.dialogflow.v2.AudioConfigProto + .internal_static_google_cloud_dialogflow_v2_TelephonyDtmfEvents_descriptor; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEvents getDefaultInstanceForType() { + return com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEvents build() { + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.dialogflow.v2.TelephonyDtmfEvents buildPartial() { + com.google.cloud.dialogflow.v2.TelephonyDtmfEvents result = + new com.google.cloud.dialogflow.v2.TelephonyDtmfEvents(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + dtmfEvents_ = java.util.Collections.unmodifiableList(dtmfEvents_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.dtmfEvents_ = dtmfEvents_; + 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.dialogflow.v2.TelephonyDtmfEvents) { + return mergeFrom((com.google.cloud.dialogflow.v2.TelephonyDtmfEvents) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.dialogflow.v2.TelephonyDtmfEvents other) { + if (other == com.google.cloud.dialogflow.v2.TelephonyDtmfEvents.getDefaultInstance()) + return this; + if (!other.dtmfEvents_.isEmpty()) { + if (dtmfEvents_.isEmpty()) { + dtmfEvents_ = other.dtmfEvents_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDtmfEventsIsMutable(); + dtmfEvents_.addAll(other.dtmfEvents_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int tmpRaw = input.readEnum(); + ensureDtmfEventsIsMutable(); + dtmfEvents_.add(tmpRaw); + break; + } // case 8 + case 10: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureDtmfEventsIsMutable(); + dtmfEvents_.add(tmpRaw); + } + input.popLimit(oldLimit); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List dtmfEvents_ = java.util.Collections.emptyList(); + + private void ensureDtmfEventsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + dtmfEvents_ = new java.util.ArrayList(dtmfEvents_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return A list containing the dtmfEvents. + */ + public java.util.List getDtmfEventsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.cloud.dialogflow.v2.TelephonyDtmf>( + dtmfEvents_, dtmfEvents_converter_); + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return The count of dtmfEvents. + */ + public int getDtmfEventsCount() { + return dtmfEvents_.size(); + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index of the element to return. + * @return The dtmfEvents at the given index. + */ + public com.google.cloud.dialogflow.v2.TelephonyDtmf getDtmfEvents(int index) { + return dtmfEvents_converter_.convert(dtmfEvents_.get(index)); + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index to set the value at. + * @param value The dtmfEvents to set. + * @return This builder for chaining. + */ + public Builder setDtmfEvents(int index, com.google.cloud.dialogflow.v2.TelephonyDtmf value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtmfEventsIsMutable(); + dtmfEvents_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param value The dtmfEvents to add. + * @return This builder for chaining. + */ + public Builder addDtmfEvents(com.google.cloud.dialogflow.v2.TelephonyDtmf value) { + if (value == null) { + throw new NullPointerException(); + } + ensureDtmfEventsIsMutable(); + dtmfEvents_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param values The dtmfEvents to add. + * @return This builder for chaining. + */ + public Builder addAllDtmfEvents( + java.lang.Iterable values) { + ensureDtmfEventsIsMutable(); + for (com.google.cloud.dialogflow.v2.TelephonyDtmf value : values) { + dtmfEvents_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return This builder for chaining. + */ + public Builder clearDtmfEvents() { + dtmfEvents_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return A list containing the enum numeric values on the wire for dtmfEvents. + */ + public java.util.List getDtmfEventsValueList() { + return java.util.Collections.unmodifiableList(dtmfEvents_); + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of dtmfEvents at the given index. + */ + public int getDtmfEventsValue(int index) { + return dtmfEvents_.get(index); + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for dtmfEvents to set. + * @return This builder for chaining. + */ + public Builder setDtmfEventsValue(int index, int value) { + ensureDtmfEventsIsMutable(); + dtmfEvents_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param value The enum numeric value on the wire for dtmfEvents to add. + * @return This builder for chaining. + */ + public Builder addDtmfEventsValue(int value) { + ensureDtmfEventsIsMutable(); + dtmfEvents_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A sequence of TelephonyDtmf digits.
+     * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param values The enum numeric values on the wire for dtmfEvents to add. + * @return This builder for chaining. + */ + public Builder addAllDtmfEventsValue(java.lang.Iterable values) { + ensureDtmfEventsIsMutable(); + for (int value : values) { + dtmfEvents_.add(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.dialogflow.v2.TelephonyDtmfEvents) + } + + // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.TelephonyDtmfEvents) + private static final com.google.cloud.dialogflow.v2.TelephonyDtmfEvents DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.TelephonyDtmfEvents(); + } + + public static com.google.cloud.dialogflow.v2.TelephonyDtmfEvents getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TelephonyDtmfEvents parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + 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.dialogflow.v2.TelephonyDtmfEvents getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEventsOrBuilder.java b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEventsOrBuilder.java new file mode 100644 index 000000000000..b3204c9f8500 --- /dev/null +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/java/com/google/cloud/dialogflow/v2/TelephonyDtmfEventsOrBuilder.java @@ -0,0 +1,88 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/dialogflow/v2/audio_config.proto + +package com.google.cloud.dialogflow.v2; + +public interface TelephonyDtmfEventsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2.TelephonyDtmfEvents) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return A list containing the dtmfEvents. + */ + java.util.List getDtmfEventsList(); + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return The count of dtmfEvents. + */ + int getDtmfEventsCount(); + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index of the element to return. + * @return The dtmfEvents at the given index. + */ + com.google.cloud.dialogflow.v2.TelephonyDtmf getDtmfEvents(int index); + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @return A list containing the enum numeric values on the wire for dtmfEvents. + */ + java.util.List getDtmfEventsValueList(); + /** + * + * + *
+   * A sequence of TelephonyDtmf digits.
+   * 
+ * + * repeated .google.cloud.dialogflow.v2.TelephonyDtmf dtmf_events = 1; + * + * @param index The index of the value to return. + * @return The enum numeric value on the wire of dtmfEvents at the given index. + */ + int getDtmfEventsValue(int index); +} diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto index 98258ee230bd..b86a9d3a1d45 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/audio_config.proto @@ -369,6 +369,67 @@ message OutputAudioConfig { SynthesizeSpeechConfig synthesize_speech_config = 3; } +// [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) +// digit in Telephony Gateway. +enum TelephonyDtmf { + // Not specified. This value may be used to indicate an absent digit. + TELEPHONY_DTMF_UNSPECIFIED = 0; + + // Number: '1'. + DTMF_ONE = 1; + + // Number: '2'. + DTMF_TWO = 2; + + // Number: '3'. + DTMF_THREE = 3; + + // Number: '4'. + DTMF_FOUR = 4; + + // Number: '5'. + DTMF_FIVE = 5; + + // Number: '6'. + DTMF_SIX = 6; + + // Number: '7'. + DTMF_SEVEN = 7; + + // Number: '8'. + DTMF_EIGHT = 8; + + // Number: '9'. + DTMF_NINE = 9; + + // Number: '0'. + DTMF_ZERO = 10; + + // Letter: 'A'. + DTMF_A = 11; + + // Letter: 'B'. + DTMF_B = 12; + + // Letter: 'C'. + DTMF_C = 13; + + // Letter: 'D'. + DTMF_D = 14; + + // Asterisk/star: '*'. + DTMF_STAR = 15; + + // Pound/diamond/hash/square/gate/octothorpe: '#'. + DTMF_POUND = 16; +} + +// A wrapper of repeated TelephonyDtmf digits. +message TelephonyDtmfEvents { + // A sequence of TelephonyDtmf digits. + repeated TelephonyDtmf dtmf_events = 1; +} + // Configures speech transcription for [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]. message SpeechToTextConfig { // The speech model used in speech to text. @@ -379,4 +440,13 @@ message SpeechToTextConfig { // version of the specified model for the language does not exist, then it // would emit an error. SpeechModelVariant speech_model_variant = 1; + + // Which Speech model to select. Select the model best suited to your domain + // to get best results. If a model is not explicitly specified, then a default + // model is used. + // Refer to + // [Cloud Speech API + // documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + // for more details. + string model = 2; } diff --git a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto index 35b6106e35dd..a39d49fb5278 100644 --- a/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto +++ b/java-dialogflow/proto-google-cloud-dialogflow-v2/src/main/proto/google/cloud/dialogflow/v2/participant.proto @@ -109,6 +109,24 @@ service Participants { option (google.api.method_signature) = "participant,event_input"; } + // Adds a text (chat, for example), or audio (phone recording, for example) + // message from a participant into the conversation. + // Note: This method is only available through the gRPC API (not REST). + // + // The top-level message sent to the client by the server is + // `StreamingAnalyzeContentResponse`. Multiple response messages can be + // returned in order. The first one or more messages contain the + // `recognition_result` field. Each result represents a more complete + // transcript of what the user said. The next message contains the + // `reply_text` field and potentially the `reply_audio` field. The message can + // also contain the `automated_agent_reply` field. + // + // Note: Always use agent versions for production traffic + // sent to virtual agents. See [Versions and + // environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + rpc StreamingAnalyzeContent(stream StreamingAnalyzeContentRequest) returns (stream StreamingAnalyzeContentResponse) { + } + // Gets suggested articles for a participant based on specific historical // messages. rpc SuggestArticles(SuggestArticlesRequest) returns (SuggestArticlesResponse) { @@ -190,6 +208,36 @@ message Participant { // media stream to this participant. This field can be updated. string sip_recording_media_label = 6 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Obfuscated user id that should be associated with the created participant. + // + // You can specify a user id as follows: + // + // 1. If you set this field in + // [CreateParticipantRequest][google.cloud.dialogflow.v2.CreateParticipantRequest.participant] or + // [UpdateParticipantRequest][google.cloud.dialogflow.v2.UpdateParticipantRequest.participant], + // Dialogflow adds the obfuscated user id with the participant. + // + // 2. If you set this field in + // [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or + // [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + // Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2.Participant.obfuscated_external_user_id]. + // + // Dialogflow returns an error if you try to add a user id for a + // non-[END_USER][google.cloud.dialogflow.v2.Participant.Role.END_USER] participant. + // + // Dialogflow uses this user id for billing and measurement purposes. For + // example, Dialogflow determines whether a user in one conversation returned + // in a later conversation. + // + // Note: + // + // * Please never pass raw user ids to Dialogflow. Always obfuscate your user + // id first. + // * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + // hash function like SHA-512. + // * The length of the user id must be <= 256 characters. + string obfuscated_external_user_id = 7 [(google.api.field_behavior) = OPTIONAL]; + // Optional. Key-value filters on the metadata of documents returned by article // suggestion. If specified, article suggestion only returns suggested // documents that match all filters in their [Document.metadata][google.cloud.dialogflow.v2.Document.metadata]. Multiple @@ -425,6 +473,171 @@ message AnalyzeContentResponse { DtmfParameters dtmf_parameters = 9; } +// The top-level message sent by the client to the +// [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [participant][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant], +// [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] and optionally +// [query_params][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.query_params]. If you want +// to receive an audio response, it should also contain +// [reply_audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.reply_audio_config]. +// The message must not contain +// [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input]. +// +// 2. If [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message +// was set to [audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.audio_config], +// all subsequent messages must contain +// [input_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_audio] to continue +// with Speech recognition. +// However, note that: +// +// * Dialogflow will bill you for the audio so far. +// * Dialogflow discards all Speech recognition results in favor of the +// text input. +// +// 3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message was set +// to [StreamingAnalyzeContentRequest.text_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.text_config], then the second message +// must contain only [input_text][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_text]. +// Moreover, you must not send more than two messages. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingAnalyzeContentRequest { + // Required. The name of the participant this text comes from. + // Format: `projects//locations//conversations//participants/`. + string participant = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // The input config. + oneof config { + // Instructs the speech recognizer how to process the speech audio. + InputAudioConfig audio_config = 2; + + // The natural language text to be processed. + InputTextConfig text_config = 3; + } + + // Speech synthesis configuration. + // The speech synthesis settings for a virtual agent that may be configured + // for the associated conversation profile are not used when calling + // StreamingAnalyzeContent. If this configuration is not supplied, speech + // synthesis is disabled. + OutputAudioConfig reply_audio_config = 4; + + // The input. + oneof input { + // The input audio content to be recognized. Must be sent if `audio_config` + // is set in the first message. The complete audio over all streaming + // messages must not exceed 1 minute. + bytes input_audio = 5; + + // The UTF-8 encoded natural language text to be processed. Must be sent if + // `text_config` is set in the first message. Text length must not exceed + // 256 bytes for virtual agent interactions. The `input_text` field can be + // only sent once. + string input_text = 6; + + // The DTMF digits used to invoke intent and fill in parameter value. + // + // This input is ignored if the previous response indicated that DTMF input + // is not accepted. + TelephonyDtmfEvents input_dtmf = 9; + } + + // Parameters for a Dialogflow virtual-agent query. + QueryParameters query_params = 7; + + // Parameters for a human assist query. + AssistQueryParameters assist_query_params = 8; + + // Additional parameters to be put into Dialogflow CX session parameters. To + // remove a parameter from the session, clients should explicitly set the + // parameter value to null. + // + // Note: this field should only be used if you are connecting to a Dialogflow + // CX agent. + google.protobuf.Struct cx_parameters = 13; + + // Enable partial virtual agent responses. If this flag is not enabled, + // response stream still contains only one final response even if some + // `Fulfillment`s in Dialogflow virtual agent have been configured to return + // partial responses. + bool enable_partial_automated_agent_reply = 12; +} + +// The top-level message returned from the `StreamingAnalyzeContent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. In virtual agent stage: if `enable_partial_automated_agent_reply` is +// true, the following N (currently 1 <= N <= 4) messages +// contain `automated_agent_reply` and optionally `reply_audio` +// returned by the virtual agent. The first (N-1) +// `automated_agent_reply`s will have `automated_agent_reply_type` set to +// `PARTIAL`. The last `automated_agent_reply` has +// `automated_agent_reply_type` set to `FINAL`. +// If `enable_partial_automated_agent_reply` is not enabled, response stream +// only contains the final reply. +// +// In human assist stage: the following N (N >= 1) messages contain +// `human_agent_suggestion_results`, `end_user_suggestion_results` or +// `message`. +message StreamingAnalyzeContentResponse { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // The output text content. + // This field is set if an automated agent responded with a text for the user. + string reply_text = 2; + + // The audio data bytes encoded as specified in the request. + // This field is set if: + // + // - The `reply_audio_config` field is specified in the request. + // - The automated agent, which this output comes from, responded with audio. + // In such case, the `reply_audio.config` field contains settings used to + // synthesize the speech. + // + // In some scenarios, multiple output audio fields may be present in the + // response structure. In these cases, only the top-most-level audio output + // has content. + OutputAudio reply_audio = 3; + + // Only set if a Dialogflow automated agent has responded. + // Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] + // and [AutomatedAgentReply.detect_intent_response.output_audio_config][] + // are always empty, use [reply_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead. + AutomatedAgentReply automated_agent_reply = 4; + + // Message analyzed by CCAI. + Message message = 6; + + // The suggestions for most recent human agent. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + repeated SuggestionResult human_agent_suggestion_results = 7; + + // The suggestions for end user. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + repeated SuggestionResult end_user_suggestion_results = 8; + + // Indicates the parameters of DTMF. + DtmfParameters dtmf_parameters = 10; +} + // The request message for [Participants.SuggestArticles][google.cloud.dialogflow.v2.Participants.SuggestArticles]. message SuggestArticlesRequest { // Required. The name of the participant to fetch suggestion for. @@ -720,6 +933,14 @@ message SuggestionResult { } } +// Defines the language used in the input text. +message InputTextConfig { + // Required. The language of this conversational query. See [Language + // Support](https://cloud.google.com/dialogflow/docs/reference/language) + // for a list of the currently supported language codes. + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; +} + // Represents a part of a message possibly annotated with an entity. The part // can be an entity or purely a part of the message between two entities or // message start/end. diff --git a/java-dialogflow/samples/snippets/generated/com/google/cloud/dialogflow/v2/participantsclient/streaminganalyzecontent/AsyncStreamingAnalyzeContent.java b/java-dialogflow/samples/snippets/generated/com/google/cloud/dialogflow/v2/participantsclient/streaminganalyzecontent/AsyncStreamingAnalyzeContent.java new file mode 100644 index 000000000000..ec5b3637bca7 --- /dev/null +++ b/java-dialogflow/samples/snippets/generated/com/google/cloud/dialogflow/v2/participantsclient/streaminganalyzecontent/AsyncStreamingAnalyzeContent.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. + */ + +package com.google.cloud.dialogflow.v2.samples; + +// [START dialogflow_v2_generated_participantsclient_streaminganalyzecontent_async] +import com.google.api.gax.rpc.BidiStream; +import com.google.cloud.dialogflow.v2.AssistQueryParameters; +import com.google.cloud.dialogflow.v2.OutputAudioConfig; +import com.google.cloud.dialogflow.v2.ParticipantName; +import com.google.cloud.dialogflow.v2.ParticipantsClient; +import com.google.cloud.dialogflow.v2.QueryParameters; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; +import com.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; +import com.google.protobuf.Struct; + +public class AsyncStreamingAnalyzeContent { + + public static void main(String[] args) throws Exception { + asyncStreamingAnalyzeContent(); + } + + public static void asyncStreamingAnalyzeContent() 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) { + BidiStream bidiStream = + participantsClient.streamingAnalyzeContentCallable().call(); + StreamingAnalyzeContentRequest request = + StreamingAnalyzeContentRequest.newBuilder() + .setParticipant( + ParticipantName.ofProjectConversationParticipantName( + "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]") + .toString()) + .setReplyAudioConfig(OutputAudioConfig.newBuilder().build()) + .setQueryParams(QueryParameters.newBuilder().build()) + .setAssistQueryParams(AssistQueryParameters.newBuilder().build()) + .setCxParameters(Struct.newBuilder().build()) + .setEnablePartialAutomatedAgentReply(true) + .build(); + bidiStream.send(request); + for (StreamingAnalyzeContentResponse response : bidiStream) { + // Do something when a response is received. + } + } + } +} +// [END dialogflow_v2_generated_participantsclient_streaminganalyzecontent_async]