• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/cloud/dialogflow/cx/v3/session.proto
18 
19 package com.google.cloud.dialogflow.cx.v3;
20 
21 /**
22  *
23  *
24  * <pre>
25  * The message returned from the DetectIntent method.
26  * </pre>
27  *
28  * Protobuf type {@code google.cloud.dialogflow.cx.v3.DetectIntentResponse}
29  */
30 public final class DetectIntentResponse extends com.google.protobuf.GeneratedMessageV3
31     implements
32     // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3.DetectIntentResponse)
33     DetectIntentResponseOrBuilder {
34   private static final long serialVersionUID = 0L;
35   // Use DetectIntentResponse.newBuilder() to construct.
DetectIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36   private DetectIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
37     super(builder);
38   }
39 
DetectIntentResponse()40   private DetectIntentResponse() {
41     responseId_ = "";
42     outputAudio_ = com.google.protobuf.ByteString.EMPTY;
43     responseType_ = 0;
44   }
45 
46   @java.lang.Override
47   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)48   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
49     return new DetectIntentResponse();
50   }
51 
52   @java.lang.Override
getUnknownFields()53   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
54     return this.unknownFields;
55   }
56 
getDescriptor()57   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
58     return com.google.cloud.dialogflow.cx.v3.SessionProto
59         .internal_static_google_cloud_dialogflow_cx_v3_DetectIntentResponse_descriptor;
60   }
61 
62   @java.lang.Override
63   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()64       internalGetFieldAccessorTable() {
65     return com.google.cloud.dialogflow.cx.v3.SessionProto
66         .internal_static_google_cloud_dialogflow_cx_v3_DetectIntentResponse_fieldAccessorTable
67         .ensureFieldAccessorsInitialized(
68             com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.class,
69             com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder.class);
70   }
71 
72   /**
73    *
74    *
75    * <pre>
76    * Represents different DetectIntentResponse types.
77    * </pre>
78    *
79    * Protobuf enum {@code google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType}
80    */
81   public enum ResponseType implements com.google.protobuf.ProtocolMessageEnum {
82     /**
83      *
84      *
85      * <pre>
86      * Not specified. This should never happen.
87      * </pre>
88      *
89      * <code>RESPONSE_TYPE_UNSPECIFIED = 0;</code>
90      */
91     RESPONSE_TYPE_UNSPECIFIED(0),
92     /**
93      *
94      *
95      * <pre>
96      * Partial response. e.g. Aggregated responses in a Fulfillment that enables
97      * `return_partial_response` can be returned as partial response.
98      * WARNING: partial response is not eligible for barge-in.
99      * </pre>
100      *
101      * <code>PARTIAL = 1;</code>
102      */
103     PARTIAL(1),
104     /**
105      *
106      *
107      * <pre>
108      * Final response.
109      * </pre>
110      *
111      * <code>FINAL = 2;</code>
112      */
113     FINAL(2),
114     UNRECOGNIZED(-1),
115     ;
116 
117     /**
118      *
119      *
120      * <pre>
121      * Not specified. This should never happen.
122      * </pre>
123      *
124      * <code>RESPONSE_TYPE_UNSPECIFIED = 0;</code>
125      */
126     public static final int RESPONSE_TYPE_UNSPECIFIED_VALUE = 0;
127     /**
128      *
129      *
130      * <pre>
131      * Partial response. e.g. Aggregated responses in a Fulfillment that enables
132      * `return_partial_response` can be returned as partial response.
133      * WARNING: partial response is not eligible for barge-in.
134      * </pre>
135      *
136      * <code>PARTIAL = 1;</code>
137      */
138     public static final int PARTIAL_VALUE = 1;
139     /**
140      *
141      *
142      * <pre>
143      * Final response.
144      * </pre>
145      *
146      * <code>FINAL = 2;</code>
147      */
148     public static final int FINAL_VALUE = 2;
149 
getNumber()150     public final int getNumber() {
151       if (this == UNRECOGNIZED) {
152         throw new java.lang.IllegalArgumentException(
153             "Can't get the number of an unknown enum value.");
154       }
155       return value;
156     }
157 
158     /**
159      * @param value The numeric wire value of the corresponding enum entry.
160      * @return The enum associated with the given numeric wire value.
161      * @deprecated Use {@link #forNumber(int)} instead.
162      */
163     @java.lang.Deprecated
valueOf(int value)164     public static ResponseType valueOf(int value) {
165       return forNumber(value);
166     }
167 
168     /**
169      * @param value The numeric wire value of the corresponding enum entry.
170      * @return The enum associated with the given numeric wire value.
171      */
forNumber(int value)172     public static ResponseType forNumber(int value) {
173       switch (value) {
174         case 0:
175           return RESPONSE_TYPE_UNSPECIFIED;
176         case 1:
177           return PARTIAL;
178         case 2:
179           return FINAL;
180         default:
181           return null;
182       }
183     }
184 
internalGetValueMap()185     public static com.google.protobuf.Internal.EnumLiteMap<ResponseType> internalGetValueMap() {
186       return internalValueMap;
187     }
188 
189     private static final com.google.protobuf.Internal.EnumLiteMap<ResponseType> internalValueMap =
190         new com.google.protobuf.Internal.EnumLiteMap<ResponseType>() {
191           public ResponseType findValueByNumber(int number) {
192             return ResponseType.forNumber(number);
193           }
194         };
195 
getValueDescriptor()196     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
197       if (this == UNRECOGNIZED) {
198         throw new java.lang.IllegalStateException(
199             "Can't get the descriptor of an unrecognized enum value.");
200       }
201       return getDescriptor().getValues().get(ordinal());
202     }
203 
getDescriptorForType()204     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
205       return getDescriptor();
206     }
207 
getDescriptor()208     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
209       return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDescriptor()
210           .getEnumTypes()
211           .get(0);
212     }
213 
214     private static final ResponseType[] VALUES = values();
215 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)216     public static ResponseType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
217       if (desc.getType() != getDescriptor()) {
218         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
219       }
220       if (desc.getIndex() == -1) {
221         return UNRECOGNIZED;
222       }
223       return VALUES[desc.getIndex()];
224     }
225 
226     private final int value;
227 
ResponseType(int value)228     private ResponseType(int value) {
229       this.value = value;
230     }
231 
232     // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType)
233   }
234 
235   public static final int RESPONSE_ID_FIELD_NUMBER = 1;
236 
237   @SuppressWarnings("serial")
238   private volatile java.lang.Object responseId_ = "";
239   /**
240    *
241    *
242    * <pre>
243    * Output only. The unique identifier of the response. It can be used to
244    * locate a response in the training example set or for reporting issues.
245    * </pre>
246    *
247    * <code>string response_id = 1;</code>
248    *
249    * @return The responseId.
250    */
251   @java.lang.Override
getResponseId()252   public java.lang.String getResponseId() {
253     java.lang.Object ref = responseId_;
254     if (ref instanceof java.lang.String) {
255       return (java.lang.String) ref;
256     } else {
257       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
258       java.lang.String s = bs.toStringUtf8();
259       responseId_ = s;
260       return s;
261     }
262   }
263   /**
264    *
265    *
266    * <pre>
267    * Output only. The unique identifier of the response. It can be used to
268    * locate a response in the training example set or for reporting issues.
269    * </pre>
270    *
271    * <code>string response_id = 1;</code>
272    *
273    * @return The bytes for responseId.
274    */
275   @java.lang.Override
getResponseIdBytes()276   public com.google.protobuf.ByteString getResponseIdBytes() {
277     java.lang.Object ref = responseId_;
278     if (ref instanceof java.lang.String) {
279       com.google.protobuf.ByteString b =
280           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
281       responseId_ = b;
282       return b;
283     } else {
284       return (com.google.protobuf.ByteString) ref;
285     }
286   }
287 
288   public static final int QUERY_RESULT_FIELD_NUMBER = 2;
289   private com.google.cloud.dialogflow.cx.v3.QueryResult queryResult_;
290   /**
291    *
292    *
293    * <pre>
294    * The result of the conversational query.
295    * </pre>
296    *
297    * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
298    *
299    * @return Whether the queryResult field is set.
300    */
301   @java.lang.Override
hasQueryResult()302   public boolean hasQueryResult() {
303     return queryResult_ != null;
304   }
305   /**
306    *
307    *
308    * <pre>
309    * The result of the conversational query.
310    * </pre>
311    *
312    * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
313    *
314    * @return The queryResult.
315    */
316   @java.lang.Override
getQueryResult()317   public com.google.cloud.dialogflow.cx.v3.QueryResult getQueryResult() {
318     return queryResult_ == null
319         ? com.google.cloud.dialogflow.cx.v3.QueryResult.getDefaultInstance()
320         : queryResult_;
321   }
322   /**
323    *
324    *
325    * <pre>
326    * The result of the conversational query.
327    * </pre>
328    *
329    * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
330    */
331   @java.lang.Override
getQueryResultOrBuilder()332   public com.google.cloud.dialogflow.cx.v3.QueryResultOrBuilder getQueryResultOrBuilder() {
333     return queryResult_ == null
334         ? com.google.cloud.dialogflow.cx.v3.QueryResult.getDefaultInstance()
335         : queryResult_;
336   }
337 
338   public static final int OUTPUT_AUDIO_FIELD_NUMBER = 4;
339   private com.google.protobuf.ByteString outputAudio_ = com.google.protobuf.ByteString.EMPTY;
340   /**
341    *
342    *
343    * <pre>
344    * The audio data bytes encoded as specified in the request.
345    * Note: The output audio is generated based on the values of default platform
346    * text responses found in the
347    * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages]
348    * field. If multiple default text responses exist, they will be concatenated
349    * when generating audio. If no default platform text responses exist, the
350    * generated audio content will be empty.
351    * In some scenarios, multiple output audio fields may be present in the
352    * response structure. In these cases, only the top-most-level audio output
353    * has content.
354    * </pre>
355    *
356    * <code>bytes output_audio = 4;</code>
357    *
358    * @return The outputAudio.
359    */
360   @java.lang.Override
getOutputAudio()361   public com.google.protobuf.ByteString getOutputAudio() {
362     return outputAudio_;
363   }
364 
365   public static final int OUTPUT_AUDIO_CONFIG_FIELD_NUMBER = 5;
366   private com.google.cloud.dialogflow.cx.v3.OutputAudioConfig outputAudioConfig_;
367   /**
368    *
369    *
370    * <pre>
371    * The config used by the speech synthesizer to generate the output audio.
372    * </pre>
373    *
374    * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
375    *
376    * @return Whether the outputAudioConfig field is set.
377    */
378   @java.lang.Override
hasOutputAudioConfig()379   public boolean hasOutputAudioConfig() {
380     return outputAudioConfig_ != null;
381   }
382   /**
383    *
384    *
385    * <pre>
386    * The config used by the speech synthesizer to generate the output audio.
387    * </pre>
388    *
389    * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
390    *
391    * @return The outputAudioConfig.
392    */
393   @java.lang.Override
getOutputAudioConfig()394   public com.google.cloud.dialogflow.cx.v3.OutputAudioConfig getOutputAudioConfig() {
395     return outputAudioConfig_ == null
396         ? com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.getDefaultInstance()
397         : outputAudioConfig_;
398   }
399   /**
400    *
401    *
402    * <pre>
403    * The config used by the speech synthesizer to generate the output audio.
404    * </pre>
405    *
406    * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
407    */
408   @java.lang.Override
409   public com.google.cloud.dialogflow.cx.v3.OutputAudioConfigOrBuilder
getOutputAudioConfigOrBuilder()410       getOutputAudioConfigOrBuilder() {
411     return outputAudioConfig_ == null
412         ? com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.getDefaultInstance()
413         : outputAudioConfig_;
414   }
415 
416   public static final int RESPONSE_TYPE_FIELD_NUMBER = 6;
417   private int responseType_ = 0;
418   /**
419    *
420    *
421    * <pre>
422    * Response type.
423    * </pre>
424    *
425    * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
426    * </code>
427    *
428    * @return The enum numeric value on the wire for responseType.
429    */
430   @java.lang.Override
getResponseTypeValue()431   public int getResponseTypeValue() {
432     return responseType_;
433   }
434   /**
435    *
436    *
437    * <pre>
438    * Response type.
439    * </pre>
440    *
441    * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
442    * </code>
443    *
444    * @return The responseType.
445    */
446   @java.lang.Override
getResponseType()447   public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType getResponseType() {
448     com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType result =
449         com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType.forNumber(
450             responseType_);
451     return result == null
452         ? com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType.UNRECOGNIZED
453         : result;
454   }
455 
456   public static final int ALLOW_CANCELLATION_FIELD_NUMBER = 7;
457   private boolean allowCancellation_ = false;
458   /**
459    *
460    *
461    * <pre>
462    * Indicates whether the partial response can be cancelled when a later
463    * response arrives. e.g. if the agent specified some music as partial
464    * response, it can be cancelled.
465    * </pre>
466    *
467    * <code>bool allow_cancellation = 7;</code>
468    *
469    * @return The allowCancellation.
470    */
471   @java.lang.Override
getAllowCancellation()472   public boolean getAllowCancellation() {
473     return allowCancellation_;
474   }
475 
476   private byte memoizedIsInitialized = -1;
477 
478   @java.lang.Override
isInitialized()479   public final boolean isInitialized() {
480     byte isInitialized = memoizedIsInitialized;
481     if (isInitialized == 1) return true;
482     if (isInitialized == 0) return false;
483 
484     memoizedIsInitialized = 1;
485     return true;
486   }
487 
488   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)489   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
490     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseId_)) {
491       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, responseId_);
492     }
493     if (queryResult_ != null) {
494       output.writeMessage(2, getQueryResult());
495     }
496     if (!outputAudio_.isEmpty()) {
497       output.writeBytes(4, outputAudio_);
498     }
499     if (outputAudioConfig_ != null) {
500       output.writeMessage(5, getOutputAudioConfig());
501     }
502     if (responseType_
503         != com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType
504             .RESPONSE_TYPE_UNSPECIFIED
505             .getNumber()) {
506       output.writeEnum(6, responseType_);
507     }
508     if (allowCancellation_ != false) {
509       output.writeBool(7, allowCancellation_);
510     }
511     getUnknownFields().writeTo(output);
512   }
513 
514   @java.lang.Override
getSerializedSize()515   public int getSerializedSize() {
516     int size = memoizedSize;
517     if (size != -1) return size;
518 
519     size = 0;
520     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(responseId_)) {
521       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, responseId_);
522     }
523     if (queryResult_ != null) {
524       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getQueryResult());
525     }
526     if (!outputAudio_.isEmpty()) {
527       size += com.google.protobuf.CodedOutputStream.computeBytesSize(4, outputAudio_);
528     }
529     if (outputAudioConfig_ != null) {
530       size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputAudioConfig());
531     }
532     if (responseType_
533         != com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType
534             .RESPONSE_TYPE_UNSPECIFIED
535             .getNumber()) {
536       size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, responseType_);
537     }
538     if (allowCancellation_ != false) {
539       size += com.google.protobuf.CodedOutputStream.computeBoolSize(7, allowCancellation_);
540     }
541     size += getUnknownFields().getSerializedSize();
542     memoizedSize = size;
543     return size;
544   }
545 
546   @java.lang.Override
equals(final java.lang.Object obj)547   public boolean equals(final java.lang.Object obj) {
548     if (obj == this) {
549       return true;
550     }
551     if (!(obj instanceof com.google.cloud.dialogflow.cx.v3.DetectIntentResponse)) {
552       return super.equals(obj);
553     }
554     com.google.cloud.dialogflow.cx.v3.DetectIntentResponse other =
555         (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) obj;
556 
557     if (!getResponseId().equals(other.getResponseId())) return false;
558     if (hasQueryResult() != other.hasQueryResult()) return false;
559     if (hasQueryResult()) {
560       if (!getQueryResult().equals(other.getQueryResult())) return false;
561     }
562     if (!getOutputAudio().equals(other.getOutputAudio())) return false;
563     if (hasOutputAudioConfig() != other.hasOutputAudioConfig()) return false;
564     if (hasOutputAudioConfig()) {
565       if (!getOutputAudioConfig().equals(other.getOutputAudioConfig())) return false;
566     }
567     if (responseType_ != other.responseType_) return false;
568     if (getAllowCancellation() != other.getAllowCancellation()) return false;
569     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
570     return true;
571   }
572 
573   @java.lang.Override
hashCode()574   public int hashCode() {
575     if (memoizedHashCode != 0) {
576       return memoizedHashCode;
577     }
578     int hash = 41;
579     hash = (19 * hash) + getDescriptor().hashCode();
580     hash = (37 * hash) + RESPONSE_ID_FIELD_NUMBER;
581     hash = (53 * hash) + getResponseId().hashCode();
582     if (hasQueryResult()) {
583       hash = (37 * hash) + QUERY_RESULT_FIELD_NUMBER;
584       hash = (53 * hash) + getQueryResult().hashCode();
585     }
586     hash = (37 * hash) + OUTPUT_AUDIO_FIELD_NUMBER;
587     hash = (53 * hash) + getOutputAudio().hashCode();
588     if (hasOutputAudioConfig()) {
589       hash = (37 * hash) + OUTPUT_AUDIO_CONFIG_FIELD_NUMBER;
590       hash = (53 * hash) + getOutputAudioConfig().hashCode();
591     }
592     hash = (37 * hash) + RESPONSE_TYPE_FIELD_NUMBER;
593     hash = (53 * hash) + responseType_;
594     hash = (37 * hash) + ALLOW_CANCELLATION_FIELD_NUMBER;
595     hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowCancellation());
596     hash = (29 * hash) + getUnknownFields().hashCode();
597     memoizedHashCode = hash;
598     return hash;
599   }
600 
parseFrom( java.nio.ByteBuffer data)601   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
602       java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
603     return PARSER.parseFrom(data);
604   }
605 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)606   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
607       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
608       throws com.google.protobuf.InvalidProtocolBufferException {
609     return PARSER.parseFrom(data, extensionRegistry);
610   }
611 
parseFrom( com.google.protobuf.ByteString data)612   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
613       com.google.protobuf.ByteString data)
614       throws com.google.protobuf.InvalidProtocolBufferException {
615     return PARSER.parseFrom(data);
616   }
617 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)618   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
619       com.google.protobuf.ByteString data,
620       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
621       throws com.google.protobuf.InvalidProtocolBufferException {
622     return PARSER.parseFrom(data, extensionRegistry);
623   }
624 
parseFrom(byte[] data)625   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(byte[] data)
626       throws com.google.protobuf.InvalidProtocolBufferException {
627     return PARSER.parseFrom(data);
628   }
629 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)630   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
631       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
632       throws com.google.protobuf.InvalidProtocolBufferException {
633     return PARSER.parseFrom(data, extensionRegistry);
634   }
635 
parseFrom( java.io.InputStream input)636   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
637       java.io.InputStream input) throws java.io.IOException {
638     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
639   }
640 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)641   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
642       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
643       throws java.io.IOException {
644     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
645         PARSER, input, extensionRegistry);
646   }
647 
parseDelimitedFrom( java.io.InputStream input)648   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseDelimitedFrom(
649       java.io.InputStream input) throws java.io.IOException {
650     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
651   }
652 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)653   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseDelimitedFrom(
654       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
655       throws java.io.IOException {
656     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
657         PARSER, input, extensionRegistry);
658   }
659 
parseFrom( com.google.protobuf.CodedInputStream input)660   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
661       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
662     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
663   }
664 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)665   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse parseFrom(
666       com.google.protobuf.CodedInputStream input,
667       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
668       throws java.io.IOException {
669     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
670         PARSER, input, extensionRegistry);
671   }
672 
673   @java.lang.Override
newBuilderForType()674   public Builder newBuilderForType() {
675     return newBuilder();
676   }
677 
newBuilder()678   public static Builder newBuilder() {
679     return DEFAULT_INSTANCE.toBuilder();
680   }
681 
newBuilder( com.google.cloud.dialogflow.cx.v3.DetectIntentResponse prototype)682   public static Builder newBuilder(
683       com.google.cloud.dialogflow.cx.v3.DetectIntentResponse prototype) {
684     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
685   }
686 
687   @java.lang.Override
toBuilder()688   public Builder toBuilder() {
689     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
690   }
691 
692   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)693   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
694     Builder builder = new Builder(parent);
695     return builder;
696   }
697   /**
698    *
699    *
700    * <pre>
701    * The message returned from the DetectIntent method.
702    * </pre>
703    *
704    * Protobuf type {@code google.cloud.dialogflow.cx.v3.DetectIntentResponse}
705    */
706   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
707       implements
708       // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3.DetectIntentResponse)
709       com.google.cloud.dialogflow.cx.v3.DetectIntentResponseOrBuilder {
getDescriptor()710     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
711       return com.google.cloud.dialogflow.cx.v3.SessionProto
712           .internal_static_google_cloud_dialogflow_cx_v3_DetectIntentResponse_descriptor;
713     }
714 
715     @java.lang.Override
716     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()717         internalGetFieldAccessorTable() {
718       return com.google.cloud.dialogflow.cx.v3.SessionProto
719           .internal_static_google_cloud_dialogflow_cx_v3_DetectIntentResponse_fieldAccessorTable
720           .ensureFieldAccessorsInitialized(
721               com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.class,
722               com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder.class);
723     }
724 
725     // Construct using com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.newBuilder()
Builder()726     private Builder() {}
727 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)728     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
729       super(parent);
730     }
731 
732     @java.lang.Override
clear()733     public Builder clear() {
734       super.clear();
735       bitField0_ = 0;
736       responseId_ = "";
737       queryResult_ = null;
738       if (queryResultBuilder_ != null) {
739         queryResultBuilder_.dispose();
740         queryResultBuilder_ = null;
741       }
742       outputAudio_ = com.google.protobuf.ByteString.EMPTY;
743       outputAudioConfig_ = null;
744       if (outputAudioConfigBuilder_ != null) {
745         outputAudioConfigBuilder_.dispose();
746         outputAudioConfigBuilder_ = null;
747       }
748       responseType_ = 0;
749       allowCancellation_ = false;
750       return this;
751     }
752 
753     @java.lang.Override
getDescriptorForType()754     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
755       return com.google.cloud.dialogflow.cx.v3.SessionProto
756           .internal_static_google_cloud_dialogflow_cx_v3_DetectIntentResponse_descriptor;
757     }
758 
759     @java.lang.Override
getDefaultInstanceForType()760     public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse getDefaultInstanceForType() {
761       return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
762     }
763 
764     @java.lang.Override
build()765     public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse build() {
766       com.google.cloud.dialogflow.cx.v3.DetectIntentResponse result = buildPartial();
767       if (!result.isInitialized()) {
768         throw newUninitializedMessageException(result);
769       }
770       return result;
771     }
772 
773     @java.lang.Override
buildPartial()774     public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse buildPartial() {
775       com.google.cloud.dialogflow.cx.v3.DetectIntentResponse result =
776           new com.google.cloud.dialogflow.cx.v3.DetectIntentResponse(this);
777       if (bitField0_ != 0) {
778         buildPartial0(result);
779       }
780       onBuilt();
781       return result;
782     }
783 
buildPartial0(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse result)784     private void buildPartial0(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse result) {
785       int from_bitField0_ = bitField0_;
786       if (((from_bitField0_ & 0x00000001) != 0)) {
787         result.responseId_ = responseId_;
788       }
789       if (((from_bitField0_ & 0x00000002) != 0)) {
790         result.queryResult_ =
791             queryResultBuilder_ == null ? queryResult_ : queryResultBuilder_.build();
792       }
793       if (((from_bitField0_ & 0x00000004) != 0)) {
794         result.outputAudio_ = outputAudio_;
795       }
796       if (((from_bitField0_ & 0x00000008) != 0)) {
797         result.outputAudioConfig_ =
798             outputAudioConfigBuilder_ == null
799                 ? outputAudioConfig_
800                 : outputAudioConfigBuilder_.build();
801       }
802       if (((from_bitField0_ & 0x00000010) != 0)) {
803         result.responseType_ = responseType_;
804       }
805       if (((from_bitField0_ & 0x00000020) != 0)) {
806         result.allowCancellation_ = allowCancellation_;
807       }
808     }
809 
810     @java.lang.Override
clone()811     public Builder clone() {
812       return super.clone();
813     }
814 
815     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)816     public Builder setField(
817         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
818       return super.setField(field, value);
819     }
820 
821     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)822     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
823       return super.clearField(field);
824     }
825 
826     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)827     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
828       return super.clearOneof(oneof);
829     }
830 
831     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)832     public Builder setRepeatedField(
833         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
834       return super.setRepeatedField(field, index, value);
835     }
836 
837     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)838     public Builder addRepeatedField(
839         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
840       return super.addRepeatedField(field, value);
841     }
842 
843     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)844     public Builder mergeFrom(com.google.protobuf.Message other) {
845       if (other instanceof com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) {
846         return mergeFrom((com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) other);
847       } else {
848         super.mergeFrom(other);
849         return this;
850       }
851     }
852 
mergeFrom(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse other)853     public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse other) {
854       if (other == com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance())
855         return this;
856       if (!other.getResponseId().isEmpty()) {
857         responseId_ = other.responseId_;
858         bitField0_ |= 0x00000001;
859         onChanged();
860       }
861       if (other.hasQueryResult()) {
862         mergeQueryResult(other.getQueryResult());
863       }
864       if (other.getOutputAudio() != com.google.protobuf.ByteString.EMPTY) {
865         setOutputAudio(other.getOutputAudio());
866       }
867       if (other.hasOutputAudioConfig()) {
868         mergeOutputAudioConfig(other.getOutputAudioConfig());
869       }
870       if (other.responseType_ != 0) {
871         setResponseTypeValue(other.getResponseTypeValue());
872       }
873       if (other.getAllowCancellation() != false) {
874         setAllowCancellation(other.getAllowCancellation());
875       }
876       this.mergeUnknownFields(other.getUnknownFields());
877       onChanged();
878       return this;
879     }
880 
881     @java.lang.Override
isInitialized()882     public final boolean isInitialized() {
883       return true;
884     }
885 
886     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)887     public Builder mergeFrom(
888         com.google.protobuf.CodedInputStream input,
889         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
890         throws java.io.IOException {
891       if (extensionRegistry == null) {
892         throw new java.lang.NullPointerException();
893       }
894       try {
895         boolean done = false;
896         while (!done) {
897           int tag = input.readTag();
898           switch (tag) {
899             case 0:
900               done = true;
901               break;
902             case 10:
903               {
904                 responseId_ = input.readStringRequireUtf8();
905                 bitField0_ |= 0x00000001;
906                 break;
907               } // case 10
908             case 18:
909               {
910                 input.readMessage(getQueryResultFieldBuilder().getBuilder(), extensionRegistry);
911                 bitField0_ |= 0x00000002;
912                 break;
913               } // case 18
914             case 34:
915               {
916                 outputAudio_ = input.readBytes();
917                 bitField0_ |= 0x00000004;
918                 break;
919               } // case 34
920             case 42:
921               {
922                 input.readMessage(
923                     getOutputAudioConfigFieldBuilder().getBuilder(), extensionRegistry);
924                 bitField0_ |= 0x00000008;
925                 break;
926               } // case 42
927             case 48:
928               {
929                 responseType_ = input.readEnum();
930                 bitField0_ |= 0x00000010;
931                 break;
932               } // case 48
933             case 56:
934               {
935                 allowCancellation_ = input.readBool();
936                 bitField0_ |= 0x00000020;
937                 break;
938               } // case 56
939             default:
940               {
941                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
942                   done = true; // was an endgroup tag
943                 }
944                 break;
945               } // default:
946           } // switch (tag)
947         } // while (!done)
948       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
949         throw e.unwrapIOException();
950       } finally {
951         onChanged();
952       } // finally
953       return this;
954     }
955 
956     private int bitField0_;
957 
958     private java.lang.Object responseId_ = "";
959     /**
960      *
961      *
962      * <pre>
963      * Output only. The unique identifier of the response. It can be used to
964      * locate a response in the training example set or for reporting issues.
965      * </pre>
966      *
967      * <code>string response_id = 1;</code>
968      *
969      * @return The responseId.
970      */
getResponseId()971     public java.lang.String getResponseId() {
972       java.lang.Object ref = responseId_;
973       if (!(ref instanceof java.lang.String)) {
974         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
975         java.lang.String s = bs.toStringUtf8();
976         responseId_ = s;
977         return s;
978       } else {
979         return (java.lang.String) ref;
980       }
981     }
982     /**
983      *
984      *
985      * <pre>
986      * Output only. The unique identifier of the response. It can be used to
987      * locate a response in the training example set or for reporting issues.
988      * </pre>
989      *
990      * <code>string response_id = 1;</code>
991      *
992      * @return The bytes for responseId.
993      */
getResponseIdBytes()994     public com.google.protobuf.ByteString getResponseIdBytes() {
995       java.lang.Object ref = responseId_;
996       if (ref instanceof String) {
997         com.google.protobuf.ByteString b =
998             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
999         responseId_ = b;
1000         return b;
1001       } else {
1002         return (com.google.protobuf.ByteString) ref;
1003       }
1004     }
1005     /**
1006      *
1007      *
1008      * <pre>
1009      * Output only. The unique identifier of the response. It can be used to
1010      * locate a response in the training example set or for reporting issues.
1011      * </pre>
1012      *
1013      * <code>string response_id = 1;</code>
1014      *
1015      * @param value The responseId to set.
1016      * @return This builder for chaining.
1017      */
setResponseId(java.lang.String value)1018     public Builder setResponseId(java.lang.String value) {
1019       if (value == null) {
1020         throw new NullPointerException();
1021       }
1022       responseId_ = value;
1023       bitField0_ |= 0x00000001;
1024       onChanged();
1025       return this;
1026     }
1027     /**
1028      *
1029      *
1030      * <pre>
1031      * Output only. The unique identifier of the response. It can be used to
1032      * locate a response in the training example set or for reporting issues.
1033      * </pre>
1034      *
1035      * <code>string response_id = 1;</code>
1036      *
1037      * @return This builder for chaining.
1038      */
clearResponseId()1039     public Builder clearResponseId() {
1040       responseId_ = getDefaultInstance().getResponseId();
1041       bitField0_ = (bitField0_ & ~0x00000001);
1042       onChanged();
1043       return this;
1044     }
1045     /**
1046      *
1047      *
1048      * <pre>
1049      * Output only. The unique identifier of the response. It can be used to
1050      * locate a response in the training example set or for reporting issues.
1051      * </pre>
1052      *
1053      * <code>string response_id = 1;</code>
1054      *
1055      * @param value The bytes for responseId to set.
1056      * @return This builder for chaining.
1057      */
setResponseIdBytes(com.google.protobuf.ByteString value)1058     public Builder setResponseIdBytes(com.google.protobuf.ByteString value) {
1059       if (value == null) {
1060         throw new NullPointerException();
1061       }
1062       checkByteStringIsUtf8(value);
1063       responseId_ = value;
1064       bitField0_ |= 0x00000001;
1065       onChanged();
1066       return this;
1067     }
1068 
1069     private com.google.cloud.dialogflow.cx.v3.QueryResult queryResult_;
1070     private com.google.protobuf.SingleFieldBuilderV3<
1071             com.google.cloud.dialogflow.cx.v3.QueryResult,
1072             com.google.cloud.dialogflow.cx.v3.QueryResult.Builder,
1073             com.google.cloud.dialogflow.cx.v3.QueryResultOrBuilder>
1074         queryResultBuilder_;
1075     /**
1076      *
1077      *
1078      * <pre>
1079      * The result of the conversational query.
1080      * </pre>
1081      *
1082      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1083      *
1084      * @return Whether the queryResult field is set.
1085      */
hasQueryResult()1086     public boolean hasQueryResult() {
1087       return ((bitField0_ & 0x00000002) != 0);
1088     }
1089     /**
1090      *
1091      *
1092      * <pre>
1093      * The result of the conversational query.
1094      * </pre>
1095      *
1096      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1097      *
1098      * @return The queryResult.
1099      */
getQueryResult()1100     public com.google.cloud.dialogflow.cx.v3.QueryResult getQueryResult() {
1101       if (queryResultBuilder_ == null) {
1102         return queryResult_ == null
1103             ? com.google.cloud.dialogflow.cx.v3.QueryResult.getDefaultInstance()
1104             : queryResult_;
1105       } else {
1106         return queryResultBuilder_.getMessage();
1107       }
1108     }
1109     /**
1110      *
1111      *
1112      * <pre>
1113      * The result of the conversational query.
1114      * </pre>
1115      *
1116      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1117      */
setQueryResult(com.google.cloud.dialogflow.cx.v3.QueryResult value)1118     public Builder setQueryResult(com.google.cloud.dialogflow.cx.v3.QueryResult value) {
1119       if (queryResultBuilder_ == null) {
1120         if (value == null) {
1121           throw new NullPointerException();
1122         }
1123         queryResult_ = value;
1124       } else {
1125         queryResultBuilder_.setMessage(value);
1126       }
1127       bitField0_ |= 0x00000002;
1128       onChanged();
1129       return this;
1130     }
1131     /**
1132      *
1133      *
1134      * <pre>
1135      * The result of the conversational query.
1136      * </pre>
1137      *
1138      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1139      */
setQueryResult( com.google.cloud.dialogflow.cx.v3.QueryResult.Builder builderForValue)1140     public Builder setQueryResult(
1141         com.google.cloud.dialogflow.cx.v3.QueryResult.Builder builderForValue) {
1142       if (queryResultBuilder_ == null) {
1143         queryResult_ = builderForValue.build();
1144       } else {
1145         queryResultBuilder_.setMessage(builderForValue.build());
1146       }
1147       bitField0_ |= 0x00000002;
1148       onChanged();
1149       return this;
1150     }
1151     /**
1152      *
1153      *
1154      * <pre>
1155      * The result of the conversational query.
1156      * </pre>
1157      *
1158      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1159      */
mergeQueryResult(com.google.cloud.dialogflow.cx.v3.QueryResult value)1160     public Builder mergeQueryResult(com.google.cloud.dialogflow.cx.v3.QueryResult value) {
1161       if (queryResultBuilder_ == null) {
1162         if (((bitField0_ & 0x00000002) != 0)
1163             && queryResult_ != null
1164             && queryResult_ != com.google.cloud.dialogflow.cx.v3.QueryResult.getDefaultInstance()) {
1165           getQueryResultBuilder().mergeFrom(value);
1166         } else {
1167           queryResult_ = value;
1168         }
1169       } else {
1170         queryResultBuilder_.mergeFrom(value);
1171       }
1172       bitField0_ |= 0x00000002;
1173       onChanged();
1174       return this;
1175     }
1176     /**
1177      *
1178      *
1179      * <pre>
1180      * The result of the conversational query.
1181      * </pre>
1182      *
1183      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1184      */
clearQueryResult()1185     public Builder clearQueryResult() {
1186       bitField0_ = (bitField0_ & ~0x00000002);
1187       queryResult_ = null;
1188       if (queryResultBuilder_ != null) {
1189         queryResultBuilder_.dispose();
1190         queryResultBuilder_ = null;
1191       }
1192       onChanged();
1193       return this;
1194     }
1195     /**
1196      *
1197      *
1198      * <pre>
1199      * The result of the conversational query.
1200      * </pre>
1201      *
1202      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1203      */
getQueryResultBuilder()1204     public com.google.cloud.dialogflow.cx.v3.QueryResult.Builder getQueryResultBuilder() {
1205       bitField0_ |= 0x00000002;
1206       onChanged();
1207       return getQueryResultFieldBuilder().getBuilder();
1208     }
1209     /**
1210      *
1211      *
1212      * <pre>
1213      * The result of the conversational query.
1214      * </pre>
1215      *
1216      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1217      */
getQueryResultOrBuilder()1218     public com.google.cloud.dialogflow.cx.v3.QueryResultOrBuilder getQueryResultOrBuilder() {
1219       if (queryResultBuilder_ != null) {
1220         return queryResultBuilder_.getMessageOrBuilder();
1221       } else {
1222         return queryResult_ == null
1223             ? com.google.cloud.dialogflow.cx.v3.QueryResult.getDefaultInstance()
1224             : queryResult_;
1225       }
1226     }
1227     /**
1228      *
1229      *
1230      * <pre>
1231      * The result of the conversational query.
1232      * </pre>
1233      *
1234      * <code>.google.cloud.dialogflow.cx.v3.QueryResult query_result = 2;</code>
1235      */
1236     private com.google.protobuf.SingleFieldBuilderV3<
1237             com.google.cloud.dialogflow.cx.v3.QueryResult,
1238             com.google.cloud.dialogflow.cx.v3.QueryResult.Builder,
1239             com.google.cloud.dialogflow.cx.v3.QueryResultOrBuilder>
getQueryResultFieldBuilder()1240         getQueryResultFieldBuilder() {
1241       if (queryResultBuilder_ == null) {
1242         queryResultBuilder_ =
1243             new com.google.protobuf.SingleFieldBuilderV3<
1244                 com.google.cloud.dialogflow.cx.v3.QueryResult,
1245                 com.google.cloud.dialogflow.cx.v3.QueryResult.Builder,
1246                 com.google.cloud.dialogflow.cx.v3.QueryResultOrBuilder>(
1247                 getQueryResult(), getParentForChildren(), isClean());
1248         queryResult_ = null;
1249       }
1250       return queryResultBuilder_;
1251     }
1252 
1253     private com.google.protobuf.ByteString outputAudio_ = com.google.protobuf.ByteString.EMPTY;
1254     /**
1255      *
1256      *
1257      * <pre>
1258      * The audio data bytes encoded as specified in the request.
1259      * Note: The output audio is generated based on the values of default platform
1260      * text responses found in the
1261      * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages]
1262      * field. If multiple default text responses exist, they will be concatenated
1263      * when generating audio. If no default platform text responses exist, the
1264      * generated audio content will be empty.
1265      * In some scenarios, multiple output audio fields may be present in the
1266      * response structure. In these cases, only the top-most-level audio output
1267      * has content.
1268      * </pre>
1269      *
1270      * <code>bytes output_audio = 4;</code>
1271      *
1272      * @return The outputAudio.
1273      */
1274     @java.lang.Override
getOutputAudio()1275     public com.google.protobuf.ByteString getOutputAudio() {
1276       return outputAudio_;
1277     }
1278     /**
1279      *
1280      *
1281      * <pre>
1282      * The audio data bytes encoded as specified in the request.
1283      * Note: The output audio is generated based on the values of default platform
1284      * text responses found in the
1285      * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages]
1286      * field. If multiple default text responses exist, they will be concatenated
1287      * when generating audio. If no default platform text responses exist, the
1288      * generated audio content will be empty.
1289      * In some scenarios, multiple output audio fields may be present in the
1290      * response structure. In these cases, only the top-most-level audio output
1291      * has content.
1292      * </pre>
1293      *
1294      * <code>bytes output_audio = 4;</code>
1295      *
1296      * @param value The outputAudio to set.
1297      * @return This builder for chaining.
1298      */
setOutputAudio(com.google.protobuf.ByteString value)1299     public Builder setOutputAudio(com.google.protobuf.ByteString value) {
1300       if (value == null) {
1301         throw new NullPointerException();
1302       }
1303       outputAudio_ = value;
1304       bitField0_ |= 0x00000004;
1305       onChanged();
1306       return this;
1307     }
1308     /**
1309      *
1310      *
1311      * <pre>
1312      * The audio data bytes encoded as specified in the request.
1313      * Note: The output audio is generated based on the values of default platform
1314      * text responses found in the
1315      * [`query_result.response_messages`][google.cloud.dialogflow.cx.v3.QueryResult.response_messages]
1316      * field. If multiple default text responses exist, they will be concatenated
1317      * when generating audio. If no default platform text responses exist, the
1318      * generated audio content will be empty.
1319      * In some scenarios, multiple output audio fields may be present in the
1320      * response structure. In these cases, only the top-most-level audio output
1321      * has content.
1322      * </pre>
1323      *
1324      * <code>bytes output_audio = 4;</code>
1325      *
1326      * @return This builder for chaining.
1327      */
clearOutputAudio()1328     public Builder clearOutputAudio() {
1329       bitField0_ = (bitField0_ & ~0x00000004);
1330       outputAudio_ = getDefaultInstance().getOutputAudio();
1331       onChanged();
1332       return this;
1333     }
1334 
1335     private com.google.cloud.dialogflow.cx.v3.OutputAudioConfig outputAudioConfig_;
1336     private com.google.protobuf.SingleFieldBuilderV3<
1337             com.google.cloud.dialogflow.cx.v3.OutputAudioConfig,
1338             com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.Builder,
1339             com.google.cloud.dialogflow.cx.v3.OutputAudioConfigOrBuilder>
1340         outputAudioConfigBuilder_;
1341     /**
1342      *
1343      *
1344      * <pre>
1345      * The config used by the speech synthesizer to generate the output audio.
1346      * </pre>
1347      *
1348      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1349      *
1350      * @return Whether the outputAudioConfig field is set.
1351      */
hasOutputAudioConfig()1352     public boolean hasOutputAudioConfig() {
1353       return ((bitField0_ & 0x00000008) != 0);
1354     }
1355     /**
1356      *
1357      *
1358      * <pre>
1359      * The config used by the speech synthesizer to generate the output audio.
1360      * </pre>
1361      *
1362      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1363      *
1364      * @return The outputAudioConfig.
1365      */
getOutputAudioConfig()1366     public com.google.cloud.dialogflow.cx.v3.OutputAudioConfig getOutputAudioConfig() {
1367       if (outputAudioConfigBuilder_ == null) {
1368         return outputAudioConfig_ == null
1369             ? com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.getDefaultInstance()
1370             : outputAudioConfig_;
1371       } else {
1372         return outputAudioConfigBuilder_.getMessage();
1373       }
1374     }
1375     /**
1376      *
1377      *
1378      * <pre>
1379      * The config used by the speech synthesizer to generate the output audio.
1380      * </pre>
1381      *
1382      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1383      */
setOutputAudioConfig(com.google.cloud.dialogflow.cx.v3.OutputAudioConfig value)1384     public Builder setOutputAudioConfig(com.google.cloud.dialogflow.cx.v3.OutputAudioConfig value) {
1385       if (outputAudioConfigBuilder_ == null) {
1386         if (value == null) {
1387           throw new NullPointerException();
1388         }
1389         outputAudioConfig_ = value;
1390       } else {
1391         outputAudioConfigBuilder_.setMessage(value);
1392       }
1393       bitField0_ |= 0x00000008;
1394       onChanged();
1395       return this;
1396     }
1397     /**
1398      *
1399      *
1400      * <pre>
1401      * The config used by the speech synthesizer to generate the output audio.
1402      * </pre>
1403      *
1404      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1405      */
setOutputAudioConfig( com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.Builder builderForValue)1406     public Builder setOutputAudioConfig(
1407         com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.Builder builderForValue) {
1408       if (outputAudioConfigBuilder_ == null) {
1409         outputAudioConfig_ = builderForValue.build();
1410       } else {
1411         outputAudioConfigBuilder_.setMessage(builderForValue.build());
1412       }
1413       bitField0_ |= 0x00000008;
1414       onChanged();
1415       return this;
1416     }
1417     /**
1418      *
1419      *
1420      * <pre>
1421      * The config used by the speech synthesizer to generate the output audio.
1422      * </pre>
1423      *
1424      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1425      */
mergeOutputAudioConfig( com.google.cloud.dialogflow.cx.v3.OutputAudioConfig value)1426     public Builder mergeOutputAudioConfig(
1427         com.google.cloud.dialogflow.cx.v3.OutputAudioConfig value) {
1428       if (outputAudioConfigBuilder_ == null) {
1429         if (((bitField0_ & 0x00000008) != 0)
1430             && outputAudioConfig_ != null
1431             && outputAudioConfig_
1432                 != com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.getDefaultInstance()) {
1433           getOutputAudioConfigBuilder().mergeFrom(value);
1434         } else {
1435           outputAudioConfig_ = value;
1436         }
1437       } else {
1438         outputAudioConfigBuilder_.mergeFrom(value);
1439       }
1440       bitField0_ |= 0x00000008;
1441       onChanged();
1442       return this;
1443     }
1444     /**
1445      *
1446      *
1447      * <pre>
1448      * The config used by the speech synthesizer to generate the output audio.
1449      * </pre>
1450      *
1451      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1452      */
clearOutputAudioConfig()1453     public Builder clearOutputAudioConfig() {
1454       bitField0_ = (bitField0_ & ~0x00000008);
1455       outputAudioConfig_ = null;
1456       if (outputAudioConfigBuilder_ != null) {
1457         outputAudioConfigBuilder_.dispose();
1458         outputAudioConfigBuilder_ = null;
1459       }
1460       onChanged();
1461       return this;
1462     }
1463     /**
1464      *
1465      *
1466      * <pre>
1467      * The config used by the speech synthesizer to generate the output audio.
1468      * </pre>
1469      *
1470      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1471      */
1472     public com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.Builder
getOutputAudioConfigBuilder()1473         getOutputAudioConfigBuilder() {
1474       bitField0_ |= 0x00000008;
1475       onChanged();
1476       return getOutputAudioConfigFieldBuilder().getBuilder();
1477     }
1478     /**
1479      *
1480      *
1481      * <pre>
1482      * The config used by the speech synthesizer to generate the output audio.
1483      * </pre>
1484      *
1485      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1486      */
1487     public com.google.cloud.dialogflow.cx.v3.OutputAudioConfigOrBuilder
getOutputAudioConfigOrBuilder()1488         getOutputAudioConfigOrBuilder() {
1489       if (outputAudioConfigBuilder_ != null) {
1490         return outputAudioConfigBuilder_.getMessageOrBuilder();
1491       } else {
1492         return outputAudioConfig_ == null
1493             ? com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.getDefaultInstance()
1494             : outputAudioConfig_;
1495       }
1496     }
1497     /**
1498      *
1499      *
1500      * <pre>
1501      * The config used by the speech synthesizer to generate the output audio.
1502      * </pre>
1503      *
1504      * <code>.google.cloud.dialogflow.cx.v3.OutputAudioConfig output_audio_config = 5;</code>
1505      */
1506     private com.google.protobuf.SingleFieldBuilderV3<
1507             com.google.cloud.dialogflow.cx.v3.OutputAudioConfig,
1508             com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.Builder,
1509             com.google.cloud.dialogflow.cx.v3.OutputAudioConfigOrBuilder>
getOutputAudioConfigFieldBuilder()1510         getOutputAudioConfigFieldBuilder() {
1511       if (outputAudioConfigBuilder_ == null) {
1512         outputAudioConfigBuilder_ =
1513             new com.google.protobuf.SingleFieldBuilderV3<
1514                 com.google.cloud.dialogflow.cx.v3.OutputAudioConfig,
1515                 com.google.cloud.dialogflow.cx.v3.OutputAudioConfig.Builder,
1516                 com.google.cloud.dialogflow.cx.v3.OutputAudioConfigOrBuilder>(
1517                 getOutputAudioConfig(), getParentForChildren(), isClean());
1518         outputAudioConfig_ = null;
1519       }
1520       return outputAudioConfigBuilder_;
1521     }
1522 
1523     private int responseType_ = 0;
1524     /**
1525      *
1526      *
1527      * <pre>
1528      * Response type.
1529      * </pre>
1530      *
1531      * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
1532      * </code>
1533      *
1534      * @return The enum numeric value on the wire for responseType.
1535      */
1536     @java.lang.Override
getResponseTypeValue()1537     public int getResponseTypeValue() {
1538       return responseType_;
1539     }
1540     /**
1541      *
1542      *
1543      * <pre>
1544      * Response type.
1545      * </pre>
1546      *
1547      * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
1548      * </code>
1549      *
1550      * @param value The enum numeric value on the wire for responseType to set.
1551      * @return This builder for chaining.
1552      */
setResponseTypeValue(int value)1553     public Builder setResponseTypeValue(int value) {
1554       responseType_ = value;
1555       bitField0_ |= 0x00000010;
1556       onChanged();
1557       return this;
1558     }
1559     /**
1560      *
1561      *
1562      * <pre>
1563      * Response type.
1564      * </pre>
1565      *
1566      * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
1567      * </code>
1568      *
1569      * @return The responseType.
1570      */
1571     @java.lang.Override
getResponseType()1572     public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType getResponseType() {
1573       com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType result =
1574           com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType.forNumber(
1575               responseType_);
1576       return result == null
1577           ? com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType.UNRECOGNIZED
1578           : result;
1579     }
1580     /**
1581      *
1582      *
1583      * <pre>
1584      * Response type.
1585      * </pre>
1586      *
1587      * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
1588      * </code>
1589      *
1590      * @param value The responseType to set.
1591      * @return This builder for chaining.
1592      */
setResponseType( com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType value)1593     public Builder setResponseType(
1594         com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType value) {
1595       if (value == null) {
1596         throw new NullPointerException();
1597       }
1598       bitField0_ |= 0x00000010;
1599       responseType_ = value.getNumber();
1600       onChanged();
1601       return this;
1602     }
1603     /**
1604      *
1605      *
1606      * <pre>
1607      * Response type.
1608      * </pre>
1609      *
1610      * <code>.google.cloud.dialogflow.cx.v3.DetectIntentResponse.ResponseType response_type = 6;
1611      * </code>
1612      *
1613      * @return This builder for chaining.
1614      */
clearResponseType()1615     public Builder clearResponseType() {
1616       bitField0_ = (bitField0_ & ~0x00000010);
1617       responseType_ = 0;
1618       onChanged();
1619       return this;
1620     }
1621 
1622     private boolean allowCancellation_;
1623     /**
1624      *
1625      *
1626      * <pre>
1627      * Indicates whether the partial response can be cancelled when a later
1628      * response arrives. e.g. if the agent specified some music as partial
1629      * response, it can be cancelled.
1630      * </pre>
1631      *
1632      * <code>bool allow_cancellation = 7;</code>
1633      *
1634      * @return The allowCancellation.
1635      */
1636     @java.lang.Override
getAllowCancellation()1637     public boolean getAllowCancellation() {
1638       return allowCancellation_;
1639     }
1640     /**
1641      *
1642      *
1643      * <pre>
1644      * Indicates whether the partial response can be cancelled when a later
1645      * response arrives. e.g. if the agent specified some music as partial
1646      * response, it can be cancelled.
1647      * </pre>
1648      *
1649      * <code>bool allow_cancellation = 7;</code>
1650      *
1651      * @param value The allowCancellation to set.
1652      * @return This builder for chaining.
1653      */
setAllowCancellation(boolean value)1654     public Builder setAllowCancellation(boolean value) {
1655 
1656       allowCancellation_ = value;
1657       bitField0_ |= 0x00000020;
1658       onChanged();
1659       return this;
1660     }
1661     /**
1662      *
1663      *
1664      * <pre>
1665      * Indicates whether the partial response can be cancelled when a later
1666      * response arrives. e.g. if the agent specified some music as partial
1667      * response, it can be cancelled.
1668      * </pre>
1669      *
1670      * <code>bool allow_cancellation = 7;</code>
1671      *
1672      * @return This builder for chaining.
1673      */
clearAllowCancellation()1674     public Builder clearAllowCancellation() {
1675       bitField0_ = (bitField0_ & ~0x00000020);
1676       allowCancellation_ = false;
1677       onChanged();
1678       return this;
1679     }
1680 
1681     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1682     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
1683       return super.setUnknownFields(unknownFields);
1684     }
1685 
1686     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1687     public final Builder mergeUnknownFields(
1688         final com.google.protobuf.UnknownFieldSet unknownFields) {
1689       return super.mergeUnknownFields(unknownFields);
1690     }
1691 
1692     // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.cx.v3.DetectIntentResponse)
1693   }
1694 
1695   // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3.DetectIntentResponse)
1696   private static final com.google.cloud.dialogflow.cx.v3.DetectIntentResponse DEFAULT_INSTANCE;
1697 
1698   static {
1699     DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3.DetectIntentResponse();
1700   }
1701 
getDefaultInstance()1702   public static com.google.cloud.dialogflow.cx.v3.DetectIntentResponse getDefaultInstance() {
1703     return DEFAULT_INSTANCE;
1704   }
1705 
1706   private static final com.google.protobuf.Parser<DetectIntentResponse> PARSER =
1707       new com.google.protobuf.AbstractParser<DetectIntentResponse>() {
1708         @java.lang.Override
1709         public DetectIntentResponse parsePartialFrom(
1710             com.google.protobuf.CodedInputStream input,
1711             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1712             throws com.google.protobuf.InvalidProtocolBufferException {
1713           Builder builder = newBuilder();
1714           try {
1715             builder.mergeFrom(input, extensionRegistry);
1716           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1717             throw e.setUnfinishedMessage(builder.buildPartial());
1718           } catch (com.google.protobuf.UninitializedMessageException e) {
1719             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
1720           } catch (java.io.IOException e) {
1721             throw new com.google.protobuf.InvalidProtocolBufferException(e)
1722                 .setUnfinishedMessage(builder.buildPartial());
1723           }
1724           return builder.buildPartial();
1725         }
1726       };
1727 
parser()1728   public static com.google.protobuf.Parser<DetectIntentResponse> parser() {
1729     return PARSER;
1730   }
1731 
1732   @java.lang.Override
getParserForType()1733   public com.google.protobuf.Parser<DetectIntentResponse> getParserForType() {
1734     return PARSER;
1735   }
1736 
1737   @java.lang.Override
getDefaultInstanceForType()1738   public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse getDefaultInstanceForType() {
1739     return DEFAULT_INSTANCE;
1740   }
1741 }
1742