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

package com.google.cloud.dialogflow.v2;

/**
 * <pre>
 * Represents the result of conversational query or event processing.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dialogflow.v2.QueryResult}
 */
public  final class QueryResult extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2.QueryResult)
    QueryResultOrBuilder {
private static final long serialVersionUID = 0L;
  // Use QueryResult.newBuilder() to construct.
  private QueryResult(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private QueryResult() {
    queryText_ = "";
    languageCode_ = "";
    speechRecognitionConfidence_ = 0F;
    action_ = "";
    allRequiredParamsPresent_ = false;
    fulfillmentText_ = "";
    fulfillmentMessages_ = java.util.Collections.emptyList();
    webhookSource_ = "";
    outputContexts_ = java.util.Collections.emptyList();
    intentDetectionConfidence_ = 0F;
  }

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

            queryText_ = s;
            break;
          }
          case 21: {

            speechRecognitionConfidence_ = input.readFloat();
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();

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

            break;
          }
          case 40: {

            allRequiredParamsPresent_ = input.readBool();
            break;
          }
          case 50: {
            java.lang.String s = input.readStringRequireUtf8();

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

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

            break;
          }
          case 82: {
            if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
              outputContexts_ = new java.util.ArrayList<com.google.cloud.dialogflow.v2.Context>();
              mutable_bitField0_ |= 0x00000400;
            }
            outputContexts_.add(
                input.readMessage(com.google.cloud.dialogflow.v2.Context.parser(), extensionRegistry));
            break;
          }
          case 90: {
            com.google.cloud.dialogflow.v2.Intent.Builder subBuilder = null;
            if (intent_ != null) {
              subBuilder = intent_.toBuilder();
            }
            intent_ = input.readMessage(com.google.cloud.dialogflow.v2.Intent.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(intent_);
              intent_ = subBuilder.buildPartial();
            }

            break;
          }
          case 101: {

            intentDetectionConfidence_ = input.readFloat();
            break;
          }
          case 114: {
            com.google.protobuf.Struct.Builder subBuilder = null;
            if (diagnosticInfo_ != null) {
              subBuilder = diagnosticInfo_.toBuilder();
            }
            diagnosticInfo_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(diagnosticInfo_);
              diagnosticInfo_ = subBuilder.buildPartial();
            }

            break;
          }
          case 122: {
            java.lang.String s = input.readStringRequireUtf8();

            languageCode_ = s;
            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_ & 0x00000080) == 0x00000080)) {
        fulfillmentMessages_ = java.util.Collections.unmodifiableList(fulfillmentMessages_);
      }
      if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
        outputContexts_ = java.util.Collections.unmodifiableList(outputContexts_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.google.cloud.dialogflow.v2.SessionProto.internal_static_google_cloud_dialogflow_v2_QueryResult_descriptor;
  }

  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.cloud.dialogflow.v2.SessionProto.internal_static_google_cloud_dialogflow_v2_QueryResult_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.cloud.dialogflow.v2.QueryResult.class, com.google.cloud.dialogflow.v2.QueryResult.Builder.class);
  }

  private int bitField0_;
  public static final int QUERY_TEXT_FIELD_NUMBER = 1;
  private volatile java.lang.Object queryText_;
  /**
   * <pre>
   * The original conversational query text:
   * - If natural language text was provided as input, `query_text` contains
   *   a copy of the input.
   * - If natural language speech audio was provided as input, `query_text`
   *   contains the speech recognition result. If speech recognizer produced
   *   multiple alternatives, a particular one is picked.
   * - If an event was provided as input, `query_text` is not set.
   * </pre>
   *
   * <code>string query_text = 1;</code>
   */
  public java.lang.String getQueryText() {
    java.lang.Object ref = queryText_;
    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();
      queryText_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The original conversational query text:
   * - If natural language text was provided as input, `query_text` contains
   *   a copy of the input.
   * - If natural language speech audio was provided as input, `query_text`
   *   contains the speech recognition result. If speech recognizer produced
   *   multiple alternatives, a particular one is picked.
   * - If an event was provided as input, `query_text` is not set.
   * </pre>
   *
   * <code>string query_text = 1;</code>
   */
  public com.google.protobuf.ByteString
      getQueryTextBytes() {
    java.lang.Object ref = queryText_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      queryText_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int LANGUAGE_CODE_FIELD_NUMBER = 15;
  private volatile java.lang.Object languageCode_;
  /**
   * <pre>
   * The language that was triggered during intent detection.
   * See [Language Support](https://dialogflow.com/docs/reference/language)
   * for a list of the currently supported language codes.
   * </pre>
   *
   * <code>string language_code = 15;</code>
   */
  public java.lang.String getLanguageCode() {
    java.lang.Object ref = languageCode_;
    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();
      languageCode_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The language that was triggered during intent detection.
   * See [Language Support](https://dialogflow.com/docs/reference/language)
   * for a list of the currently supported language codes.
   * </pre>
   *
   * <code>string language_code = 15;</code>
   */
  public com.google.protobuf.ByteString
      getLanguageCodeBytes() {
    java.lang.Object ref = languageCode_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      languageCode_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int SPEECH_RECOGNITION_CONFIDENCE_FIELD_NUMBER = 2;
  private float speechRecognitionConfidence_;
  /**
   * <pre>
   * The Speech recognition confidence between 0.0 and 1.0. A higher number
   * indicates an estimated greater likelihood that the recognized words are
   * correct. The default of 0.0 is a sentinel value indicating that confidence
   * was not set.
   * You should not rely on this field as it isn't guaranteed to be accurate, or
   * even set. In particular this field isn't set in Webhook calls and for
   * StreamingDetectIntent since the streaming endpoint has separate confidence
   * estimates per portion of the audio in StreamingRecognitionResult.
   * </pre>
   *
   * <code>float speech_recognition_confidence = 2;</code>
   */
  public float getSpeechRecognitionConfidence() {
    return speechRecognitionConfidence_;
  }

  public static final int ACTION_FIELD_NUMBER = 3;
  private volatile java.lang.Object action_;
  /**
   * <pre>
   * The action name from the matched intent.
   * </pre>
   *
   * <code>string action = 3;</code>
   */
  public java.lang.String getAction() {
    java.lang.Object ref = action_;
    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();
      action_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * The action name from the matched intent.
   * </pre>
   *
   * <code>string action = 3;</code>
   */
  public com.google.protobuf.ByteString
      getActionBytes() {
    java.lang.Object ref = action_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      action_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PARAMETERS_FIELD_NUMBER = 4;
  private com.google.protobuf.Struct parameters_;
  /**
   * <pre>
   * The collection of extracted parameters.
   * </pre>
   *
   * <code>.google.protobuf.Struct parameters = 4;</code>
   */
  public boolean hasParameters() {
    return parameters_ != null;
  }
  /**
   * <pre>
   * The collection of extracted parameters.
   * </pre>
   *
   * <code>.google.protobuf.Struct parameters = 4;</code>
   */
  public com.google.protobuf.Struct getParameters() {
    return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_;
  }
  /**
   * <pre>
   * The collection of extracted parameters.
   * </pre>
   *
   * <code>.google.protobuf.Struct parameters = 4;</code>
   */
  public com.google.protobuf.StructOrBuilder getParametersOrBuilder() {
    return getParameters();
  }

  public static final int ALL_REQUIRED_PARAMS_PRESENT_FIELD_NUMBER = 5;
  private boolean allRequiredParamsPresent_;
  /**
   * <pre>
   * This field is set to:
   * - `false` if the matched intent has required parameters and not all of
   *    the required parameter values have been collected.
   * - `true` if all required parameter values have been collected, or if the
   *    matched intent doesn't contain any required parameters.
   * </pre>
   *
   * <code>bool all_required_params_present = 5;</code>
   */
  public boolean getAllRequiredParamsPresent() {
    return allRequiredParamsPresent_;
  }

  public static final int FULFILLMENT_TEXT_FIELD_NUMBER = 6;
  private volatile java.lang.Object fulfillmentText_;
  /**
   * <pre>
   * The text to be pronounced to the user or shown on the screen.
   * </pre>
   *
   * <code>string fulfillment_text = 6;</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>
   * The text to be pronounced to the user or shown on the screen.
   * </pre>
   *
   * <code>string fulfillment_text = 6;</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 = 7;
  private java.util.List<com.google.cloud.dialogflow.v2.Intent.Message> fulfillmentMessages_;
  /**
   * <pre>
   * The collection of rich messages to present to the user.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7;</code>
   */
  public java.util.List<com.google.cloud.dialogflow.v2.Intent.Message> getFulfillmentMessagesList() {
    return fulfillmentMessages_;
  }
  /**
   * <pre>
   * The collection of rich messages to present to the user.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7;</code>
   */
  public java.util.List<? extends com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder> 
      getFulfillmentMessagesOrBuilderList() {
    return fulfillmentMessages_;
  }
  /**
   * <pre>
   * The collection of rich messages to present to the user.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7;</code>
   */
  public int getFulfillmentMessagesCount() {
    return fulfillmentMessages_.size();
  }
  /**
   * <pre>
   * The collection of rich messages to present to the user.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7;</code>
   */
  public com.google.cloud.dialogflow.v2.Intent.Message getFulfillmentMessages(int index) {
    return fulfillmentMessages_.get(index);
  }
  /**
   * <pre>
   * The collection of rich messages to present to the user.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Intent.Message fulfillment_messages = 7;</code>
   */
  public com.google.cloud.dialogflow.v2.Intent.MessageOrBuilder getFulfillmentMessagesOrBuilder(
      int index) {
    return fulfillmentMessages_.get(index);
  }

  public static final int WEBHOOK_SOURCE_FIELD_NUMBER = 8;
  private volatile java.lang.Object webhookSource_;
  /**
   * <pre>
   * If the query was fulfilled by a webhook call, this field is set to the
   * value of the `source` field returned in the webhook response.
   * </pre>
   *
   * <code>string webhook_source = 8;</code>
   */
  public java.lang.String getWebhookSource() {
    java.lang.Object ref = webhookSource_;
    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();
      webhookSource_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * If the query was fulfilled by a webhook call, this field is set to the
   * value of the `source` field returned in the webhook response.
   * </pre>
   *
   * <code>string webhook_source = 8;</code>
   */
  public com.google.protobuf.ByteString
      getWebhookSourceBytes() {
    java.lang.Object ref = webhookSource_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      webhookSource_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int WEBHOOK_PAYLOAD_FIELD_NUMBER = 9;
  private com.google.protobuf.Struct webhookPayload_;
  /**
   * <pre>
   * If the query was fulfilled by a webhook call, this field is set to the
   * value of the `payload` field returned in the webhook response.
   * </pre>
   *
   * <code>.google.protobuf.Struct webhook_payload = 9;</code>
   */
  public boolean hasWebhookPayload() {
    return webhookPayload_ != null;
  }
  /**
   * <pre>
   * If the query was fulfilled by a webhook call, this field is set to the
   * value of the `payload` field returned in the webhook response.
   * </pre>
   *
   * <code>.google.protobuf.Struct webhook_payload = 9;</code>
   */
  public com.google.protobuf.Struct getWebhookPayload() {
    return webhookPayload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : webhookPayload_;
  }
  /**
   * <pre>
   * If the query was fulfilled by a webhook call, this field is set to the
   * value of the `payload` field returned in the webhook response.
   * </pre>
   *
   * <code>.google.protobuf.Struct webhook_payload = 9;</code>
   */
  public com.google.protobuf.StructOrBuilder getWebhookPayloadOrBuilder() {
    return getWebhookPayload();
  }

  public static final int OUTPUT_CONTEXTS_FIELD_NUMBER = 10;
  private java.util.List<com.google.cloud.dialogflow.v2.Context> outputContexts_;
  /**
   * <pre>
   * The collection of output contexts. If applicable,
   * `output_contexts.parameters` contains entries with name
   * `&lt;parameter name&gt;.original` containing the original parameter values
   * before the query.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
   */
  public java.util.List<com.google.cloud.dialogflow.v2.Context> getOutputContextsList() {
    return outputContexts_;
  }
  /**
   * <pre>
   * The collection of output contexts. If applicable,
   * `output_contexts.parameters` contains entries with name
   * `&lt;parameter name&gt;.original` containing the original parameter values
   * before the query.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
   */
  public java.util.List<? extends com.google.cloud.dialogflow.v2.ContextOrBuilder> 
      getOutputContextsOrBuilderList() {
    return outputContexts_;
  }
  /**
   * <pre>
   * The collection of output contexts. If applicable,
   * `output_contexts.parameters` contains entries with name
   * `&lt;parameter name&gt;.original` containing the original parameter values
   * before the query.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
   */
  public int getOutputContextsCount() {
    return outputContexts_.size();
  }
  /**
   * <pre>
   * The collection of output contexts. If applicable,
   * `output_contexts.parameters` contains entries with name
   * `&lt;parameter name&gt;.original` containing the original parameter values
   * before the query.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
   */
  public com.google.cloud.dialogflow.v2.Context getOutputContexts(int index) {
    return outputContexts_.get(index);
  }
  /**
   * <pre>
   * The collection of output contexts. If applicable,
   * `output_contexts.parameters` contains entries with name
   * `&lt;parameter name&gt;.original` containing the original parameter values
   * before the query.
   * </pre>
   *
   * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
   */
  public com.google.cloud.dialogflow.v2.ContextOrBuilder getOutputContextsOrBuilder(
      int index) {
    return outputContexts_.get(index);
  }

  public static final int INTENT_FIELD_NUMBER = 11;
  private com.google.cloud.dialogflow.v2.Intent intent_;
  /**
   * <pre>
   * The intent that matched the conversational query. Some, not
   * all fields are filled in this message, including but not limited to:
   * `name`, `display_name` and `webhook_state`.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
   */
  public boolean hasIntent() {
    return intent_ != null;
  }
  /**
   * <pre>
   * The intent that matched the conversational query. Some, not
   * all fields are filled in this message, including but not limited to:
   * `name`, `display_name` and `webhook_state`.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
   */
  public com.google.cloud.dialogflow.v2.Intent getIntent() {
    return intent_ == null ? com.google.cloud.dialogflow.v2.Intent.getDefaultInstance() : intent_;
  }
  /**
   * <pre>
   * The intent that matched the conversational query. Some, not
   * all fields are filled in this message, including but not limited to:
   * `name`, `display_name` and `webhook_state`.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
   */
  public com.google.cloud.dialogflow.v2.IntentOrBuilder getIntentOrBuilder() {
    return getIntent();
  }

  public static final int INTENT_DETECTION_CONFIDENCE_FIELD_NUMBER = 12;
  private float intentDetectionConfidence_;
  /**
   * <pre>
   * The intent detection confidence. Values range from 0.0
   * (completely uncertain) to 1.0 (completely certain).
   * </pre>
   *
   * <code>float intent_detection_confidence = 12;</code>
   */
  public float getIntentDetectionConfidence() {
    return intentDetectionConfidence_;
  }

  public static final int DIAGNOSTIC_INFO_FIELD_NUMBER = 14;
  private com.google.protobuf.Struct diagnosticInfo_;
  /**
   * <pre>
   * The free-form diagnostic info. For example, this field
   * could contain webhook call latency.
   * </pre>
   *
   * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
   */
  public boolean hasDiagnosticInfo() {
    return diagnosticInfo_ != null;
  }
  /**
   * <pre>
   * The free-form diagnostic info. For example, this field
   * could contain webhook call latency.
   * </pre>
   *
   * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
   */
  public com.google.protobuf.Struct getDiagnosticInfo() {
    return diagnosticInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : diagnosticInfo_;
  }
  /**
   * <pre>
   * The free-form diagnostic info. For example, this field
   * could contain webhook call latency.
   * </pre>
   *
   * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
   */
  public com.google.protobuf.StructOrBuilder getDiagnosticInfoOrBuilder() {
    return getDiagnosticInfo();
  }

  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getQueryTextBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, queryText_);
    }
    if (speechRecognitionConfidence_ != 0F) {
      output.writeFloat(2, speechRecognitionConfidence_);
    }
    if (!getActionBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, action_);
    }
    if (parameters_ != null) {
      output.writeMessage(4, getParameters());
    }
    if (allRequiredParamsPresent_ != false) {
      output.writeBool(5, allRequiredParamsPresent_);
    }
    if (!getFulfillmentTextBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, fulfillmentText_);
    }
    for (int i = 0; i < fulfillmentMessages_.size(); i++) {
      output.writeMessage(7, fulfillmentMessages_.get(i));
    }
    if (!getWebhookSourceBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 8, webhookSource_);
    }
    if (webhookPayload_ != null) {
      output.writeMessage(9, getWebhookPayload());
    }
    for (int i = 0; i < outputContexts_.size(); i++) {
      output.writeMessage(10, outputContexts_.get(i));
    }
    if (intent_ != null) {
      output.writeMessage(11, getIntent());
    }
    if (intentDetectionConfidence_ != 0F) {
      output.writeFloat(12, intentDetectionConfidence_);
    }
    if (diagnosticInfo_ != null) {
      output.writeMessage(14, getDiagnosticInfo());
    }
    if (!getLanguageCodeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 15, languageCode_);
    }
    unknownFields.writeTo(output);
  }

  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (!getQueryTextBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, queryText_);
    }
    if (speechRecognitionConfidence_ != 0F) {
      size += com.google.protobuf.CodedOutputStream
        .computeFloatSize(2, speechRecognitionConfidence_);
    }
    if (!getActionBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, action_);
    }
    if (parameters_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, getParameters());
    }
    if (allRequiredParamsPresent_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(5, allRequiredParamsPresent_);
    }
    if (!getFulfillmentTextBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, fulfillmentText_);
    }
    for (int i = 0; i < fulfillmentMessages_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, fulfillmentMessages_.get(i));
    }
    if (!getWebhookSourceBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, webhookSource_);
    }
    if (webhookPayload_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(9, getWebhookPayload());
    }
    for (int i = 0; i < outputContexts_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(10, outputContexts_.get(i));
    }
    if (intent_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(11, getIntent());
    }
    if (intentDetectionConfidence_ != 0F) {
      size += com.google.protobuf.CodedOutputStream
        .computeFloatSize(12, intentDetectionConfidence_);
    }
    if (diagnosticInfo_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(14, getDiagnosticInfo());
    }
    if (!getLanguageCodeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, languageCode_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    boolean result = true;
    result = result && getQueryText()
        .equals(other.getQueryText());
    result = result && getLanguageCode()
        .equals(other.getLanguageCode());
    result = result && (
        java.lang.Float.floatToIntBits(getSpeechRecognitionConfidence())
        == java.lang.Float.floatToIntBits(
            other.getSpeechRecognitionConfidence()));
    result = result && getAction()
        .equals(other.getAction());
    result = result && (hasParameters() == other.hasParameters());
    if (hasParameters()) {
      result = result && getParameters()
          .equals(other.getParameters());
    }
    result = result && (getAllRequiredParamsPresent()
        == other.getAllRequiredParamsPresent());
    result = result && getFulfillmentText()
        .equals(other.getFulfillmentText());
    result = result && getFulfillmentMessagesList()
        .equals(other.getFulfillmentMessagesList());
    result = result && getWebhookSource()
        .equals(other.getWebhookSource());
    result = result && (hasWebhookPayload() == other.hasWebhookPayload());
    if (hasWebhookPayload()) {
      result = result && getWebhookPayload()
          .equals(other.getWebhookPayload());
    }
    result = result && getOutputContextsList()
        .equals(other.getOutputContextsList());
    result = result && (hasIntent() == other.hasIntent());
    if (hasIntent()) {
      result = result && getIntent()
          .equals(other.getIntent());
    }
    result = result && (
        java.lang.Float.floatToIntBits(getIntentDetectionConfidence())
        == java.lang.Float.floatToIntBits(
            other.getIntentDetectionConfidence()));
    result = result && (hasDiagnosticInfo() == other.hasDiagnosticInfo());
    if (hasDiagnosticInfo()) {
      result = result && getDiagnosticInfo()
          .equals(other.getDiagnosticInfo());
    }
    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) + QUERY_TEXT_FIELD_NUMBER;
    hash = (53 * hash) + getQueryText().hashCode();
    hash = (37 * hash) + LANGUAGE_CODE_FIELD_NUMBER;
    hash = (53 * hash) + getLanguageCode().hashCode();
    hash = (37 * hash) + SPEECH_RECOGNITION_CONFIDENCE_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(
        getSpeechRecognitionConfidence());
    hash = (37 * hash) + ACTION_FIELD_NUMBER;
    hash = (53 * hash) + getAction().hashCode();
    if (hasParameters()) {
      hash = (37 * hash) + PARAMETERS_FIELD_NUMBER;
      hash = (53 * hash) + getParameters().hashCode();
    }
    hash = (37 * hash) + ALL_REQUIRED_PARAMS_PRESENT_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getAllRequiredParamsPresent());
    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) + WEBHOOK_SOURCE_FIELD_NUMBER;
    hash = (53 * hash) + getWebhookSource().hashCode();
    if (hasWebhookPayload()) {
      hash = (37 * hash) + WEBHOOK_PAYLOAD_FIELD_NUMBER;
      hash = (53 * hash) + getWebhookPayload().hashCode();
    }
    if (getOutputContextsCount() > 0) {
      hash = (37 * hash) + OUTPUT_CONTEXTS_FIELD_NUMBER;
      hash = (53 * hash) + getOutputContextsList().hashCode();
    }
    if (hasIntent()) {
      hash = (37 * hash) + INTENT_FIELD_NUMBER;
      hash = (53 * hash) + getIntent().hashCode();
    }
    hash = (37 * hash) + INTENT_DETECTION_CONFIDENCE_FIELD_NUMBER;
    hash = (53 * hash) + java.lang.Float.floatToIntBits(
        getIntentDetectionConfidence());
    if (hasDiagnosticInfo()) {
      hash = (37 * hash) + DIAGNOSTIC_INFO_FIELD_NUMBER;
      hash = (53 * hash) + getDiagnosticInfo().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(com.google.cloud.dialogflow.v2.QueryResult prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Represents the result of conversational query or event processing.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.v2.QueryResult}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2.QueryResult)
      com.google.cloud.dialogflow.v2.QueryResultOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.google.cloud.dialogflow.v2.SessionProto.internal_static_google_cloud_dialogflow_v2_QueryResult_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dialogflow.v2.SessionProto.internal_static_google_cloud_dialogflow_v2_QueryResult_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dialogflow.v2.QueryResult.class, com.google.cloud.dialogflow.v2.QueryResult.Builder.class);
    }

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

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

      languageCode_ = "";

      speechRecognitionConfidence_ = 0F;

      action_ = "";

      if (parametersBuilder_ == null) {
        parameters_ = null;
      } else {
        parameters_ = null;
        parametersBuilder_ = null;
      }
      allRequiredParamsPresent_ = false;

      fulfillmentText_ = "";

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

      if (webhookPayloadBuilder_ == null) {
        webhookPayload_ = null;
      } else {
        webhookPayload_ = null;
        webhookPayloadBuilder_ = null;
      }
      if (outputContextsBuilder_ == null) {
        outputContexts_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000400);
      } else {
        outputContextsBuilder_.clear();
      }
      if (intentBuilder_ == null) {
        intent_ = null;
      } else {
        intent_ = null;
        intentBuilder_ = null;
      }
      intentDetectionConfidence_ = 0F;

      if (diagnosticInfoBuilder_ == null) {
        diagnosticInfo_ = null;
      } else {
        diagnosticInfo_ = null;
        diagnosticInfoBuilder_ = null;
      }
      return this;
    }

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.google.cloud.dialogflow.v2.SessionProto.internal_static_google_cloud_dialogflow_v2_QueryResult_descriptor;
    }

    public com.google.cloud.dialogflow.v2.QueryResult getDefaultInstanceForType() {
      return com.google.cloud.dialogflow.v2.QueryResult.getDefaultInstance();
    }

    public com.google.cloud.dialogflow.v2.QueryResult build() {
      com.google.cloud.dialogflow.v2.QueryResult result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.google.cloud.dialogflow.v2.QueryResult buildPartial() {
      com.google.cloud.dialogflow.v2.QueryResult result = new com.google.cloud.dialogflow.v2.QueryResult(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.queryText_ = queryText_;
      result.languageCode_ = languageCode_;
      result.speechRecognitionConfidence_ = speechRecognitionConfidence_;
      result.action_ = action_;
      if (parametersBuilder_ == null) {
        result.parameters_ = parameters_;
      } else {
        result.parameters_ = parametersBuilder_.build();
      }
      result.allRequiredParamsPresent_ = allRequiredParamsPresent_;
      result.fulfillmentText_ = fulfillmentText_;
      if (fulfillmentMessagesBuilder_ == null) {
        if (((bitField0_ & 0x00000080) == 0x00000080)) {
          fulfillmentMessages_ = java.util.Collections.unmodifiableList(fulfillmentMessages_);
          bitField0_ = (bitField0_ & ~0x00000080);
        }
        result.fulfillmentMessages_ = fulfillmentMessages_;
      } else {
        result.fulfillmentMessages_ = fulfillmentMessagesBuilder_.build();
      }
      result.webhookSource_ = webhookSource_;
      if (webhookPayloadBuilder_ == null) {
        result.webhookPayload_ = webhookPayload_;
      } else {
        result.webhookPayload_ = webhookPayloadBuilder_.build();
      }
      if (outputContextsBuilder_ == null) {
        if (((bitField0_ & 0x00000400) == 0x00000400)) {
          outputContexts_ = java.util.Collections.unmodifiableList(outputContexts_);
          bitField0_ = (bitField0_ & ~0x00000400);
        }
        result.outputContexts_ = outputContexts_;
      } else {
        result.outputContexts_ = outputContextsBuilder_.build();
      }
      if (intentBuilder_ == null) {
        result.intent_ = intent_;
      } else {
        result.intent_ = intentBuilder_.build();
      }
      result.intentDetectionConfidence_ = intentDetectionConfidence_;
      if (diagnosticInfoBuilder_ == null) {
        result.diagnosticInfo_ = diagnosticInfo_;
      } else {
        result.diagnosticInfo_ = diagnosticInfoBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(com.google.cloud.dialogflow.v2.QueryResult other) {
      if (other == com.google.cloud.dialogflow.v2.QueryResult.getDefaultInstance()) return this;
      if (!other.getQueryText().isEmpty()) {
        queryText_ = other.queryText_;
        onChanged();
      }
      if (!other.getLanguageCode().isEmpty()) {
        languageCode_ = other.languageCode_;
        onChanged();
      }
      if (other.getSpeechRecognitionConfidence() != 0F) {
        setSpeechRecognitionConfidence(other.getSpeechRecognitionConfidence());
      }
      if (!other.getAction().isEmpty()) {
        action_ = other.action_;
        onChanged();
      }
      if (other.hasParameters()) {
        mergeParameters(other.getParameters());
      }
      if (other.getAllRequiredParamsPresent() != false) {
        setAllRequiredParamsPresent(other.getAllRequiredParamsPresent());
      }
      if (!other.getFulfillmentText().isEmpty()) {
        fulfillmentText_ = other.fulfillmentText_;
        onChanged();
      }
      if (fulfillmentMessagesBuilder_ == null) {
        if (!other.fulfillmentMessages_.isEmpty()) {
          if (fulfillmentMessages_.isEmpty()) {
            fulfillmentMessages_ = other.fulfillmentMessages_;
            bitField0_ = (bitField0_ & ~0x00000080);
          } else {
            ensureFulfillmentMessagesIsMutable();
            fulfillmentMessages_.addAll(other.fulfillmentMessages_);
          }
          onChanged();
        }
      } else {
        if (!other.fulfillmentMessages_.isEmpty()) {
          if (fulfillmentMessagesBuilder_.isEmpty()) {
            fulfillmentMessagesBuilder_.dispose();
            fulfillmentMessagesBuilder_ = null;
            fulfillmentMessages_ = other.fulfillmentMessages_;
            bitField0_ = (bitField0_ & ~0x00000080);
            fulfillmentMessagesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getFulfillmentMessagesFieldBuilder() : null;
          } else {
            fulfillmentMessagesBuilder_.addAllMessages(other.fulfillmentMessages_);
          }
        }
      }
      if (!other.getWebhookSource().isEmpty()) {
        webhookSource_ = other.webhookSource_;
        onChanged();
      }
      if (other.hasWebhookPayload()) {
        mergeWebhookPayload(other.getWebhookPayload());
      }
      if (outputContextsBuilder_ == null) {
        if (!other.outputContexts_.isEmpty()) {
          if (outputContexts_.isEmpty()) {
            outputContexts_ = other.outputContexts_;
            bitField0_ = (bitField0_ & ~0x00000400);
          } else {
            ensureOutputContextsIsMutable();
            outputContexts_.addAll(other.outputContexts_);
          }
          onChanged();
        }
      } else {
        if (!other.outputContexts_.isEmpty()) {
          if (outputContextsBuilder_.isEmpty()) {
            outputContextsBuilder_.dispose();
            outputContextsBuilder_ = null;
            outputContexts_ = other.outputContexts_;
            bitField0_ = (bitField0_ & ~0x00000400);
            outputContextsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getOutputContextsFieldBuilder() : null;
          } else {
            outputContextsBuilder_.addAllMessages(other.outputContexts_);
          }
        }
      }
      if (other.hasIntent()) {
        mergeIntent(other.getIntent());
      }
      if (other.getIntentDetectionConfidence() != 0F) {
        setIntentDetectionConfidence(other.getIntentDetectionConfidence());
      }
      if (other.hasDiagnosticInfo()) {
        mergeDiagnosticInfo(other.getDiagnosticInfo());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    public final boolean isInitialized() {
      return true;
    }

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

    private java.lang.Object queryText_ = "";
    /**
     * <pre>
     * The original conversational query text:
     * - If natural language text was provided as input, `query_text` contains
     *   a copy of the input.
     * - If natural language speech audio was provided as input, `query_text`
     *   contains the speech recognition result. If speech recognizer produced
     *   multiple alternatives, a particular one is picked.
     * - If an event was provided as input, `query_text` is not set.
     * </pre>
     *
     * <code>string query_text = 1;</code>
     */
    public java.lang.String getQueryText() {
      java.lang.Object ref = queryText_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        queryText_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The original conversational query text:
     * - If natural language text was provided as input, `query_text` contains
     *   a copy of the input.
     * - If natural language speech audio was provided as input, `query_text`
     *   contains the speech recognition result. If speech recognizer produced
     *   multiple alternatives, a particular one is picked.
     * - If an event was provided as input, `query_text` is not set.
     * </pre>
     *
     * <code>string query_text = 1;</code>
     */
    public com.google.protobuf.ByteString
        getQueryTextBytes() {
      java.lang.Object ref = queryText_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        queryText_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The original conversational query text:
     * - If natural language text was provided as input, `query_text` contains
     *   a copy of the input.
     * - If natural language speech audio was provided as input, `query_text`
     *   contains the speech recognition result. If speech recognizer produced
     *   multiple alternatives, a particular one is picked.
     * - If an event was provided as input, `query_text` is not set.
     * </pre>
     *
     * <code>string query_text = 1;</code>
     */
    public Builder setQueryText(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      queryText_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The original conversational query text:
     * - If natural language text was provided as input, `query_text` contains
     *   a copy of the input.
     * - If natural language speech audio was provided as input, `query_text`
     *   contains the speech recognition result. If speech recognizer produced
     *   multiple alternatives, a particular one is picked.
     * - If an event was provided as input, `query_text` is not set.
     * </pre>
     *
     * <code>string query_text = 1;</code>
     */
    public Builder clearQueryText() {
      
      queryText_ = getDefaultInstance().getQueryText();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The original conversational query text:
     * - If natural language text was provided as input, `query_text` contains
     *   a copy of the input.
     * - If natural language speech audio was provided as input, `query_text`
     *   contains the speech recognition result. If speech recognizer produced
     *   multiple alternatives, a particular one is picked.
     * - If an event was provided as input, `query_text` is not set.
     * </pre>
     *
     * <code>string query_text = 1;</code>
     */
    public Builder setQueryTextBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      queryText_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object languageCode_ = "";
    /**
     * <pre>
     * The language that was triggered during intent detection.
     * See [Language Support](https://dialogflow.com/docs/reference/language)
     * for a list of the currently supported language codes.
     * </pre>
     *
     * <code>string language_code = 15;</code>
     */
    public java.lang.String getLanguageCode() {
      java.lang.Object ref = languageCode_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        languageCode_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The language that was triggered during intent detection.
     * See [Language Support](https://dialogflow.com/docs/reference/language)
     * for a list of the currently supported language codes.
     * </pre>
     *
     * <code>string language_code = 15;</code>
     */
    public com.google.protobuf.ByteString
        getLanguageCodeBytes() {
      java.lang.Object ref = languageCode_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        languageCode_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The language that was triggered during intent detection.
     * See [Language Support](https://dialogflow.com/docs/reference/language)
     * for a list of the currently supported language codes.
     * </pre>
     *
     * <code>string language_code = 15;</code>
     */
    public Builder setLanguageCode(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      languageCode_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The language that was triggered during intent detection.
     * See [Language Support](https://dialogflow.com/docs/reference/language)
     * for a list of the currently supported language codes.
     * </pre>
     *
     * <code>string language_code = 15;</code>
     */
    public Builder clearLanguageCode() {
      
      languageCode_ = getDefaultInstance().getLanguageCode();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The language that was triggered during intent detection.
     * See [Language Support](https://dialogflow.com/docs/reference/language)
     * for a list of the currently supported language codes.
     * </pre>
     *
     * <code>string language_code = 15;</code>
     */
    public Builder setLanguageCodeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      languageCode_ = value;
      onChanged();
      return this;
    }

    private float speechRecognitionConfidence_ ;
    /**
     * <pre>
     * The Speech recognition confidence between 0.0 and 1.0. A higher number
     * indicates an estimated greater likelihood that the recognized words are
     * correct. The default of 0.0 is a sentinel value indicating that confidence
     * was not set.
     * You should not rely on this field as it isn't guaranteed to be accurate, or
     * even set. In particular this field isn't set in Webhook calls and for
     * StreamingDetectIntent since the streaming endpoint has separate confidence
     * estimates per portion of the audio in StreamingRecognitionResult.
     * </pre>
     *
     * <code>float speech_recognition_confidence = 2;</code>
     */
    public float getSpeechRecognitionConfidence() {
      return speechRecognitionConfidence_;
    }
    /**
     * <pre>
     * The Speech recognition confidence between 0.0 and 1.0. A higher number
     * indicates an estimated greater likelihood that the recognized words are
     * correct. The default of 0.0 is a sentinel value indicating that confidence
     * was not set.
     * You should not rely on this field as it isn't guaranteed to be accurate, or
     * even set. In particular this field isn't set in Webhook calls and for
     * StreamingDetectIntent since the streaming endpoint has separate confidence
     * estimates per portion of the audio in StreamingRecognitionResult.
     * </pre>
     *
     * <code>float speech_recognition_confidence = 2;</code>
     */
    public Builder setSpeechRecognitionConfidence(float value) {
      
      speechRecognitionConfidence_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The Speech recognition confidence between 0.0 and 1.0. A higher number
     * indicates an estimated greater likelihood that the recognized words are
     * correct. The default of 0.0 is a sentinel value indicating that confidence
     * was not set.
     * You should not rely on this field as it isn't guaranteed to be accurate, or
     * even set. In particular this field isn't set in Webhook calls and for
     * StreamingDetectIntent since the streaming endpoint has separate confidence
     * estimates per portion of the audio in StreamingRecognitionResult.
     * </pre>
     *
     * <code>float speech_recognition_confidence = 2;</code>
     */
    public Builder clearSpeechRecognitionConfidence() {
      
      speechRecognitionConfidence_ = 0F;
      onChanged();
      return this;
    }

    private java.lang.Object action_ = "";
    /**
     * <pre>
     * The action name from the matched intent.
     * </pre>
     *
     * <code>string action = 3;</code>
     */
    public java.lang.String getAction() {
      java.lang.Object ref = action_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        action_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * The action name from the matched intent.
     * </pre>
     *
     * <code>string action = 3;</code>
     */
    public com.google.protobuf.ByteString
        getActionBytes() {
      java.lang.Object ref = action_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        action_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * The action name from the matched intent.
     * </pre>
     *
     * <code>string action = 3;</code>
     */
    public Builder setAction(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      action_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The action name from the matched intent.
     * </pre>
     *
     * <code>string action = 3;</code>
     */
    public Builder clearAction() {
      
      action_ = getDefaultInstance().getAction();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The action name from the matched intent.
     * </pre>
     *
     * <code>string action = 3;</code>
     */
    public Builder setActionBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      action_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.Struct parameters_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> parametersBuilder_;
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public boolean hasParameters() {
      return parametersBuilder_ != null || parameters_ != null;
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public com.google.protobuf.Struct getParameters() {
      if (parametersBuilder_ == null) {
        return parameters_ == null ? com.google.protobuf.Struct.getDefaultInstance() : parameters_;
      } else {
        return parametersBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public Builder setParameters(com.google.protobuf.Struct value) {
      if (parametersBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        parameters_ = value;
        onChanged();
      } else {
        parametersBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public Builder setParameters(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (parametersBuilder_ == null) {
        parameters_ = builderForValue.build();
        onChanged();
      } else {
        parametersBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public Builder mergeParameters(com.google.protobuf.Struct value) {
      if (parametersBuilder_ == null) {
        if (parameters_ != null) {
          parameters_ =
            com.google.protobuf.Struct.newBuilder(parameters_).mergeFrom(value).buildPartial();
        } else {
          parameters_ = value;
        }
        onChanged();
      } else {
        parametersBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public Builder clearParameters() {
      if (parametersBuilder_ == null) {
        parameters_ = null;
        onChanged();
      } else {
        parameters_ = null;
        parametersBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public com.google.protobuf.Struct.Builder getParametersBuilder() {
      
      onChanged();
      return getParametersFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    public com.google.protobuf.StructOrBuilder getParametersOrBuilder() {
      if (parametersBuilder_ != null) {
        return parametersBuilder_.getMessageOrBuilder();
      } else {
        return parameters_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : parameters_;
      }
    }
    /**
     * <pre>
     * The collection of extracted parameters.
     * </pre>
     *
     * <code>.google.protobuf.Struct parameters = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> 
        getParametersFieldBuilder() {
      if (parametersBuilder_ == null) {
        parametersBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getParameters(),
                getParentForChildren(),
                isClean());
        parameters_ = null;
      }
      return parametersBuilder_;
    }

    private boolean allRequiredParamsPresent_ ;
    /**
     * <pre>
     * This field is set to:
     * - `false` if the matched intent has required parameters and not all of
     *    the required parameter values have been collected.
     * - `true` if all required parameter values have been collected, or if the
     *    matched intent doesn't contain any required parameters.
     * </pre>
     *
     * <code>bool all_required_params_present = 5;</code>
     */
    public boolean getAllRequiredParamsPresent() {
      return allRequiredParamsPresent_;
    }
    /**
     * <pre>
     * This field is set to:
     * - `false` if the matched intent has required parameters and not all of
     *    the required parameter values have been collected.
     * - `true` if all required parameter values have been collected, or if the
     *    matched intent doesn't contain any required parameters.
     * </pre>
     *
     * <code>bool all_required_params_present = 5;</code>
     */
    public Builder setAllRequiredParamsPresent(boolean value) {
      
      allRequiredParamsPresent_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * This field is set to:
     * - `false` if the matched intent has required parameters and not all of
     *    the required parameter values have been collected.
     * - `true` if all required parameter values have been collected, or if the
     *    matched intent doesn't contain any required parameters.
     * </pre>
     *
     * <code>bool all_required_params_present = 5;</code>
     */
    public Builder clearAllRequiredParamsPresent() {
      
      allRequiredParamsPresent_ = false;
      onChanged();
      return this;
    }

    private java.lang.Object fulfillmentText_ = "";
    /**
     * <pre>
     * The text to be pronounced to the user or shown on the screen.
     * </pre>
     *
     * <code>string fulfillment_text = 6;</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>
     * The text to be pronounced to the user or shown on the screen.
     * </pre>
     *
     * <code>string fulfillment_text = 6;</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>
     * The text to be pronounced to the user or shown on the screen.
     * </pre>
     *
     * <code>string fulfillment_text = 6;</code>
     */
    public Builder setFulfillmentText(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      fulfillmentText_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The text to be pronounced to the user or shown on the screen.
     * </pre>
     *
     * <code>string fulfillment_text = 6;</code>
     */
    public Builder clearFulfillmentText() {
      
      fulfillmentText_ = getDefaultInstance().getFulfillmentText();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The text to be pronounced to the user or shown on the screen.
     * </pre>
     *
     * <code>string fulfillment_text = 6;</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.v2.Intent.Message> fulfillmentMessages_ =
      java.util.Collections.emptyList();
    private void ensureFulfillmentMessagesIsMutable() {
      if (!((bitField0_ & 0x00000080) == 0x00000080)) {
        fulfillmentMessages_ = new java.util.ArrayList<com.google.cloud.dialogflow.v2.Intent.Message>(fulfillmentMessages_);
        bitField0_ |= 0x00000080;
       }
    }

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

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

    private java.lang.Object webhookSource_ = "";
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `source` field returned in the webhook response.
     * </pre>
     *
     * <code>string webhook_source = 8;</code>
     */
    public java.lang.String getWebhookSource() {
      java.lang.Object ref = webhookSource_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        webhookSource_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `source` field returned in the webhook response.
     * </pre>
     *
     * <code>string webhook_source = 8;</code>
     */
    public com.google.protobuf.ByteString
        getWebhookSourceBytes() {
      java.lang.Object ref = webhookSource_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        webhookSource_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `source` field returned in the webhook response.
     * </pre>
     *
     * <code>string webhook_source = 8;</code>
     */
    public Builder setWebhookSource(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      webhookSource_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `source` field returned in the webhook response.
     * </pre>
     *
     * <code>string webhook_source = 8;</code>
     */
    public Builder clearWebhookSource() {
      
      webhookSource_ = getDefaultInstance().getWebhookSource();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `source` field returned in the webhook response.
     * </pre>
     *
     * <code>string webhook_source = 8;</code>
     */
    public Builder setWebhookSourceBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      webhookSource_ = value;
      onChanged();
      return this;
    }

    private com.google.protobuf.Struct webhookPayload_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> webhookPayloadBuilder_;
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public boolean hasWebhookPayload() {
      return webhookPayloadBuilder_ != null || webhookPayload_ != null;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public com.google.protobuf.Struct getWebhookPayload() {
      if (webhookPayloadBuilder_ == null) {
        return webhookPayload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : webhookPayload_;
      } else {
        return webhookPayloadBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public Builder setWebhookPayload(com.google.protobuf.Struct value) {
      if (webhookPayloadBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        webhookPayload_ = value;
        onChanged();
      } else {
        webhookPayloadBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public Builder setWebhookPayload(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (webhookPayloadBuilder_ == null) {
        webhookPayload_ = builderForValue.build();
        onChanged();
      } else {
        webhookPayloadBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public Builder mergeWebhookPayload(com.google.protobuf.Struct value) {
      if (webhookPayloadBuilder_ == null) {
        if (webhookPayload_ != null) {
          webhookPayload_ =
            com.google.protobuf.Struct.newBuilder(webhookPayload_).mergeFrom(value).buildPartial();
        } else {
          webhookPayload_ = value;
        }
        onChanged();
      } else {
        webhookPayloadBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public Builder clearWebhookPayload() {
      if (webhookPayloadBuilder_ == null) {
        webhookPayload_ = null;
        onChanged();
      } else {
        webhookPayload_ = null;
        webhookPayloadBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public com.google.protobuf.Struct.Builder getWebhookPayloadBuilder() {
      
      onChanged();
      return getWebhookPayloadFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    public com.google.protobuf.StructOrBuilder getWebhookPayloadOrBuilder() {
      if (webhookPayloadBuilder_ != null) {
        return webhookPayloadBuilder_.getMessageOrBuilder();
      } else {
        return webhookPayload_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : webhookPayload_;
      }
    }
    /**
     * <pre>
     * If the query was fulfilled by a webhook call, this field is set to the
     * value of the `payload` field returned in the webhook response.
     * </pre>
     *
     * <code>.google.protobuf.Struct webhook_payload = 9;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> 
        getWebhookPayloadFieldBuilder() {
      if (webhookPayloadBuilder_ == null) {
        webhookPayloadBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getWebhookPayload(),
                getParentForChildren(),
                isClean());
        webhookPayload_ = null;
      }
      return webhookPayloadBuilder_;
    }

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

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

    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public java.util.List<com.google.cloud.dialogflow.v2.Context> getOutputContextsList() {
      if (outputContextsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(outputContexts_);
      } else {
        return outputContextsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public int getOutputContextsCount() {
      if (outputContextsBuilder_ == null) {
        return outputContexts_.size();
      } else {
        return outputContextsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public com.google.cloud.dialogflow.v2.Context getOutputContexts(int index) {
      if (outputContextsBuilder_ == null) {
        return outputContexts_.get(index);
      } else {
        return outputContextsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder setOutputContexts(
        int index, com.google.cloud.dialogflow.v2.Context value) {
      if (outputContextsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOutputContextsIsMutable();
        outputContexts_.set(index, value);
        onChanged();
      } else {
        outputContextsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder setOutputContexts(
        int index, com.google.cloud.dialogflow.v2.Context.Builder builderForValue) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.set(index, builderForValue.build());
        onChanged();
      } else {
        outputContextsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder addOutputContexts(com.google.cloud.dialogflow.v2.Context value) {
      if (outputContextsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOutputContextsIsMutable();
        outputContexts_.add(value);
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder addOutputContexts(
        int index, com.google.cloud.dialogflow.v2.Context value) {
      if (outputContextsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureOutputContextsIsMutable();
        outputContexts_.add(index, value);
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder addOutputContexts(
        com.google.cloud.dialogflow.v2.Context.Builder builderForValue) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.add(builderForValue.build());
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder addOutputContexts(
        int index, com.google.cloud.dialogflow.v2.Context.Builder builderForValue) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.add(index, builderForValue.build());
        onChanged();
      } else {
        outputContextsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder addAllOutputContexts(
        java.lang.Iterable<? extends com.google.cloud.dialogflow.v2.Context> values) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, outputContexts_);
        onChanged();
      } else {
        outputContextsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder clearOutputContexts() {
      if (outputContextsBuilder_ == null) {
        outputContexts_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000400);
        onChanged();
      } else {
        outputContextsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public Builder removeOutputContexts(int index) {
      if (outputContextsBuilder_ == null) {
        ensureOutputContextsIsMutable();
        outputContexts_.remove(index);
        onChanged();
      } else {
        outputContextsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public com.google.cloud.dialogflow.v2.Context.Builder getOutputContextsBuilder(
        int index) {
      return getOutputContextsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public com.google.cloud.dialogflow.v2.ContextOrBuilder getOutputContextsOrBuilder(
        int index) {
      if (outputContextsBuilder_ == null) {
        return outputContexts_.get(index);  } else {
        return outputContextsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public java.util.List<? extends com.google.cloud.dialogflow.v2.ContextOrBuilder> 
         getOutputContextsOrBuilderList() {
      if (outputContextsBuilder_ != null) {
        return outputContextsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(outputContexts_);
      }
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public com.google.cloud.dialogflow.v2.Context.Builder addOutputContextsBuilder() {
      return getOutputContextsFieldBuilder().addBuilder(
          com.google.cloud.dialogflow.v2.Context.getDefaultInstance());
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public com.google.cloud.dialogflow.v2.Context.Builder addOutputContextsBuilder(
        int index) {
      return getOutputContextsFieldBuilder().addBuilder(
          index, com.google.cloud.dialogflow.v2.Context.getDefaultInstance());
    }
    /**
     * <pre>
     * The collection of output contexts. If applicable,
     * `output_contexts.parameters` contains entries with name
     * `&lt;parameter name&gt;.original` containing the original parameter values
     * before the query.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.v2.Context output_contexts = 10;</code>
     */
    public java.util.List<com.google.cloud.dialogflow.v2.Context.Builder> 
         getOutputContextsBuilderList() {
      return getOutputContextsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        com.google.cloud.dialogflow.v2.Context, com.google.cloud.dialogflow.v2.Context.Builder, com.google.cloud.dialogflow.v2.ContextOrBuilder> 
        getOutputContextsFieldBuilder() {
      if (outputContextsBuilder_ == null) {
        outputContextsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            com.google.cloud.dialogflow.v2.Context, com.google.cloud.dialogflow.v2.Context.Builder, com.google.cloud.dialogflow.v2.ContextOrBuilder>(
                outputContexts_,
                ((bitField0_ & 0x00000400) == 0x00000400),
                getParentForChildren(),
                isClean());
        outputContexts_ = null;
      }
      return outputContextsBuilder_;
    }

    private com.google.cloud.dialogflow.v2.Intent intent_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dialogflow.v2.Intent, com.google.cloud.dialogflow.v2.Intent.Builder, com.google.cloud.dialogflow.v2.IntentOrBuilder> intentBuilder_;
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public boolean hasIntent() {
      return intentBuilder_ != null || intent_ != null;
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public com.google.cloud.dialogflow.v2.Intent getIntent() {
      if (intentBuilder_ == null) {
        return intent_ == null ? com.google.cloud.dialogflow.v2.Intent.getDefaultInstance() : intent_;
      } else {
        return intentBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public Builder setIntent(com.google.cloud.dialogflow.v2.Intent value) {
      if (intentBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        intent_ = value;
        onChanged();
      } else {
        intentBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public Builder setIntent(
        com.google.cloud.dialogflow.v2.Intent.Builder builderForValue) {
      if (intentBuilder_ == null) {
        intent_ = builderForValue.build();
        onChanged();
      } else {
        intentBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public Builder mergeIntent(com.google.cloud.dialogflow.v2.Intent value) {
      if (intentBuilder_ == null) {
        if (intent_ != null) {
          intent_ =
            com.google.cloud.dialogflow.v2.Intent.newBuilder(intent_).mergeFrom(value).buildPartial();
        } else {
          intent_ = value;
        }
        onChanged();
      } else {
        intentBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public Builder clearIntent() {
      if (intentBuilder_ == null) {
        intent_ = null;
        onChanged();
      } else {
        intent_ = null;
        intentBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public com.google.cloud.dialogflow.v2.Intent.Builder getIntentBuilder() {
      
      onChanged();
      return getIntentFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    public com.google.cloud.dialogflow.v2.IntentOrBuilder getIntentOrBuilder() {
      if (intentBuilder_ != null) {
        return intentBuilder_.getMessageOrBuilder();
      } else {
        return intent_ == null ?
            com.google.cloud.dialogflow.v2.Intent.getDefaultInstance() : intent_;
      }
    }
    /**
     * <pre>
     * The intent that matched the conversational query. Some, not
     * all fields are filled in this message, including but not limited to:
     * `name`, `display_name` and `webhook_state`.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2.Intent intent = 11;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.cloud.dialogflow.v2.Intent, com.google.cloud.dialogflow.v2.Intent.Builder, com.google.cloud.dialogflow.v2.IntentOrBuilder> 
        getIntentFieldBuilder() {
      if (intentBuilder_ == null) {
        intentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.v2.Intent, com.google.cloud.dialogflow.v2.Intent.Builder, com.google.cloud.dialogflow.v2.IntentOrBuilder>(
                getIntent(),
                getParentForChildren(),
                isClean());
        intent_ = null;
      }
      return intentBuilder_;
    }

    private float intentDetectionConfidence_ ;
    /**
     * <pre>
     * The intent detection confidence. Values range from 0.0
     * (completely uncertain) to 1.0 (completely certain).
     * </pre>
     *
     * <code>float intent_detection_confidence = 12;</code>
     */
    public float getIntentDetectionConfidence() {
      return intentDetectionConfidence_;
    }
    /**
     * <pre>
     * The intent detection confidence. Values range from 0.0
     * (completely uncertain) to 1.0 (completely certain).
     * </pre>
     *
     * <code>float intent_detection_confidence = 12;</code>
     */
    public Builder setIntentDetectionConfidence(float value) {
      
      intentDetectionConfidence_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The intent detection confidence. Values range from 0.0
     * (completely uncertain) to 1.0 (completely certain).
     * </pre>
     *
     * <code>float intent_detection_confidence = 12;</code>
     */
    public Builder clearIntentDetectionConfidence() {
      
      intentDetectionConfidence_ = 0F;
      onChanged();
      return this;
    }

    private com.google.protobuf.Struct diagnosticInfo_ = null;
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> diagnosticInfoBuilder_;
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public boolean hasDiagnosticInfo() {
      return diagnosticInfoBuilder_ != null || diagnosticInfo_ != null;
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public com.google.protobuf.Struct getDiagnosticInfo() {
      if (diagnosticInfoBuilder_ == null) {
        return diagnosticInfo_ == null ? com.google.protobuf.Struct.getDefaultInstance() : diagnosticInfo_;
      } else {
        return diagnosticInfoBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public Builder setDiagnosticInfo(com.google.protobuf.Struct value) {
      if (diagnosticInfoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        diagnosticInfo_ = value;
        onChanged();
      } else {
        diagnosticInfoBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public Builder setDiagnosticInfo(
        com.google.protobuf.Struct.Builder builderForValue) {
      if (diagnosticInfoBuilder_ == null) {
        diagnosticInfo_ = builderForValue.build();
        onChanged();
      } else {
        diagnosticInfoBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public Builder mergeDiagnosticInfo(com.google.protobuf.Struct value) {
      if (diagnosticInfoBuilder_ == null) {
        if (diagnosticInfo_ != null) {
          diagnosticInfo_ =
            com.google.protobuf.Struct.newBuilder(diagnosticInfo_).mergeFrom(value).buildPartial();
        } else {
          diagnosticInfo_ = value;
        }
        onChanged();
      } else {
        diagnosticInfoBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public Builder clearDiagnosticInfo() {
      if (diagnosticInfoBuilder_ == null) {
        diagnosticInfo_ = null;
        onChanged();
      } else {
        diagnosticInfo_ = null;
        diagnosticInfoBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public com.google.protobuf.Struct.Builder getDiagnosticInfoBuilder() {
      
      onChanged();
      return getDiagnosticInfoFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    public com.google.protobuf.StructOrBuilder getDiagnosticInfoOrBuilder() {
      if (diagnosticInfoBuilder_ != null) {
        return diagnosticInfoBuilder_.getMessageOrBuilder();
      } else {
        return diagnosticInfo_ == null ?
            com.google.protobuf.Struct.getDefaultInstance() : diagnosticInfo_;
      }
    }
    /**
     * <pre>
     * The free-form diagnostic info. For example, this field
     * could contain webhook call latency.
     * </pre>
     *
     * <code>.google.protobuf.Struct diagnostic_info = 14;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder> 
        getDiagnosticInfoFieldBuilder() {
      if (diagnosticInfoBuilder_ == null) {
        diagnosticInfoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct, com.google.protobuf.Struct.Builder, com.google.protobuf.StructOrBuilder>(
                getDiagnosticInfo(),
                getParentForChildren(),
                isClean());
        diagnosticInfo_ = null;
      }
      return diagnosticInfoBuilder_;
    }
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFieldsProto3(unknownFields);
    }

    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2.QueryResult)
  }

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

  public static com.google.cloud.dialogflow.v2.QueryResult getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  public com.google.cloud.dialogflow.v2.QueryResult getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

