// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/webhook.proto

package com.google.cloud.dialogflow.v2beta1;

/**
 * <pre>
 * The response message for a webhook call.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dialogflow.v2beta1.WebhookResponse}
 */
public  final class WebhookResponse extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2beta1.WebhookResponse)
    WebhookResponseOrBuilder {
private static final long serialVersionUID = 0L;
  // Use WebhookResponse.newBuilder() to construct.
  private WebhookResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private WebhookResponse() {
    fulfillmentText_ = "";
    fulfillmentMessages_ = java.util.Collections.emptyList();
    source_ = "";
    outputContexts_ = java.util.Collections.emptyList();
    endInteraction_ = false;
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private WebhookResponse(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            fulfillmentText_ = s;
            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
              fulfillmentMessages_ = new java.util.ArrayList<com.google.cloud.dialogflow.v2beta1.Intent.Message>();
              mutable_bitField0_ |= 0x00000002;
            }
            fulfillmentMessages_.add(
                input.readMessage(com.google.cloud.dialogflow.v2beta1.Intent.Message.parser(), extensionRegistry));
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

            source_ = s;
            break;
          }
          case 34: {
            com.google.protobuf.Struct.Builder subBuilder = null;
            if (payload_ != null) {
              subBuilder = payload_.toBuilder();
            }
            payload_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(payload_);
              payload_ = subBuilder.buildPartial();
            }

            break;
          }
          case 42: {
            if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
              outputContexts_ = new java.util.ArrayList<com.google.cloud.dialogflow.v2beta1.Context>();
              mutable_bitField0_ |= 0x00000010;
            }
            outputContexts_.add(
                input.readMessage(com.google.cloud.dialogflow.v2beta1.Context.parser(), extensionRegistry));
            break;
          }
          case 50: {
            com.google.cloud.dialogflow.v2beta1.EventInput.Builder subBuilder = null;
            if (followupEventInput_ != null) {
              subBuilder = followupEventInput_.toBuilder();
            }
            followupEventInput_ = input.readMessage(com.google.cloud.dialogflow.v2beta1.EventInput.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(followupEventInput_);
              followupEventInput_ = subBuilder.buildPartial();
            }

            break;
          }
          case 64: {

            endInteraction_ = input.readBool();
            break;
          }
          default: {
            if (!parseUnknownFieldProto3(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
        fulfillmentMessages_ = java.util.Collections.unmodifiableList(fulfillmentMessages_);
      }
      if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
        outputContexts_ = java.util.Collections.unmodifiableList(outputContexts_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.dialogflow.v2beta1.WebhookProto.internal_static_google_cloud_dialogflow_v2beta1_WebhookResponse_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dialogflow.v2beta1.WebhookProto.internal_static_google_cloud_dialogflow_v2beta1_WebhookResponse_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dialogflow.v2beta1.WebhookResponse.class, com.google.cloud.dialogflow.v2beta1.WebhookResponse.Builder.class);
  }

  private int bitField0_;
  public static final int FULFILLMENT_TEXT_FIELD_NUMBER = 1;
  private volatile java.lang.Object fulfillmentText_;
  /**
   * <pre>
   * Optional. The text to be shown on the screen. This value is passed directly
   * to `QueryResult.fulfillment_text`.
   * </pre>
   *
   * <code>string fulfillment_text = 1;</code>
   */
  public java.lang.String getFulfillmentText() {
    java.lang.Object ref = fulfillmentText_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      fulfillmentText_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Optional. The text to be shown on the screen. This value is passed directly
   * to `QueryResult.fulfillment_text`.
   * </pre>
   *
   * <code>string fulfillment_text = 1;</code>
   */
  public com.google.protobuf.ByteString
      getFulfillmentTextBytes() {
    java.lang.Object ref = fulfillmentText_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      fulfillmentText_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int FULFILLMENT_MESSAGES_FIELD_NUMBER = 2;
  private java.util.List<com.google.cloud.dialogflow.v2beta1.Intent.Message> fulfillmentMessages_;
  /**
   * <pre>
   * Optional. The collection of rich messages to present to the user. This
   * value is passed directly to `QueryResult.fulfillment_messages`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
   */
  public java.util.List<com.google.cloud.dialogflow.v2beta1.Intent.Message> getFulfillmentMessagesList() {
    return fulfillmentMessages_;
  }
  /**
   * <pre>
   * Optional. The collection of rich messages to present to the user. This
   * value is passed directly to `QueryResult.fulfillment_messages`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
   */
  public java.util.List<? extends com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder> 
      getFulfillmentMessagesOrBuilderList() {
    return fulfillmentMessages_;
  }
  /**
   * <pre>
   * Optional. The collection of rich messages to present to the user. This
   * value is passed directly to `QueryResult.fulfillment_messages`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
   */
  public int getFulfillmentMessagesCount() {
    return fulfillmentMessages_.size();
  }
  /**
   * <pre>
   * Optional. The collection of rich messages to present to the user. This
   * value is passed directly to `QueryResult.fulfillment_messages`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
   */
  public com.google.cloud.dialogflow.v2beta1.Intent.Message getFulfillmentMessages(int index) {
    return fulfillmentMessages_.get(index);
  }
  /**
   * <pre>
   * Optional. The collection of rich messages to present to the user. This
   * value is passed directly to `QueryResult.fulfillment_messages`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
   */
  public com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder getFulfillmentMessagesOrBuilder(
      int index) {
    return fulfillmentMessages_.get(index);
  }

  public static final int SOURCE_FIELD_NUMBER = 3;
  private volatile java.lang.Object source_;
  /**
   * <pre>
   * Optional. This value is passed directly to `QueryResult.webhook_source`.
   * </pre>
   *
   * <code>string source = 3;</code>
   */
  public java.lang.String getSource() {
    java.lang.Object ref = source_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      source_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Optional. This value is passed directly to `QueryResult.webhook_source`.
   * </pre>
   *
   * <code>string source = 3;</code>
   */
  public com.google.protobuf.ByteString
      getSourceBytes() {
    java.lang.Object ref = source_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      source_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PAYLOAD_FIELD_NUMBER = 4;
  private com.google.protobuf.Struct payload_;
  /**
   * <pre>
   * Optional. This value is passed directly to `QueryResult.webhook_payload`.
   * See the related `fulfillment_messages[i].payload field`, which may be used
   * as an alternative to this field.
   * This field can be used for Actions on Google responses.
   * It should have a structure similar to the JSON message shown here. For more
   * information, see
   * [Actions on Google Webhook
   * Format](https://developers.google.com/actions/dialogflow/webhook)
   * &lt;pre&gt;{
   *   "google": {
   *     "expectUserResponse": true,
   *     "richResponse": {
   *       "items": [
   *         {
   *           "simpleResponse": {
   *             "textToSpeech": "this is a simple response"
   *           }
   *         }
   *       ]
   *     }
   *   }
   * }&lt;/pre&gt;
   * </pre>
   *
   * <code>.google.protobuf.Struct payload = 4;</code>
   */
  public boolean hasPayload() {
    return payload_ != null;
  }
  /**
   * <pre>
   * Optional. This value is passed directly to `QueryResult.webhook_payload`.
   * See the related `fulfillment_messages[i].payload field`, which may be used
   * as an alternative to this field.
   * This field can be used for Actions on Google responses.
   * It should have a structure similar to the JSON message shown here. For more
   * information, see
   * [Actions on Google Webhook
   * Format](https://developers.google.com/actions/dialogflow/webhook)
   * &lt;pre&gt;{
   *   "google": {
   *     "expectUserResponse": true,
   *     "richResponse": {
   *       "items": [
   *         {
   *           "simpleResponse": {
   *             "textToSpeech": "this is a simple response"
   *           }
   *         }
   *       ]
   *     }
   *   }
   * }&lt;/pre&gt;
   * </pre>
   *
   * <code>.google.protobuf.Struct payload = 4;</code>
   */
  public com.google.protobuf.Struct getPayload() {
    return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
  }
  /**
   * <pre>
   * Optional. This value is passed directly to `QueryResult.webhook_payload`.
   * See the related `fulfillment_messages[i].payload field`, which may be used
   * as an alternative to this field.
   * This field can be used for Actions on Google responses.
   * It should have a structure similar to the JSON message shown here. For more
   * information, see
   * [Actions on Google Webhook
   * Format](https://developers.google.com/actions/dialogflow/webhook)
   * &lt;pre&gt;{
   *   "google": {
   *     "expectUserResponse": true,
   *     "richResponse": {
   *       "items": [
   *         {
   *           "simpleResponse": {
   *             "textToSpeech": "this is a simple response"
   *           }
   *         }
   *       ]
   *     }
   *   }
   * }&lt;/pre&gt;
   * </pre>
   *
   * <code>.google.protobuf.Struct payload = 4;</code>
   */
  public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() {
    return getPayload();
  }

  public static final int OUTPUT_CONTEXTS_FIELD_NUMBER = 5;
  private java.util.List<com.google.cloud.dialogflow.v2beta1.Context> outputContexts_;
  /**
   * <pre>
   * Optional. The collection of output contexts. This value is passed directly
   * to `QueryResult.output_contexts`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
   */
  public java.util.List<com.google.cloud.dialogflow.v2beta1.Context> getOutputContextsList() {
    return outputContexts_;
  }
  /**
   * <pre>
   * Optional. The collection of output contexts. This value is passed directly
   * to `QueryResult.output_contexts`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
   */
  public java.util.List<? extends com.google.cloud.dialogflow.v2beta1.ContextOrBuilder> 
      getOutputContextsOrBuilderList() {
    return outputContexts_;
  }
  /**
   * <pre>
   * Optional. The collection of output contexts. This value is passed directly
   * to `QueryResult.output_contexts`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
   */
  public int getOutputContextsCount() {
    return outputContexts_.size();
  }
  /**
   * <pre>
   * Optional. The collection of output contexts. This value is passed directly
   * to `QueryResult.output_contexts`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
   */
  public com.google.cloud.dialogflow.v2beta1.Context getOutputContexts(int index) {
    return outputContexts_.get(index);
  }
  /**
   * <pre>
   * Optional. The collection of output contexts. This value is passed directly
   * to `QueryResult.output_contexts`.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
   */
  public com.google.cloud.dialogflow.v2beta1.ContextOrBuilder getOutputContextsOrBuilder(
      int index) {
    return outputContexts_.get(index);
  }

  public static final int FOLLOWUP_EVENT_INPUT_FIELD_NUMBER = 6;
  private com.google.cloud.dialogflow.v2beta1.EventInput followupEventInput_;
  /**
   * <pre>
   * Optional. Makes the platform immediately invoke another `DetectIntent` call
   * internally with the specified event as input.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
   */
  public boolean hasFollowupEventInput() {
    return followupEventInput_ != null;
  }
  /**
   * <pre>
   * Optional. Makes the platform immediately invoke another `DetectIntent` call
   * internally with the specified event as input.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
   */
  public com.google.cloud.dialogflow.v2beta1.EventInput getFollowupEventInput() {
    return followupEventInput_ == null ? com.google.cloud.dialogflow.v2beta1.EventInput.getDefaultInstance() : followupEventInput_;
  }
  /**
   * <pre>
   * Optional. Makes the platform immediately invoke another `DetectIntent` call
   * internally with the specified event as input.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
   */
  public com.google.cloud.dialogflow.v2beta1.EventInputOrBuilder getFollowupEventInputOrBuilder() {
    return getFollowupEventInput();
  }

  public static final int END_INTERACTION_FIELD_NUMBER = 8;
  private boolean endInteraction_;
  /**
   * <pre>
   * Optional. Indicates that this intent ends an interaction. Some integrations
   * (e.g., Actions on Google or Dialogflow phone gateway) use this information
   * to close interaction with an end user. Default is false.
   * </pre>
   *
   * <code>bool end_interaction = 8;</code>
   */
  public boolean getEndInteraction() {
    return endInteraction_;
  }

  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 (!getFulfillmentTextBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fulfillmentText_);
    }
    for (int i = 0; i < fulfillmentMessages_.size(); i++) {
      output.writeMessage(2, fulfillmentMessages_.get(i));
    }
    if (!getSourceBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, source_);
    }
    if (payload_ != null) {
      output.writeMessage(4, getPayload());
    }
    for (int i = 0; i < outputContexts_.size(); i++) {
      output.writeMessage(5, outputContexts_.get(i));
    }
    if (followupEventInput_ != null) {
      output.writeMessage(6, getFollowupEventInput());
    }
    if (endInteraction_ != false) {
      output.writeBool(8, endInteraction_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getFulfillmentTextBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fulfillmentText_);
    }
    for (int i = 0; i < fulfillmentMessages_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, fulfillmentMessages_.get(i));
    }
    if (!getSourceBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, source_);
    }
    if (payload_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getPayload());
    }
    for (int i = 0; i < outputContexts_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, outputContexts_.get(i));
    }
    if (followupEventInput_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, getFollowupEventInput());
    }
    if (endInteraction_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(8, endInteraction_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof com.google.cloud.dialogflow.v2beta1.WebhookResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.dialogflow.v2beta1.WebhookResponse other = (com.google.cloud.dialogflow.v2beta1.WebhookResponse) obj;

    boolean result = true;
    result = result && getFulfillmentText()
        .equals(other.getFulfillmentText());
    result = result && getFulfillmentMessagesList()
        .equals(other.getFulfillmentMessagesList());
    result = result && getSource()
        .equals(other.getSource());
    result = result && (hasPayload() == other.hasPayload());
    if (hasPayload()) {
      result = result && getPayload()
          .equals(other.getPayload());
    }
    result = result && getOutputContextsList()
        .equals(other.getOutputContextsList());
    result = result && (hasFollowupEventInput() == other.hasFollowupEventInput());
    if (hasFollowupEventInput()) {
      result = result && getFollowupEventInput()
          .equals(other.getFollowupEventInput());
    }
    result = result && (getEndInteraction()
        == other.getEndInteraction());
    result = result && unknownFields.equals(other.unknownFields);
    return result;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + FULFILLMENT_TEXT_FIELD_NUMBER;
    hash = (53 * hash) + getFulfillmentText().hashCode();
    if (getFulfillmentMessagesCount() > 0) {
      hash = (37 * hash) + FULFILLMENT_MESSAGES_FIELD_NUMBER;
      hash = (53 * hash) + getFulfillmentMessagesList().hashCode();
    }
    hash = (37 * hash) + SOURCE_FIELD_NUMBER;
    hash = (53 * hash) + getSource().hashCode();
    if (hasPayload()) {
      hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
      hash = (53 * hash) + getPayload().hashCode();
    }
    if (getOutputContextsCount() > 0) {
      hash = (37 * hash) + OUTPUT_CONTEXTS_FIELD_NUMBER;
      hash = (53 * hash) + getOutputContextsList().hashCode();
    }
    if (hasFollowupEventInput()) {
      hash = (37 * hash) + FOLLOWUP_EVENT_INPUT_FIELD_NUMBER;
      hash = (53 * hash) + getFollowupEventInput().hashCode();
    }
    hash = (37 * hash) + END_INTERACTION_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getEndInteraction());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.dialogflow.v2beta1.WebhookResponse 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;
  }
  /**
   * <pre>
   * The response message for a webhook call.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.v2beta1.WebhookResponse}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2beta1.WebhookResponse)
      com.google.cloud.dialogflow.v2beta1.WebhookResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.dialogflow.v2beta1.WebhookProto.internal_static_google_cloud_dialogflow_v2beta1_WebhookResponse_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dialogflow.v2beta1.WebhookProto.internal_static_google_cloud_dialogflow_v2beta1_WebhookResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dialogflow.v2beta1.WebhookResponse.class, com.google.cloud.dialogflow.v2beta1.WebhookResponse.Builder.class);
    }

    // Construct using com.google.cloud.dialogflow.v2beta1.WebhookResponse.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getFulfillmentMessagesFieldBuilder();
        getOutputContextsFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      fulfillmentText_ = "";

      if (fulfillmentMessagesBuilder_ == null) {
        fulfillmentMessages_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
      } else {
        fulfillmentMessagesBuilder_.clear();
      }
      source_ = "";

      if (payloadBuilder_ == null) {
        payload_ = null;
      } else {
        payload_ = null;
        payloadBuilder_ = null;
      }
      if (outputContextsBuilder_ == null) {
        outputContexts_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000010);
      } else {
        outputContextsBuilder_.clear();
      }
      if (followupEventInputBuilder_ == null) {
        followupEventInput_ = null;
      } else {
        followupEventInput_ = null;
        followupEventInputBuilder_ = null;
      }
      endInteraction_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.dialogflow.v2beta1.WebhookProto.internal_static_google_cloud_dialogflow_v2beta1_WebhookResponse_descriptor;
    }

    @java.lang.Override
    public com.google.cloud.dialogflow.v2beta1.WebhookResponse getDefaultInstanceForType() {
      return com.google.cloud.dialogflow.v2beta1.WebhookResponse.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.cloud.dialogflow.v2beta1.WebhookResponse build() {
      com.google.cloud.dialogflow.v2beta1.WebhookResponse result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.cloud.dialogflow.v2beta1.WebhookResponse buildPartial() {
      com.google.cloud.dialogflow.v2beta1.WebhookResponse result = new com.google.cloud.dialogflow.v2beta1.WebhookResponse(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.fulfillmentText_ = fulfillmentText_;
      if (fulfillmentMessagesBuilder_ == null) {
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          fulfillmentMessages_ = java.util.Collections.unmodifiableList(fulfillmentMessages_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.fulfillmentMessages_ = fulfillmentMessages_;
      } else {
        result.fulfillmentMessages_ = fulfillmentMessagesBuilder_.build();
      }
      result.source_ = source_;
      if (payloadBuilder_ == null) {
        result.payload_ = payload_;
      } else {
        result.payload_ = payloadBuilder_.build();
      }
      if (outputContextsBuilder_ == null) {
        if (((bitField0_ & 0x00000010) == 0x00000010)) {
          outputContexts_ = java.util.Collections.unmodifiableList(outputContexts_);
          bitField0_ = (bitField0_ & ~0x00000010);
        }
        result.outputContexts_ = outputContexts_;
      } else {
        result.outputContexts_ = outputContextsBuilder_.build();
      }
      if (followupEventInputBuilder_ == null) {
        result.followupEventInput_ = followupEventInput_;
      } else {
        result.followupEventInput_ = followupEventInputBuilder_.build();
      }
      result.endInteraction_ = endInteraction_;
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return (Builder) super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return (Builder) super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return (Builder) super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return (Builder) super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return (Builder) super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.dialogflow.v2beta1.WebhookResponse) {
        return mergeFrom((com.google.cloud.dialogflow.v2beta1.WebhookResponse)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.dialogflow.v2beta1.WebhookResponse other) {
      if (other == com.google.cloud.dialogflow.v2beta1.WebhookResponse.getDefaultInstance()) return this;
      if (!other.getFulfillmentText().isEmpty()) {
        fulfillmentText_ = other.fulfillmentText_;
        onChanged();
      }
      if (fulfillmentMessagesBuilder_ == null) {
        if (!other.fulfillmentMessages_.isEmpty()) {
          if (fulfillmentMessages_.isEmpty()) {
            fulfillmentMessages_ = other.fulfillmentMessages_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureFulfillmentMessagesIsMutable();
            fulfillmentMessages_.addAll(other.fulfillmentMessages_);
          }
          onChanged();
        }
      } else {
        if (!other.fulfillmentMessages_.isEmpty()) {
          if (fulfillmentMessagesBuilder_.isEmpty()) {
            fulfillmentMessagesBuilder_.dispose();
            fulfillmentMessagesBuilder_ = null;
            fulfillmentMessages_ = other.fulfillmentMessages_;
            bitField0_ = (bitField0_ & ~0x00000002);
            fulfillmentMessagesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getFulfillmentMessagesFieldBuilder() : null;
          } else {
            fulfillmentMessagesBuilder_.addAllMessages(other.fulfillmentMessages_);
          }
        }
      }
      if (!other.getSource().isEmpty()) {
        source_ = other.source_;
        onChanged();
      }
      if (other.hasPayload()) {
        mergePayload(other.getPayload());
      }
      if (outputContextsBuilder_ == null) {
        if (!other.outputContexts_.isEmpty()) {
          if (outputContexts_.isEmpty()) {
            outputContexts_ = other.outputContexts_;
            bitField0_ = (bitField0_ & ~0x00000010);
          } else {
            ensureOutputContextsIsMutable();
            outputContexts_.addAll(other.outputContexts_);
          }
          onChanged();
        }
      } else {
        if (!other.outputContexts_.isEmpty()) {
          if (outputContextsBuilder_.isEmpty()) {
            outputContextsBuilder_.dispose();
            outputContextsBuilder_ = null;
            outputContexts_ = other.outputContexts_;
            bitField0_ = (bitField0_ & ~0x00000010);
            outputContextsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getOutputContextsFieldBuilder() : null;
          } else {
            outputContextsBuilder_.addAllMessages(other.outputContexts_);
          }
        }
      }
      if (other.hasFollowupEventInput()) {
        mergeFollowupEventInput(other.getFollowupEventInput());
      }
      if (other.getEndInteraction() != false) {
        setEndInteraction(other.getEndInteraction());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.google.cloud.dialogflow.v2beta1.WebhookResponse parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.google.cloud.dialogflow.v2beta1.WebhookResponse) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object fulfillmentText_ = "";
    /**
     * <pre>
     * Optional. The text to be shown on the screen. This value is passed directly
     * to `QueryResult.fulfillment_text`.
     * </pre>
     *
     * <code>string fulfillment_text = 1;</code>
     */
    public java.lang.String getFulfillmentText() {
      java.lang.Object ref = fulfillmentText_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        fulfillmentText_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Optional. The text to be shown on the screen. This value is passed directly
     * to `QueryResult.fulfillment_text`.
     * </pre>
     *
     * <code>string fulfillment_text = 1;</code>
     */
    public com.google.protobuf.ByteString
        getFulfillmentTextBytes() {
      java.lang.Object ref = fulfillmentText_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        fulfillmentText_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Optional. The text to be shown on the screen. This value is passed directly
     * to `QueryResult.fulfillment_text`.
     * </pre>
     *
     * <code>string fulfillment_text = 1;</code>
     */
    public Builder setFulfillmentText(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      fulfillmentText_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. The text to be shown on the screen. This value is passed directly
     * to `QueryResult.fulfillment_text`.
     * </pre>
     *
     * <code>string fulfillment_text = 1;</code>
     */
    public Builder clearFulfillmentText() {
      
      fulfillmentText_ = getDefaultInstance().getFulfillmentText();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. The text to be shown on the screen. This value is passed directly
     * to `QueryResult.fulfillment_text`.
     * </pre>
     *
     * <code>string fulfillment_text = 1;</code>
     */
    public Builder setFulfillmentTextBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      fulfillmentText_ = value;
      onChanged();
      return this;
    }

    private java.util.List<com.google.cloud.dialogflow.v2beta1.Intent.Message> fulfillmentMessages_ =
      java.util.Collections.emptyList();
    private void ensureFulfillmentMessagesIsMutable() {
      if (!((bitField0_ & 0x00000002) == 0x00000002)) {
        fulfillmentMessages_ = new java.util.ArrayList<com.google.cloud.dialogflow.v2beta1.Intent.Message>(fulfillmentMessages_);
        bitField0_ |= 0x00000002;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dialogflow.v2beta1.Intent.Message, com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder, com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder> fulfillmentMessagesBuilder_;

    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public java.util.List<com.google.cloud.dialogflow.v2beta1.Intent.Message> getFulfillmentMessagesList() {
      if (fulfillmentMessagesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(fulfillmentMessages_);
      } else {
        return fulfillmentMessagesBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public int getFulfillmentMessagesCount() {
      if (fulfillmentMessagesBuilder_ == null) {
        return fulfillmentMessages_.size();
      } else {
        return fulfillmentMessagesBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Intent.Message getFulfillmentMessages(int index) {
      if (fulfillmentMessagesBuilder_ == null) {
        return fulfillmentMessages_.get(index);
      } else {
        return fulfillmentMessagesBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder setFulfillmentMessages(
        int index, com.google.cloud.dialogflow.v2beta1.Intent.Message value) {
      if (fulfillmentMessagesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.set(index, value);
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder setFulfillmentMessages(
        int index, com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder builderForValue) {
      if (fulfillmentMessagesBuilder_ == null) {
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.set(index, builderForValue.build());
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder addFulfillmentMessages(com.google.cloud.dialogflow.v2beta1.Intent.Message value) {
      if (fulfillmentMessagesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.add(value);
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder addFulfillmentMessages(
        int index, com.google.cloud.dialogflow.v2beta1.Intent.Message value) {
      if (fulfillmentMessagesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.add(index, value);
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder addFulfillmentMessages(
        com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder builderForValue) {
      if (fulfillmentMessagesBuilder_ == null) {
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.add(builderForValue.build());
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder addFulfillmentMessages(
        int index, com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder builderForValue) {
      if (fulfillmentMessagesBuilder_ == null) {
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.add(index, builderForValue.build());
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder addAllFulfillmentMessages(
        java.lang.Iterable<? extends com.google.cloud.dialogflow.v2beta1.Intent.Message> values) {
      if (fulfillmentMessagesBuilder_ == null) {
        ensureFulfillmentMessagesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, fulfillmentMessages_);
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder clearFulfillmentMessages() {
      if (fulfillmentMessagesBuilder_ == null) {
        fulfillmentMessages_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public Builder removeFulfillmentMessages(int index) {
      if (fulfillmentMessagesBuilder_ == null) {
        ensureFulfillmentMessagesIsMutable();
        fulfillmentMessages_.remove(index);
        onChanged();
      } else {
        fulfillmentMessagesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder getFulfillmentMessagesBuilder(
        int index) {
      return getFulfillmentMessagesFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder getFulfillmentMessagesOrBuilder(
        int index) {
      if (fulfillmentMessagesBuilder_ == null) {
        return fulfillmentMessages_.get(index);  } else {
        return fulfillmentMessagesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public java.util.List<? extends com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder> 
         getFulfillmentMessagesOrBuilderList() {
      if (fulfillmentMessagesBuilder_ != null) {
        return fulfillmentMessagesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(fulfillmentMessages_);
      }
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder addFulfillmentMessagesBuilder() {
      return getFulfillmentMessagesFieldBuilder().addBuilder(
          com.google.cloud.dialogflow.v2beta1.Intent.Message.getDefaultInstance());
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder addFulfillmentMessagesBuilder(
        int index) {
      return getFulfillmentMessagesFieldBuilder().addBuilder(
          index, com.google.cloud.dialogflow.v2beta1.Intent.Message.getDefaultInstance());
    }
    /**
     * <pre>
     * Optional. The collection of rich messages to present to the user. This
     * value is passed directly to `QueryResult.fulfillment_messages`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Intent.Message fulfillment_messages = 2;</code>
     */
    public java.util.List<com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder> 
         getFulfillmentMessagesBuilderList() {
      return getFulfillmentMessagesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dialogflow.v2beta1.Intent.Message, com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder, com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder> 
        getFulfillmentMessagesFieldBuilder() {
      if (fulfillmentMessagesBuilder_ == null) {
        fulfillmentMessagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.Intent.Message, com.google.cloud.dialogflow.v2beta1.Intent.Message.Builder, com.google.cloud.dialogflow.v2beta1.Intent.MessageOrBuilder>(
                fulfillmentMessages_,
                ((bitField0_ & 0x00000002) == 0x00000002),
                getParentForChildren(),
                isClean());
        fulfillmentMessages_ = null;
      }
      return fulfillmentMessagesBuilder_;
    }

    private java.lang.Object source_ = "";
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_source`.
     * </pre>
     *
     * <code>string source = 3;</code>
     */
    public java.lang.String getSource() {
      java.lang.Object ref = source_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        source_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_source`.
     * </pre>
     *
     * <code>string source = 3;</code>
     */
    public com.google.protobuf.ByteString
        getSourceBytes() {
      java.lang.Object ref = source_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        source_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_source`.
     * </pre>
     *
     * <code>string source = 3;</code>
     */
    public Builder setSource(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      source_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_source`.
     * </pre>
     *
     * <code>string source = 3;</code>
     */
    public Builder clearSource() {
      
      source_ = getDefaultInstance().getSource();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_source`.
     * </pre>
     *
     * <code>string source = 3;</code>
     */
    public Builder setSourceBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      source_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.Struct payload_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> payloadBuilder_;
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public boolean hasPayload() {
      return payloadBuilder_ != null || payload_ != null;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public com.google.protobuf.Struct getPayload() {
      if (payloadBuilder_ == null) {
        return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
      } else {
        return payloadBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder setPayload(com.google.protobuf.Struct value) {
      if (payloadBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        payload_ = value;
        onChanged();
      } else {
        payloadBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder setPayload(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (payloadBuilder_ == null) {
        payload_ = builderForValue.build();
        onChanged();
      } else {
        payloadBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder mergePayload(com.google.protobuf.Struct value) {
      if (payloadBuilder_ == null) {
        if (payload_ != null) {
          payload_ =
            com.google.protobuf.Struct.newBuilder(payload_).mergeFrom(value).buildPartial();
        } else {
          payload_ = value;
        }
        onChanged();
      } else {
        payloadBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder clearPayload() {
      if (payloadBuilder_ == null) {
        payload_ = null;
        onChanged();
      } else {
        payload_ = null;
        payloadBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public com.google.protobuf.Struct.Builder getPayloadBuilder() {
      
      onChanged();
      return getPayloadFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() {
      if (payloadBuilder_ != null) {
        return payloadBuilder_.getMessageOrBuilder();
      } else {
        return payload_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : payload_;
      }
    }
    /**
     * <pre>
     * Optional. This value is passed directly to `QueryResult.webhook_payload`.
     * See the related `fulfillment_messages[i].payload field`, which may be used
     * as an alternative to this field.
     * This field can be used for Actions on Google responses.
     * It should have a structure similar to the JSON message shown here. For more
     * information, see
     * [Actions on Google Webhook
     * Format](https://developers.google.com/actions/dialogflow/webhook)
     * &lt;pre&gt;{
     *   "google": {
     *     "expectUserResponse": true,
     *     "richResponse": {
     *       "items": [
     *         {
     *           "simpleResponse": {
     *             "textToSpeech": "this is a simple response"
     *           }
     *         }
     *       ]
     *     }
     *   }
     * }&lt;/pre&gt;
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> 
        getPayloadFieldBuilder() {
      if (payloadBuilder_ == null) {
        payloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getPayload(),
                getParentForChildren(),
                isClean());
        payload_ = null;
      }
      return payloadBuilder_;
    }

    private java.util.List<com.google.cloud.dialogflow.v2beta1.Context> outputContexts_ =
      java.util.Collections.emptyList();
    private void ensureOutputContextsIsMutable() {
      if (!((bitField0_ & 0x00000010) == 0x00000010)) {
        outputContexts_ = new java.util.ArrayList<com.google.cloud.dialogflow.v2beta1.Context>(outputContexts_);
        bitField0_ |= 0x00000010;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dialogflow.v2beta1.Context, com.google.cloud.dialogflow.v2beta1.Context.Builder, com.google.cloud.dialogflow.v2beta1.ContextOrBuilder> outputContextsBuilder_;

    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public java.util.List<com.google.cloud.dialogflow.v2beta1.Context> getOutputContextsList() {
      if (outputContextsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(outputContexts_);
      } else {
        return outputContextsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public int getOutputContextsCount() {
      if (outputContextsBuilder_ == null) {
        return outputContexts_.size();
      } else {
        return outputContextsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Context getOutputContexts(int index) {
      if (outputContextsBuilder_ == null) {
        return outputContexts_.get(index);
      } else {
        return outputContextsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder setOutputContexts(
        int index, com.google.cloud.dialogflow.v2beta1.Context value) {
      if (outputContextsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOutputContextsIsMutable();
        outputContexts_.set(index, value);
        onChanged();
      } else {
        outputContextsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder setOutputContexts(
        int index, com.google.cloud.dialogflow.v2beta1.Context.Builder builderForValue) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.set(index, builderForValue.build());
        onChanged();
      } else {
        outputContextsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder addOutputContexts(com.google.cloud.dialogflow.v2beta1.Context value) {
      if (outputContextsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOutputContextsIsMutable();
        outputContexts_.add(value);
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder addOutputContexts(
        int index, com.google.cloud.dialogflow.v2beta1.Context value) {
      if (outputContextsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOutputContextsIsMutable();
        outputContexts_.add(index, value);
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder addOutputContexts(
        com.google.cloud.dialogflow.v2beta1.Context.Builder builderForValue) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.add(builderForValue.build());
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder addOutputContexts(
        int index, com.google.cloud.dialogflow.v2beta1.Context.Builder builderForValue) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.add(index, builderForValue.build());
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder addAllOutputContexts(
        java.lang.Iterable<? extends com.google.cloud.dialogflow.v2beta1.Context> values) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, outputContexts_);
        onChanged();
      } else {
        outputContextsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder clearOutputContexts() {
      if (outputContextsBuilder_ == null) {
        outputContexts_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000010);
        onChanged();
      } else {
        outputContextsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public Builder removeOutputContexts(int index) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.remove(index);
        onChanged();
      } else {
        outputContextsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Context.Builder getOutputContextsBuilder(
        int index) {
      return getOutputContextsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.ContextOrBuilder getOutputContextsOrBuilder(
        int index) {
      if (outputContextsBuilder_ == null) {
        return outputContexts_.get(index);  } else {
        return outputContextsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public java.util.List<? extends com.google.cloud.dialogflow.v2beta1.ContextOrBuilder> 
         getOutputContextsOrBuilderList() {
      if (outputContextsBuilder_ != null) {
        return outputContextsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(outputContexts_);
      }
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Context.Builder addOutputContextsBuilder() {
      return getOutputContextsFieldBuilder().addBuilder(
          com.google.cloud.dialogflow.v2beta1.Context.getDefaultInstance());
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.Context.Builder addOutputContextsBuilder(
        int index) {
      return getOutputContextsFieldBuilder().addBuilder(
          index, com.google.cloud.dialogflow.v2beta1.Context.getDefaultInstance());
    }
    /**
     * <pre>
     * Optional. The collection of output contexts. This value is passed directly
     * to `QueryResult.output_contexts`.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2beta1.Context output_contexts = 5;</code>
     */
    public java.util.List<com.google.cloud.dialogflow.v2beta1.Context.Builder> 
         getOutputContextsBuilderList() {
      return getOutputContextsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dialogflow.v2beta1.Context, com.google.cloud.dialogflow.v2beta1.Context.Builder, com.google.cloud.dialogflow.v2beta1.ContextOrBuilder> 
        getOutputContextsFieldBuilder() {
      if (outputContextsBuilder_ == null) {
        outputContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.Context, com.google.cloud.dialogflow.v2beta1.Context.Builder, com.google.cloud.dialogflow.v2beta1.ContextOrBuilder>(
                outputContexts_,
                ((bitField0_ & 0x00000010) == 0x00000010),
                getParentForChildren(),
                isClean());
        outputContexts_ = null;
      }
      return outputContextsBuilder_;
    }

    private com.google.cloud.dialogflow.v2beta1.EventInput followupEventInput_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dialogflow.v2beta1.EventInput, com.google.cloud.dialogflow.v2beta1.EventInput.Builder, com.google.cloud.dialogflow.v2beta1.EventInputOrBuilder> followupEventInputBuilder_;
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public boolean hasFollowupEventInput() {
      return followupEventInputBuilder_ != null || followupEventInput_ != null;
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.EventInput getFollowupEventInput() {
      if (followupEventInputBuilder_ == null) {
        return followupEventInput_ == null ? com.google.cloud.dialogflow.v2beta1.EventInput.getDefaultInstance() : followupEventInput_;
      } else {
        return followupEventInputBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public Builder setFollowupEventInput(com.google.cloud.dialogflow.v2beta1.EventInput value) {
      if (followupEventInputBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        followupEventInput_ = value;
        onChanged();
      } else {
        followupEventInputBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public Builder setFollowupEventInput(
        com.google.cloud.dialogflow.v2beta1.EventInput.Builder builderForValue) {
      if (followupEventInputBuilder_ == null) {
        followupEventInput_ = builderForValue.build();
        onChanged();
      } else {
        followupEventInputBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public Builder mergeFollowupEventInput(com.google.cloud.dialogflow.v2beta1.EventInput value) {
      if (followupEventInputBuilder_ == null) {
        if (followupEventInput_ != null) {
          followupEventInput_ =
            com.google.cloud.dialogflow.v2beta1.EventInput.newBuilder(followupEventInput_).mergeFrom(value).buildPartial();
        } else {
          followupEventInput_ = value;
        }
        onChanged();
      } else {
        followupEventInputBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public Builder clearFollowupEventInput() {
      if (followupEventInputBuilder_ == null) {
        followupEventInput_ = null;
        onChanged();
      } else {
        followupEventInput_ = null;
        followupEventInputBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.EventInput.Builder getFollowupEventInputBuilder() {
      
      onChanged();
      return getFollowupEventInputFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    public com.google.cloud.dialogflow.v2beta1.EventInputOrBuilder getFollowupEventInputOrBuilder() {
      if (followupEventInputBuilder_ != null) {
        return followupEventInputBuilder_.getMessageOrBuilder();
      } else {
        return followupEventInput_ == null ?
            com.google.cloud.dialogflow.v2beta1.EventInput.getDefaultInstance() : followupEventInput_;
      }
    }
    /**
     * <pre>
     * Optional. Makes the platform immediately invoke another `DetectIntent` call
     * internally with the specified event as input.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.EventInput followup_event_input = 6;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dialogflow.v2beta1.EventInput, com.google.cloud.dialogflow.v2beta1.EventInput.Builder, com.google.cloud.dialogflow.v2beta1.EventInputOrBuilder> 
        getFollowupEventInputFieldBuilder() {
      if (followupEventInputBuilder_ == null) {
        followupEventInputBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.EventInput, com.google.cloud.dialogflow.v2beta1.EventInput.Builder, com.google.cloud.dialogflow.v2beta1.EventInputOrBuilder>(
                getFollowupEventInput(),
                getParentForChildren(),
                isClean());
        followupEventInput_ = null;
      }
      return followupEventInputBuilder_;
    }

    private boolean endInteraction_ ;
    /**
     * <pre>
     * Optional. Indicates that this intent ends an interaction. Some integrations
     * (e.g., Actions on Google or Dialogflow phone gateway) use this information
     * to close interaction with an end user. Default is false.
     * </pre>
     *
     * <code>bool end_interaction = 8;</code>
     */
    public boolean getEndInteraction() {
      return endInteraction_;
    }
    /**
     * <pre>
     * Optional. Indicates that this intent ends an interaction. Some integrations
     * (e.g., Actions on Google or Dialogflow phone gateway) use this information
     * to close interaction with an end user. Default is false.
     * </pre>
     *
     * <code>bool end_interaction = 8;</code>
     */
    public Builder setEndInteraction(boolean value) {
      
      endInteraction_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Optional. Indicates that this intent ends an interaction. Some integrations
     * (e.g., Actions on Google or Dialogflow phone gateway) use this information
     * to close interaction with an end user. Default is false.
     * </pre>
     *
     * <code>bool end_interaction = 8;</code>
     */
    public Builder clearEndInteraction() {
      
      endInteraction_ = false;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(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.v2beta1.WebhookResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.WebhookResponse)
  private static final com.google.cloud.dialogflow.v2beta1.WebhookResponse DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2beta1.WebhookResponse();
  }

  public static com.google.cloud.dialogflow.v2beta1.WebhookResponse getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<WebhookResponse>
      PARSER = new com.google.protobuf.AbstractParser<WebhookResponse>() {
    @java.lang.Override
    public WebhookResponse parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new WebhookResponse(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<WebhookResponse> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<WebhookResponse> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.WebhookResponse getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

