com.google.cloud.dialogflow.v2.ConversationEvent 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
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/dialogflow/v2/conversation_event.proto
// Protobuf Java Version: 3.25.5
package com.google.cloud.dialogflow.v2;
/**
*
*
*
* Represents a notification sent to Pub/Sub subscribers for conversation
* lifecycle events.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.ConversationEvent}
*/
public final class ConversationEvent extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.ConversationEvent)
ConversationEventOrBuilder {
private static final long serialVersionUID = 0L;
// Use ConversationEvent.newBuilder() to construct.
private ConversationEvent(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ConversationEvent() {
conversation_ = "";
type_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new ConversationEvent();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationEventProto
.internal_static_google_cloud_dialogflow_v2_ConversationEvent_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.ConversationEventProto
.internal_static_google_cloud_dialogflow_v2_ConversationEvent_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.ConversationEvent.class,
com.google.cloud.dialogflow.v2.ConversationEvent.Builder.class);
}
/**
*
*
*
* Enumeration of the types of events available.
*
*
* Protobuf enum {@code google.cloud.dialogflow.v2.ConversationEvent.Type}
*/
public enum Type implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* Type not set.
*
*
* TYPE_UNSPECIFIED = 0;
*/
TYPE_UNSPECIFIED(0),
/**
*
*
*
* A new conversation has been opened. This is fired when a telephone call
* is answered, or a conversation is created via the API.
*
*
* CONVERSATION_STARTED = 1;
*/
CONVERSATION_STARTED(1),
/**
*
*
*
* An existing conversation has closed. This is fired when a telephone call
* is terminated, or a conversation is closed via the API.
*
*
* CONVERSATION_FINISHED = 2;
*/
CONVERSATION_FINISHED(2),
/**
*
*
*
* An existing conversation has received notification from Dialogflow that
* human intervention is required.
*
*
* HUMAN_INTERVENTION_NEEDED = 3;
*/
HUMAN_INTERVENTION_NEEDED(3),
/**
*
*
*
* An existing conversation has received a new message, either from API or
* telephony. It is configured in
* [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config]
*
*
* NEW_MESSAGE = 5;
*/
NEW_MESSAGE(5),
/**
*
*
*
* Unrecoverable error during a telephone call.
*
* In general non-recoverable errors only occur if something was
* misconfigured in the ConversationProfile corresponding to the call. After
* a non-recoverable error, Dialogflow may stop responding.
*
* We don't fire this event:
*
* * in an API call because we can directly return the error, or,
* * when we can recover from an error.
*
*
* UNRECOVERABLE_ERROR = 4;
*/
UNRECOVERABLE_ERROR(4),
UNRECOGNIZED(-1),
;
/**
*
*
*
* Type not set.
*
*
* TYPE_UNSPECIFIED = 0;
*/
public static final int TYPE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* A new conversation has been opened. This is fired when a telephone call
* is answered, or a conversation is created via the API.
*
*
* CONVERSATION_STARTED = 1;
*/
public static final int CONVERSATION_STARTED_VALUE = 1;
/**
*
*
*
* An existing conversation has closed. This is fired when a telephone call
* is terminated, or a conversation is closed via the API.
*
*
* CONVERSATION_FINISHED = 2;
*/
public static final int CONVERSATION_FINISHED_VALUE = 2;
/**
*
*
*
* An existing conversation has received notification from Dialogflow that
* human intervention is required.
*
*
* HUMAN_INTERVENTION_NEEDED = 3;
*/
public static final int HUMAN_INTERVENTION_NEEDED_VALUE = 3;
/**
*
*
*
* An existing conversation has received a new message, either from API or
* telephony. It is configured in
* [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config]
*
*
* NEW_MESSAGE = 5;
*/
public static final int NEW_MESSAGE_VALUE = 5;
/**
*
*
*
* Unrecoverable error during a telephone call.
*
* In general non-recoverable errors only occur if something was
* misconfigured in the ConversationProfile corresponding to the call. After
* a non-recoverable error, Dialogflow may stop responding.
*
* We don't fire this event:
*
* * in an API call because we can directly return the error, or,
* * when we can recover from an error.
*
*
* UNRECOVERABLE_ERROR = 4;
*/
public static final int UNRECOVERABLE_ERROR_VALUE = 4;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Type valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Type forNumber(int value) {
switch (value) {
case 0:
return TYPE_UNSPECIFIED;
case 1:
return CONVERSATION_STARTED;
case 2:
return CONVERSATION_FINISHED;
case 3:
return HUMAN_INTERVENTION_NEEDED;
case 5:
return NEW_MESSAGE;
case 4:
return UNRECOVERABLE_ERROR;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Type findValueByNumber(int number) {
return Type.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationEvent.getDescriptor().getEnumTypes().get(0);
}
private static final Type[] VALUES = values();
public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Type(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.v2.ConversationEvent.Type)
}
private int bitField0_;
private int payloadCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object payload_;
public enum PayloadCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
NEW_MESSAGE_PAYLOAD(4),
PAYLOAD_NOT_SET(0);
private final int value;
private PayloadCase(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 PayloadCase valueOf(int value) {
return forNumber(value);
}
public static PayloadCase forNumber(int value) {
switch (value) {
case 4:
return NEW_MESSAGE_PAYLOAD;
case 0:
return PAYLOAD_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public PayloadCase getPayloadCase() {
return PayloadCase.forNumber(payloadCase_);
}
public static final int CONVERSATION_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object conversation_ = "";
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @return The conversation.
*/
@java.lang.Override
public java.lang.String getConversation() {
java.lang.Object ref = conversation_;
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();
conversation_ = s;
return s;
}
}
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @return The bytes for conversation.
*/
@java.lang.Override
public com.google.protobuf.ByteString getConversationBytes() {
java.lang.Object ref = conversation_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
conversation_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 2;
private int type_ = 0;
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.ConversationEvent.Type getType() {
com.google.cloud.dialogflow.v2.ConversationEvent.Type result =
com.google.cloud.dialogflow.v2.ConversationEvent.Type.forNumber(type_);
return result == null
? com.google.cloud.dialogflow.v2.ConversationEvent.Type.UNRECOGNIZED
: result;
}
public static final int ERROR_STATUS_FIELD_NUMBER = 3;
private com.google.rpc.Status errorStatus_;
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*
* @return Whether the errorStatus field is set.
*/
@java.lang.Override
public boolean hasErrorStatus() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*
* @return The errorStatus.
*/
@java.lang.Override
public com.google.rpc.Status getErrorStatus() {
return errorStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : errorStatus_;
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
@java.lang.Override
public com.google.rpc.StatusOrBuilder getErrorStatusOrBuilder() {
return errorStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : errorStatus_;
}
public static final int NEW_MESSAGE_PAYLOAD_FIELD_NUMBER = 4;
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*
* @return Whether the newMessagePayload field is set.
*/
@java.lang.Override
public boolean hasNewMessagePayload() {
return payloadCase_ == 4;
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*
* @return The newMessagePayload.
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.Message getNewMessagePayload() {
if (payloadCase_ == 4) {
return (com.google.cloud.dialogflow.v2.Message) payload_;
}
return com.google.cloud.dialogflow.v2.Message.getDefaultInstance();
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.MessageOrBuilder getNewMessagePayloadOrBuilder() {
if (payloadCase_ == 4) {
return (com.google.cloud.dialogflow.v2.Message) payload_;
}
return com.google.cloud.dialogflow.v2.Message.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(conversation_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, conversation_);
}
if (type_
!= com.google.cloud.dialogflow.v2.ConversationEvent.Type.TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(2, type_);
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(3, getErrorStatus());
}
if (payloadCase_ == 4) {
output.writeMessage(4, (com.google.cloud.dialogflow.v2.Message) payload_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(conversation_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, conversation_);
}
if (type_
!= com.google.cloud.dialogflow.v2.ConversationEvent.Type.TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_);
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getErrorStatus());
}
if (payloadCase_ == 4) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
4, (com.google.cloud.dialogflow.v2.Message) payload_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.dialogflow.v2.ConversationEvent)) {
return super.equals(obj);
}
com.google.cloud.dialogflow.v2.ConversationEvent other =
(com.google.cloud.dialogflow.v2.ConversationEvent) obj;
if (!getConversation().equals(other.getConversation())) return false;
if (type_ != other.type_) return false;
if (hasErrorStatus() != other.hasErrorStatus()) return false;
if (hasErrorStatus()) {
if (!getErrorStatus().equals(other.getErrorStatus())) return false;
}
if (!getPayloadCase().equals(other.getPayloadCase())) return false;
switch (payloadCase_) {
case 4:
if (!getNewMessagePayload().equals(other.getNewMessagePayload())) return false;
break;
case 0:
default:
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + CONVERSATION_FIELD_NUMBER;
hash = (53 * hash) + getConversation().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
if (hasErrorStatus()) {
hash = (37 * hash) + ERROR_STATUS_FIELD_NUMBER;
hash = (53 * hash) + getErrorStatus().hashCode();
}
switch (payloadCase_) {
case 4:
hash = (37 * hash) + NEW_MESSAGE_PAYLOAD_FIELD_NUMBER;
hash = (53 * hash) + getNewMessagePayload().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.dialogflow.v2.ConversationEvent parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.ConversationEvent 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.ConversationEvent parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.ConversationEvent 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.ConversationEvent parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.dialogflow.v2.ConversationEvent 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.ConversationEvent parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.ConversationEvent 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.ConversationEvent parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.dialogflow.v2.ConversationEvent 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.ConversationEvent 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.ConversationEvent parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.dialogflow.v2.ConversationEvent 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;
}
/**
*
*
*
* Represents a notification sent to Pub/Sub subscribers for conversation
* lifecycle events.
*
*
* Protobuf type {@code google.cloud.dialogflow.v2.ConversationEvent}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.ConversationEvent)
com.google.cloud.dialogflow.v2.ConversationEventOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.dialogflow.v2.ConversationEventProto
.internal_static_google_cloud_dialogflow_v2_ConversationEvent_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.dialogflow.v2.ConversationEventProto
.internal_static_google_cloud_dialogflow_v2_ConversationEvent_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.dialogflow.v2.ConversationEvent.class,
com.google.cloud.dialogflow.v2.ConversationEvent.Builder.class);
}
// Construct using com.google.cloud.dialogflow.v2.ConversationEvent.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getErrorStatusFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
conversation_ = "";
type_ = 0;
errorStatus_ = null;
if (errorStatusBuilder_ != null) {
errorStatusBuilder_.dispose();
errorStatusBuilder_ = null;
}
if (newMessagePayloadBuilder_ != null) {
newMessagePayloadBuilder_.clear();
}
payloadCase_ = 0;
payload_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.dialogflow.v2.ConversationEventProto
.internal_static_google_cloud_dialogflow_v2_ConversationEvent_descriptor;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.ConversationEvent getDefaultInstanceForType() {
return com.google.cloud.dialogflow.v2.ConversationEvent.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.ConversationEvent build() {
com.google.cloud.dialogflow.v2.ConversationEvent result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.ConversationEvent buildPartial() {
com.google.cloud.dialogflow.v2.ConversationEvent result =
new com.google.cloud.dialogflow.v2.ConversationEvent(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.google.cloud.dialogflow.v2.ConversationEvent result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.conversation_ = conversation_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.type_ = type_;
}
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000004) != 0)) {
result.errorStatus_ =
errorStatusBuilder_ == null ? errorStatus_ : errorStatusBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
private void buildPartialOneofs(com.google.cloud.dialogflow.v2.ConversationEvent result) {
result.payloadCase_ = payloadCase_;
result.payload_ = this.payload_;
if (payloadCase_ == 4 && newMessagePayloadBuilder_ != null) {
result.payload_ = newMessagePayloadBuilder_.build();
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.dialogflow.v2.ConversationEvent) {
return mergeFrom((com.google.cloud.dialogflow.v2.ConversationEvent) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.dialogflow.v2.ConversationEvent other) {
if (other == com.google.cloud.dialogflow.v2.ConversationEvent.getDefaultInstance())
return this;
if (!other.getConversation().isEmpty()) {
conversation_ = other.conversation_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.hasErrorStatus()) {
mergeErrorStatus(other.getErrorStatus());
}
switch (other.getPayloadCase()) {
case NEW_MESSAGE_PAYLOAD:
{
mergeNewMessagePayload(other.getNewMessagePayload());
break;
}
case PAYLOAD_NOT_SET:
{
break;
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
conversation_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 16:
{
type_ = input.readEnum();
bitField0_ |= 0x00000002;
break;
} // case 16
case 26:
{
input.readMessage(getErrorStatusFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 26
case 34:
{
input.readMessage(
getNewMessagePayloadFieldBuilder().getBuilder(), extensionRegistry);
payloadCase_ = 4;
break;
} // case 34
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int payloadCase_ = 0;
private java.lang.Object payload_;
public PayloadCase getPayloadCase() {
return PayloadCase.forNumber(payloadCase_);
}
public Builder clearPayload() {
payloadCase_ = 0;
payload_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object conversation_ = "";
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @return The conversation.
*/
public java.lang.String getConversation() {
java.lang.Object ref = conversation_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
conversation_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @return The bytes for conversation.
*/
public com.google.protobuf.ByteString getConversationBytes() {
java.lang.Object ref = conversation_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
conversation_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @param value The conversation to set.
* @return This builder for chaining.
*/
public Builder setConversation(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
conversation_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @return This builder for chaining.
*/
public Builder clearConversation() {
conversation_ = getDefaultInstance().getConversation();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* The unique identifier of the conversation this notification
* refers to.
* Format: `projects/<Project ID>/conversations/<Conversation ID>`.
*
*
* string conversation = 1;
*
* @param value The bytes for conversation to set.
* @return This builder for chaining.
*/
public Builder setConversationBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
conversation_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private int type_ = 0;
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @param value The enum numeric value on the wire for type to set.
* @return This builder for chaining.
*/
public Builder setTypeValue(int value) {
type_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.ConversationEvent.Type getType() {
com.google.cloud.dialogflow.v2.ConversationEvent.Type result =
com.google.cloud.dialogflow.v2.ConversationEvent.Type.forNumber(type_);
return result == null
? com.google.cloud.dialogflow.v2.ConversationEvent.Type.UNRECOGNIZED
: result;
}
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(com.google.cloud.dialogflow.v2.ConversationEvent.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000002;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The type of the event that this notification refers to.
*
*
* .google.cloud.dialogflow.v2.ConversationEvent.Type type = 2;
*
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000002);
type_ = 0;
onChanged();
return this;
}
private com.google.rpc.Status errorStatus_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
errorStatusBuilder_;
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*
* @return Whether the errorStatus field is set.
*/
public boolean hasErrorStatus() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*
* @return The errorStatus.
*/
public com.google.rpc.Status getErrorStatus() {
if (errorStatusBuilder_ == null) {
return errorStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : errorStatus_;
} else {
return errorStatusBuilder_.getMessage();
}
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
public Builder setErrorStatus(com.google.rpc.Status value) {
if (errorStatusBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
errorStatus_ = value;
} else {
errorStatusBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
public Builder setErrorStatus(com.google.rpc.Status.Builder builderForValue) {
if (errorStatusBuilder_ == null) {
errorStatus_ = builderForValue.build();
} else {
errorStatusBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
public Builder mergeErrorStatus(com.google.rpc.Status value) {
if (errorStatusBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)
&& errorStatus_ != null
&& errorStatus_ != com.google.rpc.Status.getDefaultInstance()) {
getErrorStatusBuilder().mergeFrom(value);
} else {
errorStatus_ = value;
}
} else {
errorStatusBuilder_.mergeFrom(value);
}
if (errorStatus_ != null) {
bitField0_ |= 0x00000004;
onChanged();
}
return this;
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
public Builder clearErrorStatus() {
bitField0_ = (bitField0_ & ~0x00000004);
errorStatus_ = null;
if (errorStatusBuilder_ != null) {
errorStatusBuilder_.dispose();
errorStatusBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
public com.google.rpc.Status.Builder getErrorStatusBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getErrorStatusFieldBuilder().getBuilder();
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
public com.google.rpc.StatusOrBuilder getErrorStatusOrBuilder() {
if (errorStatusBuilder_ != null) {
return errorStatusBuilder_.getMessageOrBuilder();
} else {
return errorStatus_ == null ? com.google.rpc.Status.getDefaultInstance() : errorStatus_;
}
}
/**
*
*
*
* More detailed information about an error. Only set for type
* UNRECOVERABLE_ERROR_IN_PHONE_CALL.
*
*
* .google.rpc.Status error_status = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
getErrorStatusFieldBuilder() {
if (errorStatusBuilder_ == null) {
errorStatusBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.rpc.Status,
com.google.rpc.Status.Builder,
com.google.rpc.StatusOrBuilder>(
getErrorStatus(), getParentForChildren(), isClean());
errorStatus_ = null;
}
return errorStatusBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.v2.Message,
com.google.cloud.dialogflow.v2.Message.Builder,
com.google.cloud.dialogflow.v2.MessageOrBuilder>
newMessagePayloadBuilder_;
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*
* @return Whether the newMessagePayload field is set.
*/
@java.lang.Override
public boolean hasNewMessagePayload() {
return payloadCase_ == 4;
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*
* @return The newMessagePayload.
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.Message getNewMessagePayload() {
if (newMessagePayloadBuilder_ == null) {
if (payloadCase_ == 4) {
return (com.google.cloud.dialogflow.v2.Message) payload_;
}
return com.google.cloud.dialogflow.v2.Message.getDefaultInstance();
} else {
if (payloadCase_ == 4) {
return newMessagePayloadBuilder_.getMessage();
}
return com.google.cloud.dialogflow.v2.Message.getDefaultInstance();
}
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
public Builder setNewMessagePayload(com.google.cloud.dialogflow.v2.Message value) {
if (newMessagePayloadBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
payload_ = value;
onChanged();
} else {
newMessagePayloadBuilder_.setMessage(value);
}
payloadCase_ = 4;
return this;
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
public Builder setNewMessagePayload(
com.google.cloud.dialogflow.v2.Message.Builder builderForValue) {
if (newMessagePayloadBuilder_ == null) {
payload_ = builderForValue.build();
onChanged();
} else {
newMessagePayloadBuilder_.setMessage(builderForValue.build());
}
payloadCase_ = 4;
return this;
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
public Builder mergeNewMessagePayload(com.google.cloud.dialogflow.v2.Message value) {
if (newMessagePayloadBuilder_ == null) {
if (payloadCase_ == 4
&& payload_ != com.google.cloud.dialogflow.v2.Message.getDefaultInstance()) {
payload_ =
com.google.cloud.dialogflow.v2.Message.newBuilder(
(com.google.cloud.dialogflow.v2.Message) payload_)
.mergeFrom(value)
.buildPartial();
} else {
payload_ = value;
}
onChanged();
} else {
if (payloadCase_ == 4) {
newMessagePayloadBuilder_.mergeFrom(value);
} else {
newMessagePayloadBuilder_.setMessage(value);
}
}
payloadCase_ = 4;
return this;
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
public Builder clearNewMessagePayload() {
if (newMessagePayloadBuilder_ == null) {
if (payloadCase_ == 4) {
payloadCase_ = 0;
payload_ = null;
onChanged();
}
} else {
if (payloadCase_ == 4) {
payloadCase_ = 0;
payload_ = null;
}
newMessagePayloadBuilder_.clear();
}
return this;
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
public com.google.cloud.dialogflow.v2.Message.Builder getNewMessagePayloadBuilder() {
return getNewMessagePayloadFieldBuilder().getBuilder();
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
@java.lang.Override
public com.google.cloud.dialogflow.v2.MessageOrBuilder getNewMessagePayloadOrBuilder() {
if ((payloadCase_ == 4) && (newMessagePayloadBuilder_ != null)) {
return newMessagePayloadBuilder_.getMessageOrBuilder();
} else {
if (payloadCase_ == 4) {
return (com.google.cloud.dialogflow.v2.Message) payload_;
}
return com.google.cloud.dialogflow.v2.Message.getDefaultInstance();
}
}
/**
*
*
*
* Payload of NEW_MESSAGE event.
*
*
* .google.cloud.dialogflow.v2.Message new_message_payload = 4;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.v2.Message,
com.google.cloud.dialogflow.v2.Message.Builder,
com.google.cloud.dialogflow.v2.MessageOrBuilder>
getNewMessagePayloadFieldBuilder() {
if (newMessagePayloadBuilder_ == null) {
if (!(payloadCase_ == 4)) {
payload_ = com.google.cloud.dialogflow.v2.Message.getDefaultInstance();
}
newMessagePayloadBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.dialogflow.v2.Message,
com.google.cloud.dialogflow.v2.Message.Builder,
com.google.cloud.dialogflow.v2.MessageOrBuilder>(
(com.google.cloud.dialogflow.v2.Message) payload_,
getParentForChildren(),
isClean());
payload_ = null;
}
payloadCase_ = 4;
onChanged();
return newMessagePayloadBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.ConversationEvent)
}
// @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2.ConversationEvent)
private static final com.google.cloud.dialogflow.v2.ConversationEvent DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2.ConversationEvent();
}
public static com.google.cloud.dialogflow.v2.ConversationEvent getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ConversationEvent parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.dialogflow.v2.ConversationEvent getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy