com.google.cloud.dialogflow.v2.WebhookResponse 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-v2 Show documentation
Show all versions of proto-google-cloud-dialogflow-v2 Show documentation
PROTO library for proto-google-cloud-dialogflow-v2
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2/webhook.proto
package com.google.cloud.dialogflow.v2;
/**
*
* The response message for a webhook call.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.WebhookResponse}
*/
public final class WebhookResponse extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.WebhookResponse)
WebhookResponseOrBuilder {
private static final long serialVersionUID = 0L;
// Use WebhookResponse.newBuilder() to construct.
private WebhookResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private WebhookResponse() {
fulfillmentText_ = "";
fulfillmentMessages_ = java.util.Collections.emptyList();
source_ = "";
outputContexts_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private WebhookResponse(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
fulfillmentText_ = s;
break;
}
case 18: {
if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
fulfillmentMessages_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
fulfillmentMessages_.add(
input.readMessage(com.google.cloud.dialogflow.v2.Intent.Message.parser(), extensionRegistry));
break;
}
case 26: {
java.lang.String s = input.readStringRequireUtf8();
source_ = s;
break;
}
case 34: {
com.google.protobuf.Struct.Builder subBuilder = null;
if (payload_ != null) {
subBuilder = payload_.toBuilder();
}
payload_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(payload_);
payload_ = subBuilder.buildPartial();
}
break;
}
case 42: {
if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
outputContexts_ = new java.util.ArrayList();
mutable_bitField0_ |= 0x00000010;
}
outputContexts_.add(
input.readMessage(com.google.cloud.dialogflow.v2.Context.parser(), extensionRegistry));
break;
}
case 50: {
com.google.cloud.dialogflow.v2.EventInput.Builder subBuilder = null;
if (followupEventInput_ != null) {
subBuilder = followupEventInput_.toBuilder();
}
followupEventInput_ = input.readMessage(com.google.cloud.dialogflow.v2.EventInput.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(followupEventInput_);
followupEventInput_ = subBuilder.buildPartial();
}
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 {
if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
fulfillmentMessages_ = java.util.Collections.unmodifiableList(fulfillmentMessages_);
}
if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
outputContexts_ = java.util.Collections.unmodifiableList(outputContexts_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.dialogflow.v2.WebhookProto.internal_static_google_cloud_dialogflow_v2_WebhookResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.WebhookProto.internal_static_google_cloud_dialogflow_v2_WebhookResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.WebhookResponse.class, com.google.cloud.dialogflow.v2.WebhookResponse.Builder.class);
}
private int bitField0_;
public static final int FULFILLMENT_TEXT_FIELD_NUMBER = 1;
private volatile java.lang.Object fulfillmentText_;
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public java.lang.String getFulfillmentText() {
java.lang.Object ref = fulfillmentText_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
fulfillmentText_ = s;
return s;
}
}
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public com.google.protobuf.ByteString
getFulfillmentTextBytes() {
java.lang.Object ref = fulfillmentText_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
fulfillmentText_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FULFILLMENT_MESSAGES_FIELD_NUMBER = 2;
private java.util.List fulfillmentMessages_;
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public java.util.List getFulfillmentMessagesList() {
return fulfillmentMessages_;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public java.util.List extends com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder>
getFulfillmentMessagesOrBuilderList() {
return fulfillmentMessages_;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public int getFulfillmentMessagesCount() {
return fulfillmentMessages_.size();
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.Message getFulfillmentMessages(int index) {
return fulfillmentMessages_.get(index);
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder getFulfillmentMessagesOrBuilder(
int index) {
return fulfillmentMessages_.get(index);
}
public static final int SOURCE_FIELD_NUMBER = 3;
private volatile java.lang.Object source_;
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public java.lang.String getSource() {
java.lang.Object ref = source_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
source_ = s;
return s;
}
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public com.google.protobuf.ByteString
getSourceBytes() {
java.lang.Object ref = source_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
source_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PAYLOAD_FIELD_NUMBER = 4;
private com.google.protobuf.Struct payload_;
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public boolean hasPayload() {
return payload_ != null;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public com.google.protobuf.Struct getPayload() {
return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() {
return getPayload();
}
public static final int OUTPUT_CONTEXTS_FIELD_NUMBER = 5;
private java.util.List outputContexts_;
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public java.util.List getOutputContextsList() {
return outputContexts_;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public java.util.List extends com.google.cloud.dialogflow.v2.ContextOrBuilder>
getOutputContextsOrBuilderList() {
return outputContexts_;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public int getOutputContextsCount() {
return outputContexts_.size();
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.Context getOutputContexts(int index) {
return outputContexts_.get(index);
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.ContextOrBuilder getOutputContextsOrBuilder(
int index) {
return outputContexts_.get(index);
}
public static final int FOLLOWUP_EVENT_INPUT_FIELD_NUMBER = 6;
private com.google.cloud.dialogflow.v2.EventInput followupEventInput_;
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public boolean hasFollowupEventInput() {
return followupEventInput_ != null;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public com.google.cloud.dialogflow.v2.EventInput getFollowupEventInput() {
return followupEventInput_ == null ? com.google.cloud.dialogflow.v2.EventInput.getDefaultInstance() : followupEventInput_;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public com.google.cloud.dialogflow.v2.EventInputOrBuilder getFollowupEventInputOrBuilder() {
return getFollowupEventInput();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getFulfillmentTextBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fulfillmentText_);
}
for (int i = 0; i < fulfillmentMessages_.size(); i++) {
output.writeMessage(2, fulfillmentMessages_.get(i));
}
if (!getSourceBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_);
}
if (payload_ != null) {
output.writeMessage(4, getPayload());
}
for (int i = 0; i < outputContexts_.size(); i++) {
output.writeMessage(5, outputContexts_.get(i));
}
if (followupEventInput_ != null) {
output.writeMessage(6, getFollowupEventInput());
}
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getFulfillmentTextBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fulfillmentText_);
}
for (int i = 0; i < fulfillmentMessages_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, fulfillmentMessages_.get(i));
}
if (!getSourceBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_);
}
if (payload_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, getPayload());
}
for (int i = 0; i < outputContexts_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(5, outputContexts_.get(i));
}
if (followupEventInput_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(6, getFollowupEventInput());
}
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.v2.WebhookResponse)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.v2.WebhookResponse other = (com.google.cloud.dialogflow.v2.WebhookResponse) obj;
boolean result = true;
result = result && getFulfillmentText()
.equals(other.getFulfillmentText());
result = result && getFulfillmentMessagesList()
.equals(other.getFulfillmentMessagesList());
result = result && getSource()
.equals(other.getSource());
result = result && (hasPayload() == other.hasPayload());
if (hasPayload()) {
result = result && getPayload()
.equals(other.getPayload());
}
result = result && getOutputContextsList()
.equals(other.getOutputContextsList());
result = result && (hasFollowupEventInput() == other.hasFollowupEventInput());
if (hasFollowupEventInput()) {
result = result && getFollowupEventInput()
.equals(other.getFollowupEventInput());
}
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + FULFILLMENT_TEXT_FIELD_NUMBER;
hash = (53 * hash) + getFulfillmentText().hashCode();
if (getFulfillmentMessagesCount() > 0) {
hash = (37 * hash) + FULFILLMENT_MESSAGES_FIELD_NUMBER;
hash = (53 * hash) + getFulfillmentMessagesList().hashCode();
}
hash = (37 * hash) + SOURCE_FIELD_NUMBER;
hash = (53 * hash) + getSource().hashCode();
if (hasPayload()) {
hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
hash = (53 * hash) + getPayload().hashCode();
}
if (getOutputContextsCount() > 0) {
hash = (37 * hash) + OUTPUT_CONTEXTS_FIELD_NUMBER;
hash = (53 * hash) + getOutputContextsList().hashCode();
}
if (hasFollowupEventInput()) {
hash = (37 * hash) + FOLLOWUP_EVENT_INPUT_FIELD_NUMBER;
hash = (53 * hash) + getFollowupEventInput().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.WebhookResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.dialogflow.v2.WebhookResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
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 response message for a webhook call.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.WebhookResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.WebhookResponse)
com.google.cloud.dialogflow.v2.WebhookResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.google.cloud.dialogflow.v2.WebhookProto.internal_static_google_cloud_dialogflow_v2_WebhookResponse_descriptor;
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.WebhookProto.internal_static_google_cloud_dialogflow_v2_WebhookResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.WebhookResponse.class, com.google.cloud.dialogflow.v2.WebhookResponse.Builder.class);
}
// Construct using com.google.cloud.dialogflow.v2.WebhookResponse.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
getFulfillmentMessagesFieldBuilder();
getOutputContextsFieldBuilder();
}
}
public Builder clear() {
super.clear();
fulfillmentText_ = "";
if (fulfillmentMessagesBuilder_ == null) {
fulfillmentMessages_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
} else {
fulfillmentMessagesBuilder_.clear();
}
source_ = "";
if (payloadBuilder_ == null) {
payload_ = null;
} else {
payload_ = null;
payloadBuilder_ = null;
}
if (outputContextsBuilder_ == null) {
outputContexts_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
} else {
outputContextsBuilder_.clear();
}
if (followupEventInputBuilder_ == null) {
followupEventInput_ = null;
} else {
followupEventInput_ = null;
followupEventInputBuilder_ = null;
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.google.cloud.dialogflow.v2.WebhookProto.internal_static_google_cloud_dialogflow_v2_WebhookResponse_descriptor;
}
public com.google.cloud.dialogflow.v2.WebhookResponse getDefaultInstanceForType() {
return com.google.cloud.dialogflow.v2.WebhookResponse.getDefaultInstance();
}
public com.google.cloud.dialogflow.v2.WebhookResponse build() {
com.google.cloud.dialogflow.v2.WebhookResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public com.google.cloud.dialogflow.v2.WebhookResponse buildPartial() {
com.google.cloud.dialogflow.v2.WebhookResponse result = new com.google.cloud.dialogflow.v2.WebhookResponse(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
result.fulfillmentText_ = fulfillmentText_;
if (fulfillmentMessagesBuilder_ == null) {
if (((bitField0_ & 0x00000002) == 0x00000002)) {
fulfillmentMessages_ = java.util.Collections.unmodifiableList(fulfillmentMessages_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.fulfillmentMessages_ = fulfillmentMessages_;
} else {
result.fulfillmentMessages_ = fulfillmentMessagesBuilder_.build();
}
result.source_ = source_;
if (payloadBuilder_ == null) {
result.payload_ = payload_;
} else {
result.payload_ = payloadBuilder_.build();
}
if (outputContextsBuilder_ == null) {
if (((bitField0_ & 0x00000010) == 0x00000010)) {
outputContexts_ = java.util.Collections.unmodifiableList(outputContexts_);
bitField0_ = (bitField0_ & ~0x00000010);
}
result.outputContexts_ = outputContexts_;
} else {
result.outputContexts_ = outputContextsBuilder_.build();
}
if (followupEventInputBuilder_ == null) {
result.followupEventInput_ = followupEventInput_;
} else {
result.followupEventInput_ = followupEventInputBuilder_.build();
}
result.bitField0_ = to_bitField0_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.v2.WebhookResponse) {
return mergeFrom((com.google.cloud.dialogflow.v2.WebhookResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.dialogflow.v2.WebhookResponse other) {
if (other == com.google.cloud.dialogflow.v2.WebhookResponse.getDefaultInstance()) return this;
if (!other.getFulfillmentText().isEmpty()) {
fulfillmentText_ = other.fulfillmentText_;
onChanged();
}
if (fulfillmentMessagesBuilder_ == null) {
if (!other.fulfillmentMessages_.isEmpty()) {
if (fulfillmentMessages_.isEmpty()) {
fulfillmentMessages_ = other.fulfillmentMessages_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.addAll(other.fulfillmentMessages_);
}
onChanged();
}
} else {
if (!other.fulfillmentMessages_.isEmpty()) {
if (fulfillmentMessagesBuilder_.isEmpty()) {
fulfillmentMessagesBuilder_.dispose();
fulfillmentMessagesBuilder_ = null;
fulfillmentMessages_ = other.fulfillmentMessages_;
bitField0_ = (bitField0_ & ~0x00000002);
fulfillmentMessagesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getFulfillmentMessagesFieldBuilder() : null;
} else {
fulfillmentMessagesBuilder_.addAllMessages(other.fulfillmentMessages_);
}
}
}
if (!other.getSource().isEmpty()) {
source_ = other.source_;
onChanged();
}
if (other.hasPayload()) {
mergePayload(other.getPayload());
}
if (outputContextsBuilder_ == null) {
if (!other.outputContexts_.isEmpty()) {
if (outputContexts_.isEmpty()) {
outputContexts_ = other.outputContexts_;
bitField0_ = (bitField0_ & ~0x00000010);
} else {
ensureOutputContextsIsMutable();
outputContexts_.addAll(other.outputContexts_);
}
onChanged();
}
} else {
if (!other.outputContexts_.isEmpty()) {
if (outputContextsBuilder_.isEmpty()) {
outputContextsBuilder_.dispose();
outputContextsBuilder_ = null;
outputContexts_ = other.outputContexts_;
bitField0_ = (bitField0_ & ~0x00000010);
outputContextsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
getOutputContextsFieldBuilder() : null;
} else {
outputContextsBuilder_.addAllMessages(other.outputContexts_);
}
}
}
if (other.hasFollowupEventInput()) {
mergeFollowupEventInput(other.getFollowupEventInput());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.dialogflow.v2.WebhookResponse parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.google.cloud.dialogflow.v2.WebhookResponse) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.lang.Object fulfillmentText_ = "";
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public java.lang.String getFulfillmentText() {
java.lang.Object ref = fulfillmentText_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
fulfillmentText_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public com.google.protobuf.ByteString
getFulfillmentTextBytes() {
java.lang.Object ref = fulfillmentText_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
fulfillmentText_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public Builder setFulfillmentText(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
fulfillmentText_ = value;
onChanged();
return this;
}
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public Builder clearFulfillmentText() {
fulfillmentText_ = getDefaultInstance().getFulfillmentText();
onChanged();
return this;
}
/**
*
* Optional. The text to be shown on the screen. This value is passed directly
* to `QueryResult.fulfillment_text`.
*
*
* string fulfillment_text = 1;
*/
public Builder setFulfillmentTextBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
fulfillmentText_ = value;
onChanged();
return this;
}
private java.util.List fulfillmentMessages_ =
java.util.Collections.emptyList();
private void ensureFulfillmentMessagesIsMutable() {
if (!((bitField0_ & 0x00000002) == 0x00000002)) {
fulfillmentMessages_ = new java.util.ArrayList(fulfillmentMessages_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.Intent.Message, com.google.cloud.dialogflow.v2.Intent.Message.Builder, com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder> fulfillmentMessagesBuilder_;
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public java.util.List getFulfillmentMessagesList() {
if (fulfillmentMessagesBuilder_ == null) {
return java.util.Collections.unmodifiableList(fulfillmentMessages_);
} else {
return fulfillmentMessagesBuilder_.getMessageList();
}
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public int getFulfillmentMessagesCount() {
if (fulfillmentMessagesBuilder_ == null) {
return fulfillmentMessages_.size();
} else {
return fulfillmentMessagesBuilder_.getCount();
}
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.Message getFulfillmentMessages(int index) {
if (fulfillmentMessagesBuilder_ == null) {
return fulfillmentMessages_.get(index);
} else {
return fulfillmentMessagesBuilder_.getMessage(index);
}
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder setFulfillmentMessages(
int index, com.google.cloud.dialogflow.v2.Intent.Message value) {
if (fulfillmentMessagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.set(index, value);
onChanged();
} else {
fulfillmentMessagesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder setFulfillmentMessages(
int index, com.google.cloud.dialogflow.v2.Intent.Message.Builder builderForValue) {
if (fulfillmentMessagesBuilder_ == null) {
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.set(index, builderForValue.build());
onChanged();
} else {
fulfillmentMessagesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder addFulfillmentMessages(com.google.cloud.dialogflow.v2.Intent.Message value) {
if (fulfillmentMessagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.add(value);
onChanged();
} else {
fulfillmentMessagesBuilder_.addMessage(value);
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder addFulfillmentMessages(
int index, com.google.cloud.dialogflow.v2.Intent.Message value) {
if (fulfillmentMessagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.add(index, value);
onChanged();
} else {
fulfillmentMessagesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder addFulfillmentMessages(
com.google.cloud.dialogflow.v2.Intent.Message.Builder builderForValue) {
if (fulfillmentMessagesBuilder_ == null) {
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.add(builderForValue.build());
onChanged();
} else {
fulfillmentMessagesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder addFulfillmentMessages(
int index, com.google.cloud.dialogflow.v2.Intent.Message.Builder builderForValue) {
if (fulfillmentMessagesBuilder_ == null) {
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.add(index, builderForValue.build());
onChanged();
} else {
fulfillmentMessagesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder addAllFulfillmentMessages(
java.lang.Iterable extends com.google.cloud.dialogflow.v2.Intent.Message> values) {
if (fulfillmentMessagesBuilder_ == null) {
ensureFulfillmentMessagesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, fulfillmentMessages_);
onChanged();
} else {
fulfillmentMessagesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder clearFulfillmentMessages() {
if (fulfillmentMessagesBuilder_ == null) {
fulfillmentMessages_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
fulfillmentMessagesBuilder_.clear();
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public Builder removeFulfillmentMessages(int index) {
if (fulfillmentMessagesBuilder_ == null) {
ensureFulfillmentMessagesIsMutable();
fulfillmentMessages_.remove(index);
onChanged();
} else {
fulfillmentMessagesBuilder_.remove(index);
}
return this;
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.Message.Builder getFulfillmentMessagesBuilder(
int index) {
return getFulfillmentMessagesFieldBuilder().getBuilder(index);
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder getFulfillmentMessagesOrBuilder(
int index) {
if (fulfillmentMessagesBuilder_ == null) {
return fulfillmentMessages_.get(index); } else {
return fulfillmentMessagesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public java.util.List extends com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder>
getFulfillmentMessagesOrBuilderList() {
if (fulfillmentMessagesBuilder_ != null) {
return fulfillmentMessagesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(fulfillmentMessages_);
}
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.Message.Builder addFulfillmentMessagesBuilder() {
return getFulfillmentMessagesFieldBuilder().addBuilder(
com.google.cloud.dialogflow.v2.Intent.Message.getDefaultInstance());
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public com.google.cloud.dialogflow.v2.Intent.Message.Builder addFulfillmentMessagesBuilder(
int index) {
return getFulfillmentMessagesFieldBuilder().addBuilder(
index, com.google.cloud.dialogflow.v2.Intent.Message.getDefaultInstance());
}
/**
*
* Optional. The collection of rich messages to present to the user. This
* value is passed directly to `QueryResult.fulfillment_messages`.
*
*
* repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 2;
*/
public java.util.List
getFulfillmentMessagesBuilderList() {
return getFulfillmentMessagesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.Intent.Message, com.google.cloud.dialogflow.v2.Intent.Message.Builder, com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder>
getFulfillmentMessagesFieldBuilder() {
if (fulfillmentMessagesBuilder_ == null) {
fulfillmentMessagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.Intent.Message, com.google.cloud.dialogflow.v2.Intent.Message.Builder, com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder>(
fulfillmentMessages_,
((bitField0_ & 0x00000002) == 0x00000002),
getParentForChildren(),
isClean());
fulfillmentMessages_ = null;
}
return fulfillmentMessagesBuilder_;
}
private java.lang.Object source_ = "";
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public java.lang.String getSource() {
java.lang.Object ref = source_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
source_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public com.google.protobuf.ByteString
getSourceBytes() {
java.lang.Object ref = source_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
source_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public Builder setSource(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
source_ = value;
onChanged();
return this;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public Builder clearSource() {
source_ = getDefaultInstance().getSource();
onChanged();
return this;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_source`.
*
*
* string source = 3;
*/
public Builder setSourceBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
source_ = value;
onChanged();
return this;
}
private com.google.protobuf.Struct payload_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> payloadBuilder_;
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public boolean hasPayload() {
return payloadBuilder_ != null || payload_ != null;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public com.google.protobuf.Struct getPayload() {
if (payloadBuilder_ == null) {
return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
} else {
return payloadBuilder_.getMessage();
}
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public Builder setPayload(com.google.protobuf.Struct value) {
if (payloadBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
payload_ = value;
onChanged();
} else {
payloadBuilder_.setMessage(value);
}
return this;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public Builder setPayload(
com.google.protobuf.Struct.Builder builderForValue) {
if (payloadBuilder_ == null) {
payload_ = builderForValue.build();
onChanged();
} else {
payloadBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public Builder mergePayload(com.google.protobuf.Struct value) {
if (payloadBuilder_ == null) {
if (payload_ != null) {
payload_ =
com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial();
} else {
payload_ = value;
}
onChanged();
} else {
payloadBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public Builder clearPayload() {
if (payloadBuilder_ == null) {
payload_ = null;
onChanged();
} else {
payload_ = null;
payloadBuilder_ = null;
}
return this;
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public com.google.protobuf.Struct.Builder getPayloadBuilder() {
onChanged();
return getPayloadFieldBuilder().getBuilder();
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() {
if (payloadBuilder_ != null) {
return payloadBuilder_.getMessageOrBuilder();
} else {
return payload_ == null ?
com.google.protobuf.Struct.getDefaultInstance() : payload_;
}
}
/**
*
* Optional. This value is passed directly to `QueryResult.webhook_payload`.
* See the related `fulfillment_messages[i].payload field`, which may be used
* as an alternative to this field.
* This field can be used for Actions on Google responses.
* It should have a structure similar to the JSON message shown here. For more
* information, see
* [Actions on Google Webhook
* Format](https://developers.google.com/actions/dialogflow/webhook)
* <pre>{
* "google": {
* "expectUserResponse": true,
* "richResponse": {
* "items": [
* {
* "simpleResponse": {
* "textToSpeech": "this is a simple response"
* }
* }
* ]
* }
* }
* }</pre>
*
*
* .google.protobuf.Struct payload = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>
getPayloadFieldBuilder() {
if (payloadBuilder_ == null) {
payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
getPayload(),
getParentForChildren(),
isClean());
payload_ = null;
}
return payloadBuilder_;
}
private java.util.List outputContexts_ =
java.util.Collections.emptyList();
private void ensureOutputContextsIsMutable() {
if (!((bitField0_ & 0x00000010) == 0x00000010)) {
outputContexts_ = new java.util.ArrayList(outputContexts_);
bitField0_ |= 0x00000010;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.Context, com.google.cloud.dialogflow.v2.Context.Builder, com.google.cloud.dialogflow.v2.ContextOrBuilder> outputContextsBuilder_;
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public java.util.List getOutputContextsList() {
if (outputContextsBuilder_ == null) {
return java.util.Collections.unmodifiableList(outputContexts_);
} else {
return outputContextsBuilder_.getMessageList();
}
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public int getOutputContextsCount() {
if (outputContextsBuilder_ == null) {
return outputContexts_.size();
} else {
return outputContextsBuilder_.getCount();
}
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.Context getOutputContexts(int index) {
if (outputContextsBuilder_ == null) {
return outputContexts_.get(index);
} else {
return outputContextsBuilder_.getMessage(index);
}
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder setOutputContexts(
int index, com.google.cloud.dialogflow.v2.Context value) {
if (outputContextsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOutputContextsIsMutable();
outputContexts_.set(index, value);
onChanged();
} else {
outputContextsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder setOutputContexts(
int index, com.google.cloud.dialogflow.v2.Context.Builder builderForValue) {
if (outputContextsBuilder_ == null) {
ensureOutputContextsIsMutable();
outputContexts_.set(index, builderForValue.build());
onChanged();
} else {
outputContextsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder addOutputContexts(com.google.cloud.dialogflow.v2.Context value) {
if (outputContextsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOutputContextsIsMutable();
outputContexts_.add(value);
onChanged();
} else {
outputContextsBuilder_.addMessage(value);
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder addOutputContexts(
int index, com.google.cloud.dialogflow.v2.Context value) {
if (outputContextsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureOutputContextsIsMutable();
outputContexts_.add(index, value);
onChanged();
} else {
outputContextsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder addOutputContexts(
com.google.cloud.dialogflow.v2.Context.Builder builderForValue) {
if (outputContextsBuilder_ == null) {
ensureOutputContextsIsMutable();
outputContexts_.add(builderForValue.build());
onChanged();
} else {
outputContextsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder addOutputContexts(
int index, com.google.cloud.dialogflow.v2.Context.Builder builderForValue) {
if (outputContextsBuilder_ == null) {
ensureOutputContextsIsMutable();
outputContexts_.add(index, builderForValue.build());
onChanged();
} else {
outputContextsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder addAllOutputContexts(
java.lang.Iterable extends com.google.cloud.dialogflow.v2.Context> values) {
if (outputContextsBuilder_ == null) {
ensureOutputContextsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, outputContexts_);
onChanged();
} else {
outputContextsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder clearOutputContexts() {
if (outputContextsBuilder_ == null) {
outputContexts_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
onChanged();
} else {
outputContextsBuilder_.clear();
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public Builder removeOutputContexts(int index) {
if (outputContextsBuilder_ == null) {
ensureOutputContextsIsMutable();
outputContexts_.remove(index);
onChanged();
} else {
outputContextsBuilder_.remove(index);
}
return this;
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.Context.Builder getOutputContextsBuilder(
int index) {
return getOutputContextsFieldBuilder().getBuilder(index);
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.ContextOrBuilder getOutputContextsOrBuilder(
int index) {
if (outputContextsBuilder_ == null) {
return outputContexts_.get(index); } else {
return outputContextsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public java.util.List extends com.google.cloud.dialogflow.v2.ContextOrBuilder>
getOutputContextsOrBuilderList() {
if (outputContextsBuilder_ != null) {
return outputContextsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(outputContexts_);
}
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.Context.Builder addOutputContextsBuilder() {
return getOutputContextsFieldBuilder().addBuilder(
com.google.cloud.dialogflow.v2.Context.getDefaultInstance());
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public com.google.cloud.dialogflow.v2.Context.Builder addOutputContextsBuilder(
int index) {
return getOutputContextsFieldBuilder().addBuilder(
index, com.google.cloud.dialogflow.v2.Context.getDefaultInstance());
}
/**
*
* Optional. The collection of output contexts. This value is passed directly
* to `QueryResult.output_contexts`.
*
*
* repeated .google.cloud.dialogflow.v2.Context output_contexts = 5;
*/
public java.util.List
getOutputContextsBuilderList() {
return getOutputContextsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.Context, com.google.cloud.dialogflow.v2.Context.Builder, com.google.cloud.dialogflow.v2.ContextOrBuilder>
getOutputContextsFieldBuilder() {
if (outputContextsBuilder_ == null) {
outputContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.dialogflow.v2.Context, com.google.cloud.dialogflow.v2.Context.Builder, com.google.cloud.dialogflow.v2.ContextOrBuilder>(
outputContexts_,
((bitField0_ & 0x00000010) == 0x00000010),
getParentForChildren(),
isClean());
outputContexts_ = null;
}
return outputContextsBuilder_;
}
private com.google.cloud.dialogflow.v2.EventInput followupEventInput_ = null;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.v2.EventInput, com.google.cloud.dialogflow.v2.EventInput.Builder, com.google.cloud.dialogflow.v2.EventInputOrBuilder> followupEventInputBuilder_;
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public boolean hasFollowupEventInput() {
return followupEventInputBuilder_ != null || followupEventInput_ != null;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public com.google.cloud.dialogflow.v2.EventInput getFollowupEventInput() {
if (followupEventInputBuilder_ == null) {
return followupEventInput_ == null ? com.google.cloud.dialogflow.v2.EventInput.getDefaultInstance() : followupEventInput_;
} else {
return followupEventInputBuilder_.getMessage();
}
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public Builder setFollowupEventInput(com.google.cloud.dialogflow.v2.EventInput value) {
if (followupEventInputBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
followupEventInput_ = value;
onChanged();
} else {
followupEventInputBuilder_.setMessage(value);
}
return this;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public Builder setFollowupEventInput(
com.google.cloud.dialogflow.v2.EventInput.Builder builderForValue) {
if (followupEventInputBuilder_ == null) {
followupEventInput_ = builderForValue.build();
onChanged();
} else {
followupEventInputBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public Builder mergeFollowupEventInput(com.google.cloud.dialogflow.v2.EventInput value) {
if (followupEventInputBuilder_ == null) {
if (followupEventInput_ != null) {
followupEventInput_ =
com.google.cloud.dialogflow.v2.EventInput.newBuilder(followupEventInput_).mergeFrom(value).buildPartial();
} else {
followupEventInput_ = value;
}
onChanged();
} else {
followupEventInputBuilder_.mergeFrom(value);
}
return this;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public Builder clearFollowupEventInput() {
if (followupEventInputBuilder_ == null) {
followupEventInput_ = null;
onChanged();
} else {
followupEventInput_ = null;
followupEventInputBuilder_ = null;
}
return this;
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public com.google.cloud.dialogflow.v2.EventInput.Builder getFollowupEventInputBuilder() {
onChanged();
return getFollowupEventInputFieldBuilder().getBuilder();
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
public com.google.cloud.dialogflow.v2.EventInputOrBuilder getFollowupEventInputOrBuilder() {
if (followupEventInputBuilder_ != null) {
return followupEventInputBuilder_.getMessageOrBuilder();
} else {
return followupEventInput_ == null ?
com.google.cloud.dialogflow.v2.EventInput.getDefaultInstance() : followupEventInput_;
}
}
/**
*
* Optional. Makes the platform immediately invoke another `DetectIntent` call
* internally with the specified event as input.
*
*
* .google.cloud.dialogflow.v2.EventInput followup_event_input = 6;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.v2.EventInput, com.google.cloud.dialogflow.v2.EventInput.Builder, com.google.cloud.dialogflow.v2.EventInputOrBuilder>
getFollowupEventInputFieldBuilder() {
if (followupEventInputBuilder_ == null) {
followupEventInputBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.v2.EventInput, com.google.cloud.dialogflow.v2.EventInput.Builder, com.google.cloud.dialogflow.v2.EventInputOrBuilder>(
getFollowupEventInput(),
getParentForChildren(),
isClean());
followupEventInput_ = null;
}
return followupEventInputBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.WebhookResponse)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.WebhookResponse)
private static final com.google.cloud.dialogflow.v2.WebhookResponse DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.WebhookResponse();
}
public static com.google.cloud.dialogflow.v2.WebhookResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
public WebhookResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new WebhookResponse(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
public com.google.cloud.dialogflow.v2.WebhookResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}