com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-dialogflow-cx-v3 Show documentation
Show all versions of proto-google-cloud-dialogflow-cx-v3 Show documentation
PROTO library for proto-google-cloud-dialogflow-cx-v3
/*
* 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/cx/v3/session.proto
package com.google.cloud.dialogflow.cx.v3;
/**
*
*
*
* The top-level message returned from the `StreamingDetectIntent` 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. If `enable_partial_response` is true, the following N messages
* (currently 1 <= N <= 4) contain `detect_intent_response`. The first (N-1)
* `detect_intent_response`s will have `response_type` set to `PARTIAL`.
* The last `detect_intent_response` has `response_type` set to `FINAL`.
* If `response_type` is false, response stream only contains
* the final `detect_intent_response`.
*
*
* Protobuf type {@code google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse}
*/
public final class StreamingDetectIntentResponse extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse)
StreamingDetectIntentResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use StreamingDetectIntentResponse.newBuilder() to construct.
private StreamingDetectIntentResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private StreamingDetectIntentResponse() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new StreamingDetectIntentResponse();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private StreamingDetectIntentResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.Builder subBuilder =
null;
if (responseCase_ == 1) {
subBuilder =
((com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_)
.toBuilder();
}
response_ =
input.readMessage(
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(
(com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_);
response_ = subBuilder.buildPartial();
}
responseCase_ = 1;
break;
}
case 18:
{
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder subBuilder = null;
if (responseCase_ == 2) {
subBuilder =
((com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_)
.toBuilder();
}
response_ =
input.readMessage(
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(
(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_);
response_ = subBuilder.buildPartial();
}
responseCase_ = 2;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.cx.v3.SessionProto
.internal_static_google_cloud_dialogflow_cx_v3_StreamingDetectIntentResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.cx.v3.SessionProto
.internal_static_google_cloud_dialogflow_cx_v3_StreamingDetectIntentResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.class,
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.Builder.class);
}
private int responseCase_ = 0;
private java.lang.Object response_;
public enum ResponseCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
RECOGNITION_RESULT(1),
DETECT_INTENT_RESPONSE(2),
RESPONSE_NOT_SET(0);
private final int value;
private ResponseCase(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 ResponseCase valueOf(int value) {
return forNumber(value);
}
public static ResponseCase forNumber(int value) {
switch (value) {
case 1:
return RECOGNITION_RESULT;
case 2:
return DETECT_INTENT_RESPONSE;
case 0:
return RESPONSE_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public ResponseCase getResponseCase() {
return ResponseCase.forNumber(responseCase_);
}
public static final int RECOGNITION_RESULT_FIELD_NUMBER = 1;
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
* @return Whether the recognitionResult field is set.
*/
@java.lang.Override
public boolean hasRecognitionResult() {
return responseCase_ == 1;
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
* @return The recognitionResult.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult getRecognitionResult() {
if (responseCase_ == 1) {
return (com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_;
}
return com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.getDefaultInstance();
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultOrBuilder
getRecognitionResultOrBuilder() {
if (responseCase_ == 1) {
return (com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_;
}
return com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.getDefaultInstance();
}
public static final int DETECT_INTENT_RESPONSE_FIELD_NUMBER = 2;
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*
* @return Whether the detectIntentResponse field is set.
*/
@java.lang.Override
public boolean hasDetectIntentResponse() {
return responseCase_ == 2;
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*
* @return The detectIntentResponse.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse getDetectIntentResponse() {
if (responseCase_ == 2) {
return (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_;
}
return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.DetectIntentResponseOrBuilder
getDetectIntentResponseOrBuilder() {
if (responseCase_ == 2) {
return (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_;
}
return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
}
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 (responseCase_ == 1) {
output.writeMessage(
1, (com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_);
}
if (responseCase_ == 2) {
output.writeMessage(2, (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (responseCase_ == 1) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
1, (com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_);
}
if (responseCase_ == 2) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
2, (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse other =
(com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse) obj;
if (!getResponseCase().equals(other.getResponseCase())) return false;
switch (responseCase_) {
case 1:
if (!getRecognitionResult().equals(other.getRecognitionResult())) return false;
break;
case 2:
if (!getDetectIntentResponse().equals(other.getDetectIntentResponse())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
switch (responseCase_) {
case 1:
hash = (37 * hash) + RECOGNITION_RESULT_FIELD_NUMBER;
hash = (53 * hash) + getRecognitionResult().hashCode();
break;
case 2:
hash = (37 * hash) + DETECT_INTENT_RESPONSE_FIELD_NUMBER;
hash = (53 * hash) + getDetectIntentResponse().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse 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.cx.v3.StreamingDetectIntentResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse 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.cx.v3.StreamingDetectIntentResponse parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse 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.cx.v3.StreamingDetectIntentResponse parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse 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.cx.v3.StreamingDetectIntentResponse parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse 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.cx.v3.StreamingDetectIntentResponse 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 `StreamingDetectIntent` 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. If `enable_partial_response` is true, the following N messages
* (currently 1 <= N <= 4) contain `detect_intent_response`. The first (N-1)
* `detect_intent_response`s will have `response_type` set to `PARTIAL`.
* The last `detect_intent_response` has `response_type` set to `FINAL`.
* If `response_type` is false, response stream only contains
* the final `detect_intent_response`.
*
*
* Protobuf type {@code google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse)
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.cx.v3.SessionProto
.internal_static_google_cloud_dialogflow_cx_v3_StreamingDetectIntentResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.cx.v3.SessionProto
.internal_static_google_cloud_dialogflow_cx_v3_StreamingDetectIntentResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.class,
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.Builder.class);
}
// Construct using com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
responseCase_ = 0;
response_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dialogflow.cx.v3.SessionProto
.internal_static_google_cloud_dialogflow_cx_v3_StreamingDetectIntentResponse_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse
getDefaultInstanceForType() {
return com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse build() {
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse buildPartial() {
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse result =
new com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse(this);
if (responseCase_ == 1) {
if (recognitionResultBuilder_ == null) {
result.response_ = response_;
} else {
result.response_ = recognitionResultBuilder_.build();
}
}
if (responseCase_ == 2) {
if (detectIntentResponseBuilder_ == null) {
result.response_ = response_;
} else {
result.response_ = detectIntentResponseBuilder_.build();
}
}
result.responseCase_ = responseCase_;
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.cx.v3.StreamingDetectIntentResponse) {
return mergeFrom((com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse other) {
if (other
== com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse.getDefaultInstance())
return this;
switch (other.getResponseCase()) {
case RECOGNITION_RESULT:
{
mergeRecognitionResult(other.getRecognitionResult());
break;
}
case DETECT_INTENT_RESPONSE:
{
mergeDetectIntentResponse(other.getDetectIntentResponse());
break;
}
case RESPONSE_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse)
e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int responseCase_ = 0;
private java.lang.Object response_;
public ResponseCase getResponseCase() {
return ResponseCase.forNumber(responseCase_);
}
public Builder clearResponse() {
responseCase_ = 0;
response_ = null;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult,
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.Builder,
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultOrBuilder>
recognitionResultBuilder_;
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*
* @return Whether the recognitionResult field is set.
*/
@java.lang.Override
public boolean hasRecognitionResult() {
return responseCase_ == 1;
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*
* @return The recognitionResult.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult getRecognitionResult() {
if (recognitionResultBuilder_ == null) {
if (responseCase_ == 1) {
return (com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_;
}
return com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.getDefaultInstance();
} else {
if (responseCase_ == 1) {
return recognitionResultBuilder_.getMessage();
}
return com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.getDefaultInstance();
}
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
public Builder setRecognitionResult(
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult value) {
if (recognitionResultBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
} else {
recognitionResultBuilder_.setMessage(value);
}
responseCase_ = 1;
return this;
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
public Builder setRecognitionResult(
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.Builder builderForValue) {
if (recognitionResultBuilder_ == null) {
response_ = builderForValue.build();
onChanged();
} else {
recognitionResultBuilder_.setMessage(builderForValue.build());
}
responseCase_ = 1;
return this;
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
public Builder mergeRecognitionResult(
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult value) {
if (recognitionResultBuilder_ == null) {
if (responseCase_ == 1
&& response_
!= com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult
.getDefaultInstance()) {
response_ =
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.newBuilder(
(com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_)
.mergeFrom(value)
.buildPartial();
} else {
response_ = value;
}
onChanged();
} else {
if (responseCase_ == 1) {
recognitionResultBuilder_.mergeFrom(value);
}
recognitionResultBuilder_.setMessage(value);
}
responseCase_ = 1;
return this;
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
public Builder clearRecognitionResult() {
if (recognitionResultBuilder_ == null) {
if (responseCase_ == 1) {
responseCase_ = 0;
response_ = null;
onChanged();
}
} else {
if (responseCase_ == 1) {
responseCase_ = 0;
response_ = null;
}
recognitionResultBuilder_.clear();
}
return this;
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
public com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.Builder
getRecognitionResultBuilder() {
return getRecognitionResultFieldBuilder().getBuilder();
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultOrBuilder
getRecognitionResultOrBuilder() {
if ((responseCase_ == 1) && (recognitionResultBuilder_ != null)) {
return recognitionResultBuilder_.getMessageOrBuilder();
} else {
if (responseCase_ == 1) {
return (com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_;
}
return com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.getDefaultInstance();
}
}
/**
*
*
*
* The result of speech recognition.
*
*
* .google.cloud.dialogflow.cx.v3.StreamingRecognitionResult recognition_result = 1;
*
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult,
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.Builder,
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultOrBuilder>
getRecognitionResultFieldBuilder() {
if (recognitionResultBuilder_ == null) {
if (!(responseCase_ == 1)) {
response_ =
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.getDefaultInstance();
}
recognitionResultBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult,
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult.Builder,
com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResultOrBuilder>(
(com.google.cloud.dialogflow.cx.v3.StreamingRecognitionResult) response_,
getParentForChildren(),
isClean());
response_ = null;
}
responseCase_ = 1;
onChanged();
;
return recognitionResultBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse,
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder,
com.google.cloud.dialogflow.cx.v3.DetectIntentResponseOrBuilder>
detectIntentResponseBuilder_;
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*
* @return Whether the detectIntentResponse field is set.
*/
@java.lang.Override
public boolean hasDetectIntentResponse() {
return responseCase_ == 2;
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*
* @return The detectIntentResponse.
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse getDetectIntentResponse() {
if (detectIntentResponseBuilder_ == null) {
if (responseCase_ == 2) {
return (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_;
}
return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
} else {
if (responseCase_ == 2) {
return detectIntentResponseBuilder_.getMessage();
}
return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
}
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
public Builder setDetectIntentResponse(
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse value) {
if (detectIntentResponseBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
response_ = value;
onChanged();
} else {
detectIntentResponseBuilder_.setMessage(value);
}
responseCase_ = 2;
return this;
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
public Builder setDetectIntentResponse(
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder builderForValue) {
if (detectIntentResponseBuilder_ == null) {
response_ = builderForValue.build();
onChanged();
} else {
detectIntentResponseBuilder_.setMessage(builderForValue.build());
}
responseCase_ = 2;
return this;
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
public Builder mergeDetectIntentResponse(
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse value) {
if (detectIntentResponseBuilder_ == null) {
if (responseCase_ == 2
&& response_
!= com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance()) {
response_ =
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.newBuilder(
(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_)
.mergeFrom(value)
.buildPartial();
} else {
response_ = value;
}
onChanged();
} else {
if (responseCase_ == 2) {
detectIntentResponseBuilder_.mergeFrom(value);
}
detectIntentResponseBuilder_.setMessage(value);
}
responseCase_ = 2;
return this;
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
public Builder clearDetectIntentResponse() {
if (detectIntentResponseBuilder_ == null) {
if (responseCase_ == 2) {
responseCase_ = 0;
response_ = null;
onChanged();
}
} else {
if (responseCase_ == 2) {
responseCase_ = 0;
response_ = null;
}
detectIntentResponseBuilder_.clear();
}
return this;
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
public com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder
getDetectIntentResponseBuilder() {
return getDetectIntentResponseFieldBuilder().getBuilder();
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.DetectIntentResponseOrBuilder
getDetectIntentResponseOrBuilder() {
if ((responseCase_ == 2) && (detectIntentResponseBuilder_ != null)) {
return detectIntentResponseBuilder_.getMessageOrBuilder();
} else {
if (responseCase_ == 2) {
return (com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_;
}
return com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
}
}
/**
*
*
*
* The response from detect intent.
*
*
* .google.cloud.dialogflow.cx.v3.DetectIntentResponse detect_intent_response = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse,
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder,
com.google.cloud.dialogflow.cx.v3.DetectIntentResponseOrBuilder>
getDetectIntentResponseFieldBuilder() {
if (detectIntentResponseBuilder_ == null) {
if (!(responseCase_ == 2)) {
response_ = com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.getDefaultInstance();
}
detectIntentResponseBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse,
com.google.cloud.dialogflow.cx.v3.DetectIntentResponse.Builder,
com.google.cloud.dialogflow.cx.v3.DetectIntentResponseOrBuilder>(
(com.google.cloud.dialogflow.cx.v3.DetectIntentResponse) response_,
getParentForChildren(),
isClean());
response_ = null;
}
responseCase_ = 2;
onChanged();
;
return detectIntentResponseBuilder_;
}
@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.cx.v3.StreamingDetectIntentResponse)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse)
private static final com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse();
}
public static com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public StreamingDetectIntentResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new StreamingDetectIntentResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.cx.v3.StreamingDetectIntentResponse
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy