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