/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/dialogflow/v2beta1/conversation.proto

package com.google.cloud.dialogflow.v2beta1;

/**
 *
 *
 * <pre>
 * The response message for
 * [Conversations.GenerateStatelessSummary][google.cloud.dialogflow.v2beta1.Conversations.GenerateStatelessSummary].
 * </pre>
 *
 * Protobuf type {@code google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse}
 */
public final class GenerateStatelessSummaryResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse)
    GenerateStatelessSummaryResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use GenerateStatelessSummaryResponse.newBuilder() to construct.
  private GenerateStatelessSummaryResponse(
      com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private GenerateStatelessSummaryResponse() {
    latestMessage_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
    return new GenerateStatelessSummaryResponse();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
    return this.unknownFields;
  }

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.dialogflow.v2beta1.ConversationProto
        .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_descriptor;
  }

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

  public interface SummaryOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The summary content that is concatenated into one string.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return The text.
     */
    java.lang.String getText();
    /**
     *
     *
     * <pre>
     * The summary content that is concatenated into one string.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return The bytes for text.
     */
    com.google.protobuf.ByteString getTextBytes();

    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    int getTextSectionsCount();
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    boolean containsTextSections(java.lang.String key);
    /** Use {@link #getTextSectionsMap()} instead. */
    @java.lang.Deprecated
    java.util.Map<java.lang.String, java.lang.String> getTextSections();
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    java.util.Map<java.lang.String, java.lang.String> getTextSectionsMap();
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    /* nullable */
    java.lang.String getTextSectionsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue);
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    java.lang.String getTextSectionsOrThrow(java.lang.String key);
  }
  /**
   *
   *
   * <pre>
   * Generated summary for a conversation.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary}
   */
  public static final class Summary extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary)
      SummaryOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use Summary.newBuilder() to construct.
    private Summary(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private Summary() {
      text_ = "";
    }

    @java.lang.Override
    @SuppressWarnings({"unused"})
    protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
      return new Summary();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
      return this.unknownFields;
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.dialogflow.v2beta1.ConversationProto
          .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_Summary_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    @java.lang.Override
    protected com.google.protobuf.MapField internalGetMapField(int number) {
      switch (number) {
        case 2:
          return internalGetTextSections();
        default:
          throw new RuntimeException("Invalid map field number: " + number);
      }
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.cloud.dialogflow.v2beta1.ConversationProto
          .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_Summary_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.class,
              com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.Builder
                  .class);
    }

    public static final int TEXT_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private volatile java.lang.Object text_ = "";
    /**
     *
     *
     * <pre>
     * The summary content that is concatenated into one string.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return The text.
     */
    @java.lang.Override
    public java.lang.String getText() {
      java.lang.Object ref = text_;
      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();
        text_ = s;
        return s;
      }
    }
    /**
     *
     *
     * <pre>
     * The summary content that is concatenated into one string.
     * </pre>
     *
     * <code>string text = 1;</code>
     *
     * @return The bytes for text.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getTextBytes() {
      java.lang.Object ref = text_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        text_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int TEXT_SECTIONS_FIELD_NUMBER = 2;

    private static final class TextSectionsDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry =
          com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance(
              com.google.cloud.dialogflow.v2beta1.ConversationProto
                  .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_Summary_TextSectionsEntry_descriptor,
              com.google.protobuf.WireFormat.FieldType.STRING,
              "",
              com.google.protobuf.WireFormat.FieldType.STRING,
              "");
    }

    @SuppressWarnings("serial")
    private com.google.protobuf.MapField<java.lang.String, java.lang.String> textSections_;

    private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetTextSections() {
      if (textSections_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            TextSectionsDefaultEntryHolder.defaultEntry);
      }
      return textSections_;
    }

    public int getTextSectionsCount() {
      return internalGetTextSections().getMap().size();
    }
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    @java.lang.Override
    public boolean containsTextSections(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      return internalGetTextSections().getMap().containsKey(key);
    }
    /** Use {@link #getTextSectionsMap()} instead. */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, java.lang.String> getTextSections() {
      return getTextSectionsMap();
    }
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    @java.lang.Override
    public java.util.Map<java.lang.String, java.lang.String> getTextSectionsMap() {
      return internalGetTextSections().getMap();
    }
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    @java.lang.Override
    public /* nullable */ java.lang.String getTextSectionsOrDefault(
        java.lang.String key,
        /* nullable */
        java.lang.String defaultValue) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetTextSections().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     *
     *
     * <pre>
     * The summary content that is divided into sections. The key is the
     * section's name and the value is the section's content. There is no
     * specific format for the key or value.
     * </pre>
     *
     * <code>map&lt;string, string&gt; text_sections = 2;</code>
     */
    @java.lang.Override
    public java.lang.String getTextSectionsOrThrow(java.lang.String key) {
      if (key == null) {
        throw new NullPointerException("map key");
      }
      java.util.Map<java.lang.String, java.lang.String> map = internalGetTextSections().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    private byte memoizedIsInitialized = -1;

    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_);
      }
      com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
          output, internalGetTextSections(), TextSectionsDefaultEntryHolder.defaultEntry, 2);
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_);
      }
      for (java.util.Map.Entry<java.lang.String, java.lang.String> entry :
          internalGetTextSections().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.String, java.lang.String> textSections__ =
            TextSectionsDefaultEntryHolder.defaultEntry
                .newBuilderForType()
                .setKey(entry.getKey())
                .setValue(entry.getValue())
                .build();
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, textSections__);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSize = size;
      return size;
    }

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

      if (!getText().equals(other.getText())) return false;
      if (!internalGetTextSections().equals(other.internalGetTextSections())) return false;
      if (!getUnknownFields().equals(other.getUnknownFields())) return false;
      return true;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + TEXT_FIELD_NUMBER;
      hash = (53 * hash) + getText().hashCode();
      if (!internalGetTextSections().getMap().isEmpty()) {
        hash = (37 * hash) + TEXT_SECTIONS_FIELD_NUMBER;
        hash = (53 * hash) + internalGetTextSections().hashCode();
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(
            java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(
            com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseDelimitedFrom(
            java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
          PARSER, input, extensionRegistry);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        parseFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
          PARSER, input, extensionRegistry);
    }

    @java.lang.Override
    public Builder newBuilderForType() {
      return newBuilder();
    }

    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     *
     *
     * <pre>
     * Generated summary for a conversation.
     * </pre>
     *
     * Protobuf type {@code
     * google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary)
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.SummaryOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.dialogflow.v2beta1.ConversationProto
            .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_Summary_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(int number) {
        switch (number) {
          case 2:
            return internalGetTextSections();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
        switch (number) {
          case 2:
            return internalGetMutableTextSections();
          default:
            throw new RuntimeException("Invalid map field number: " + number);
        }
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.cloud.dialogflow.v2beta1.ConversationProto
            .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_Summary_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.class,
                com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.Builder
                    .class);
      }

      // Construct using
      // com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.newBuilder()
      private Builder() {}

      private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
      }

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        text_ = "";
        internalGetMutableTextSections().clear();
        return this;
      }

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

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

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

      @java.lang.Override
      public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
          buildPartial() {
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary result =
            new com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.text_ = text_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.textSections_ = internalGetTextSections();
          result.textSections_.makeImmutable();
        }
      }

      @java.lang.Override
      public Builder clone() {
        return super.clone();
      }

      @java.lang.Override
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.setField(field, value);
      }

      @java.lang.Override
      public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
        return super.clearField(field);
      }

      @java.lang.Override
      public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return super.clearOneof(oneof);
      }

      @java.lang.Override
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index,
          java.lang.Object value) {
        return super.setRepeatedField(field, index, value);
      }

      @java.lang.Override
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
        return super.addRepeatedField(field, value);
      }

      @java.lang.Override
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other
            instanceof
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary) {
          return mergeFrom(
              (com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary other) {
        if (other
            == com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
                .getDefaultInstance()) return this;
        if (!other.getText().isEmpty()) {
          text_ = other.text_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        internalGetMutableTextSections().mergeFrom(other.internalGetTextSections());
        bitField0_ |= 0x00000002;
        this.mergeUnknownFields(other.getUnknownFields());
        onChanged();
        return this;
      }

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

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        if (extensionRegistry == null) {
          throw new java.lang.NullPointerException();
        }
        try {
          boolean done = false;
          while (!done) {
            int tag = input.readTag();
            switch (tag) {
              case 0:
                done = true;
                break;
              case 10:
                {
                  text_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  com.google.protobuf.MapEntry<java.lang.String, java.lang.String> textSections__ =
                      input.readMessage(
                          TextSectionsDefaultEntryHolder.defaultEntry.getParserForType(),
                          extensionRegistry);
                  internalGetMutableTextSections()
                      .getMutableMap()
                      .put(textSections__.getKey(), textSections__.getValue());
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              default:
                {
                  if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                    done = true; // was an endgroup tag
                  }
                  break;
                } // default:
            } // switch (tag)
          } // while (!done)
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.unwrapIOException();
        } finally {
          onChanged();
        } // finally
        return this;
      }

      private int bitField0_;

      private java.lang.Object text_ = "";
      /**
       *
       *
       * <pre>
       * The summary content that is concatenated into one string.
       * </pre>
       *
       * <code>string text = 1;</code>
       *
       * @return The text.
       */
      public java.lang.String getText() {
        java.lang.Object ref = text_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          text_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * The summary content that is concatenated into one string.
       * </pre>
       *
       * <code>string text = 1;</code>
       *
       * @return The bytes for text.
       */
      public com.google.protobuf.ByteString getTextBytes() {
        java.lang.Object ref = text_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          text_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       *
       *
       * <pre>
       * The summary content that is concatenated into one string.
       * </pre>
       *
       * <code>string text = 1;</code>
       *
       * @param value The text to set.
       * @return This builder for chaining.
       */
      public Builder setText(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        text_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The summary content that is concatenated into one string.
       * </pre>
       *
       * <code>string text = 1;</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearText() {
        text_ = getDefaultInstance().getText();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The summary content that is concatenated into one string.
       * </pre>
       *
       * <code>string text = 1;</code>
       *
       * @param value The bytes for text to set.
       * @return This builder for chaining.
       */
      public Builder setTextBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        text_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private com.google.protobuf.MapField<java.lang.String, java.lang.String> textSections_;

      private com.google.protobuf.MapField<java.lang.String, java.lang.String>
          internalGetTextSections() {
        if (textSections_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              TextSectionsDefaultEntryHolder.defaultEntry);
        }
        return textSections_;
      }

      private com.google.protobuf.MapField<java.lang.String, java.lang.String>
          internalGetMutableTextSections() {
        if (textSections_ == null) {
          textSections_ =
              com.google.protobuf.MapField.newMapField(TextSectionsDefaultEntryHolder.defaultEntry);
        }
        if (!textSections_.isMutable()) {
          textSections_ = textSections_.copy();
        }
        bitField0_ |= 0x00000002;
        onChanged();
        return textSections_;
      }

      public int getTextSectionsCount() {
        return internalGetTextSections().getMap().size();
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      @java.lang.Override
      public boolean containsTextSections(java.lang.String key) {
        if (key == null) {
          throw new NullPointerException("map key");
        }
        return internalGetTextSections().getMap().containsKey(key);
      }
      /** Use {@link #getTextSectionsMap()} instead. */
      @java.lang.Override
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, java.lang.String> getTextSections() {
        return getTextSectionsMap();
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      @java.lang.Override
      public java.util.Map<java.lang.String, java.lang.String> getTextSectionsMap() {
        return internalGetTextSections().getMap();
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      @java.lang.Override
      public /* nullable */ java.lang.String getTextSectionsOrDefault(
          java.lang.String key,
          /* nullable */
          java.lang.String defaultValue) {
        if (key == null) {
          throw new NullPointerException("map key");
        }
        java.util.Map<java.lang.String, java.lang.String> map = internalGetTextSections().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      @java.lang.Override
      public java.lang.String getTextSectionsOrThrow(java.lang.String key) {
        if (key == null) {
          throw new NullPointerException("map key");
        }
        java.util.Map<java.lang.String, java.lang.String> map = internalGetTextSections().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearTextSections() {
        bitField0_ = (bitField0_ & ~0x00000002);
        internalGetMutableTextSections().getMutableMap().clear();
        return this;
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      public Builder removeTextSections(java.lang.String key) {
        if (key == null) {
          throw new NullPointerException("map key");
        }
        internalGetMutableTextSections().getMutableMap().remove(key);
        return this;
      }
      /** Use alternate mutation accessors instead. */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, java.lang.String> getMutableTextSections() {
        bitField0_ |= 0x00000002;
        return internalGetMutableTextSections().getMutableMap();
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      public Builder putTextSections(java.lang.String key, java.lang.String value) {
        if (key == null) {
          throw new NullPointerException("map key");
        }
        if (value == null) {
          throw new NullPointerException("map value");
        }
        internalGetMutableTextSections().getMutableMap().put(key, value);
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       *
       *
       * <pre>
       * The summary content that is divided into sections. The key is the
       * section's name and the value is the section's content. There is no
       * specific format for the key or value.
       * </pre>
       *
       * <code>map&lt;string, string&gt; text_sections = 2;</code>
       */
      public Builder putAllTextSections(java.util.Map<java.lang.String, java.lang.String> values) {
        internalGetMutableTextSections().getMutableMap().putAll(values);
        bitField0_ |= 0x00000002;
        return this;
      }

      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

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

      // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary)
    private static final com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse
            .Summary
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary();
    }

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

    private static final com.google.protobuf.Parser<Summary> PARSER =
        new com.google.protobuf.AbstractParser<Summary>() {
          @java.lang.Override
          public Summary parsePartialFrom(
              com.google.protobuf.CodedInputStream input,
              com.google.protobuf.ExtensionRegistryLite extensionRegistry)
              throws com.google.protobuf.InvalidProtocolBufferException {
            Builder builder = newBuilder();
            try {
              builder.mergeFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
              throw e.setUnfinishedMessage(builder.buildPartial());
            } catch (com.google.protobuf.UninitializedMessageException e) {
              throw e.asInvalidProtocolBufferException()
                  .setUnfinishedMessage(builder.buildPartial());
            } catch (java.io.IOException e) {
              throw new com.google.protobuf.InvalidProtocolBufferException(e)
                  .setUnfinishedMessage(builder.buildPartial());
            }
            return builder.buildPartial();
          }
        };

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

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

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

  public static final int SUMMARY_FIELD_NUMBER = 1;
  private com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary_;
  /**
   *
   *
   * <pre>
   * Generated summary.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
   * </code>
   *
   * @return Whether the summary field is set.
   */
  @java.lang.Override
  public boolean hasSummary() {
    return summary_ != null;
  }
  /**
   *
   *
   * <pre>
   * Generated summary.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
   * </code>
   *
   * @return The summary.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary getSummary() {
    return summary_ == null
        ? com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
            .getDefaultInstance()
        : summary_;
  }
  /**
   *
   *
   * <pre>
   * Generated summary.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.SummaryOrBuilder
      getSummaryOrBuilder() {
    return summary_ == null
        ? com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
            .getDefaultInstance()
        : summary_;
  }

  public static final int LATEST_MESSAGE_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object latestMessage_ = "";
  /**
   *
   *
   * <pre>
   * The name of the latest conversation message used as context for
   * compiling suggestion. The format is specific to the user and the names of
   * the messages provided.
   * </pre>
   *
   * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The latestMessage.
   */
  @java.lang.Override
  public java.lang.String getLatestMessage() {
    java.lang.Object ref = latestMessage_;
    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();
      latestMessage_ = s;
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The name of the latest conversation message used as context for
   * compiling suggestion. The format is specific to the user and the names of
   * the messages provided.
   * </pre>
   *
   * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for latestMessage.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getLatestMessageBytes() {
    java.lang.Object ref = latestMessage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      latestMessage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CONTEXT_SIZE_FIELD_NUMBER = 3;
  private int contextSize_ = 0;
  /**
   *
   *
   * <pre>
   * Number of messages prior to and including
   * [last_conversation_message][] used to compile the suggestion. It may be
   * smaller than the [GenerateStatelessSummaryRequest.context_size][] field in
   * the request if there weren't that many messages in the conversation.
   * </pre>
   *
   * <code>int32 context_size = 3;</code>
   *
   * @return The contextSize.
   */
  @java.lang.Override
  public int getContextSize() {
    return contextSize_;
  }

  private byte memoizedIsInitialized = -1;

  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (summary_ != null) {
      output.writeMessage(1, getSummary());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(latestMessage_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, latestMessage_);
    }
    if (contextSize_ != 0) {
      output.writeInt32(3, contextSize_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (summary_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getSummary());
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(latestMessage_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, latestMessage_);
    }
    if (contextSize_ != 0) {
      size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, contextSize_);
    }
    size += getUnknownFields().getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    if (hasSummary() != other.hasSummary()) return false;
    if (hasSummary()) {
      if (!getSummary().equals(other.getSummary())) return false;
    }
    if (!getLatestMessage().equals(other.getLatestMessage())) return false;
    if (getContextSize() != other.getContextSize()) return false;
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasSummary()) {
      hash = (37 * hash) + SUMMARY_FIELD_NUMBER;
      hash = (53 * hash) + getSummary().hashCode();
    }
    hash = (37 * hash) + LATEST_MESSAGE_FIELD_NUMBER;
    hash = (53 * hash) + getLatestMessage().hashCode();
    hash = (37 * hash) + CONTEXT_SIZE_FIELD_NUMBER;
    hash = (53 * hash) + getContextSize();
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse
      parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse
      parseDelimitedFrom(
          java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
        PARSER, input, extensionRegistry);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
        PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() {
    return newBuilder();
  }

  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }

  public static Builder newBuilder(
      com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * The response message for
   * [Conversations.GenerateStatelessSummary][google.cloud.dialogflow.v2beta1.Conversations.GenerateStatelessSummary].
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse)
      com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.dialogflow.v2beta1.ConversationProto
          .internal_static_google_cloud_dialogflow_v2beta1_GenerateStatelessSummaryResponse_descriptor;
    }

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

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

    private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
    }

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      summary_ = null;
      if (summaryBuilder_ != null) {
        summaryBuilder_.dispose();
        summaryBuilder_ = null;
      }
      latestMessage_ = "";
      contextSize_ = 0;
      return this;
    }

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

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

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

    @java.lang.Override
    public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse buildPartial() {
      com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse result =
          new com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      onBuilt();
      return result;
    }

    private void buildPartial0(
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.summary_ = summaryBuilder_ == null ? summary_ : summaryBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.latestMessage_ = latestMessage_;
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.contextSize_ = contextSize_;
      }
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }

    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.setField(field, value);
    }

    @java.lang.Override
    public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }

    @java.lang.Override
    public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }

    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }

    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }

    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse) {
        return mergeFrom(
            (com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse other) {
      if (other
          == com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse
              .getDefaultInstance()) return this;
      if (other.hasSummary()) {
        mergeSummary(other.getSummary());
      }
      if (!other.getLatestMessage().isEmpty()) {
        latestMessage_ = other.latestMessage_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      if (other.getContextSize() != 0) {
        setContextSize(other.getContextSize());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                input.readMessage(getSummaryFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                latestMessage_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 24:
              {
                contextSize_ = input.readInt32();
                bitField0_ |= 0x00000004;
                break;
              } // case 24
            default:
              {
                if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                  done = true; // was an endgroup tag
                }
                break;
              } // default:
          } // switch (tag)
        } // while (!done)
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.unwrapIOException();
      } finally {
        onChanged();
      } // finally
      return this;
    }

    private int bitField0_;

    private com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary,
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.Builder,
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.SummaryOrBuilder>
        summaryBuilder_;
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     *
     * @return Whether the summary field is set.
     */
    public boolean hasSummary() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     *
     * @return The summary.
     */
    public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
        getSummary() {
      if (summaryBuilder_ == null) {
        return summary_ == null
            ? com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
                .getDefaultInstance()
            : summary_;
      } else {
        return summaryBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    public Builder setSummary(
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary value) {
      if (summaryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        summary_ = value;
      } else {
        summaryBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    public Builder setSummary(
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.Builder
            builderForValue) {
      if (summaryBuilder_ == null) {
        summary_ = builderForValue.build();
      } else {
        summaryBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    public Builder mergeSummary(
        com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary value) {
      if (summaryBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)
            && summary_ != null
            && summary_
                != com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
                    .getDefaultInstance()) {
          getSummaryBuilder().mergeFrom(value);
        } else {
          summary_ = value;
        }
      } else {
        summaryBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    public Builder clearSummary() {
      bitField0_ = (bitField0_ & ~0x00000001);
      summary_ = null;
      if (summaryBuilder_ != null) {
        summaryBuilder_.dispose();
        summaryBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.Builder
        getSummaryBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getSummaryFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    public com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.SummaryOrBuilder
        getSummaryOrBuilder() {
      if (summaryBuilder_ != null) {
        return summaryBuilder_.getMessageOrBuilder();
      } else {
        return summary_ == null
            ? com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
                .getDefaultInstance()
            : summary_;
      }
    }
    /**
     *
     *
     * <pre>
     * Generated summary.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary summary = 1;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary,
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary.Builder,
            com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.SummaryOrBuilder>
        getSummaryFieldBuilder() {
      if (summaryBuilder_ == null) {
        summaryBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary,
                com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse.Summary
                    .Builder,
                com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse
                    .SummaryOrBuilder>(getSummary(), getParentForChildren(), isClean());
        summary_ = null;
      }
      return summaryBuilder_;
    }

    private java.lang.Object latestMessage_ = "";
    /**
     *
     *
     * <pre>
     * The name of the latest conversation message used as context for
     * compiling suggestion. The format is specific to the user and the names of
     * the messages provided.
     * </pre>
     *
     * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The latestMessage.
     */
    public java.lang.String getLatestMessage() {
      java.lang.Object ref = latestMessage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        latestMessage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The name of the latest conversation message used as context for
     * compiling suggestion. The format is specific to the user and the names of
     * the messages provided.
     * </pre>
     *
     * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for latestMessage.
     */
    public com.google.protobuf.ByteString getLatestMessageBytes() {
      java.lang.Object ref = latestMessage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        latestMessage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The name of the latest conversation message used as context for
     * compiling suggestion. The format is specific to the user and the names of
     * the messages provided.
     * </pre>
     *
     * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The latestMessage to set.
     * @return This builder for chaining.
     */
    public Builder setLatestMessage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      latestMessage_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The name of the latest conversation message used as context for
     * compiling suggestion. The format is specific to the user and the names of
     * the messages provided.
     * </pre>
     *
     * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearLatestMessage() {
      latestMessage_ = getDefaultInstance().getLatestMessage();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The name of the latest conversation message used as context for
     * compiling suggestion. The format is specific to the user and the names of
     * the messages provided.
     * </pre>
     *
     * <code>string latest_message = 2 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for latestMessage to set.
     * @return This builder for chaining.
     */
    public Builder setLatestMessageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      latestMessage_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private int contextSize_;
    /**
     *
     *
     * <pre>
     * Number of messages prior to and including
     * [last_conversation_message][] used to compile the suggestion. It may be
     * smaller than the [GenerateStatelessSummaryRequest.context_size][] field in
     * the request if there weren't that many messages in the conversation.
     * </pre>
     *
     * <code>int32 context_size = 3;</code>
     *
     * @return The contextSize.
     */
    @java.lang.Override
    public int getContextSize() {
      return contextSize_;
    }
    /**
     *
     *
     * <pre>
     * Number of messages prior to and including
     * [last_conversation_message][] used to compile the suggestion. It may be
     * smaller than the [GenerateStatelessSummaryRequest.context_size][] field in
     * the request if there weren't that many messages in the conversation.
     * </pre>
     *
     * <code>int32 context_size = 3;</code>
     *
     * @param value The contextSize to set.
     * @return This builder for chaining.
     */
    public Builder setContextSize(int value) {

      contextSize_ = value;
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Number of messages prior to and including
     * [last_conversation_message][] used to compile the suggestion. It may be
     * smaller than the [GenerateStatelessSummaryRequest.context_size][] field in
     * the request if there weren't that many messages in the conversation.
     * </pre>
     *
     * <code>int32 context_size = 3;</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearContextSize() {
      bitField0_ = (bitField0_ & ~0x00000004);
      contextSize_ = 0;
      onChanged();
      return this;
    }

    @java.lang.Override
    public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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

    // @@protoc_insertion_point(builder_scope:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse)
  private static final com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse
      DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.dialogflow.v2beta1.GenerateStatelessSummaryResponse();
  }

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

  private static final com.google.protobuf.Parser<GenerateStatelessSummaryResponse> PARSER =
      new com.google.protobuf.AbstractParser<GenerateStatelessSummaryResponse>() {
        @java.lang.Override
        public GenerateStatelessSummaryResponse parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          Builder builder = newBuilder();
          try {
            builder.mergeFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(builder.buildPartial());
          } catch (com.google.protobuf.UninitializedMessageException e) {
            throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
          } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e)
                .setUnfinishedMessage(builder.buildPartial());
          }
          return builder.buildPartial();
        }
      };

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

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

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