/*
 * Copyright 2023 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/cx/v3beta1/webhook.proto

package com.google.cloud.dialogflow.cx.v3beta1;

/**
 *
 *
 * <pre>
 * The response message for a webhook call.
 * </pre>
 *
 * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse}
 */
public final class WebhookResponse extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse)
    WebhookResponseOrBuilder {
  private static final long serialVersionUID = 0L;
  // Use WebhookResponse.newBuilder() to construct.
  private WebhookResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private WebhookResponse() {}

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto
        .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor;
  }

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

  public interface FulfillmentResponseOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage> getMessagesList();
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index);
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    int getMessagesCount();
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    java.util.List<? extends com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>
        getMessagesOrBuilderList();
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder(int index);

    /**
     *
     *
     * <pre>
     * Merge behavior for `messages`.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
     * </code>
     *
     * @return The enum numeric value on the wire for mergeBehavior.
     */
    int getMergeBehaviorValue();
    /**
     *
     *
     * <pre>
     * Merge behavior for `messages`.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
     * </code>
     *
     * @return The mergeBehavior.
     */
    com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior
        getMergeBehavior();
  }
  /**
   *
   *
   * <pre>
   * Represents a fulfillment response to the user.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse}
   */
  public static final class FulfillmentResponse extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse)
      FulfillmentResponseOrBuilder {
    private static final long serialVersionUID = 0L;
    // Use FulfillmentResponse.newBuilder() to construct.
    private FulfillmentResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private FulfillmentResponse() {
      messages_ = java.util.Collections.emptyList();
      mergeBehavior_ = 0;
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto
          .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor;
    }

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

    /**
     *
     *
     * <pre>
     * Defines merge behavior for `messages`.
     * </pre>
     *
     * Protobuf enum {@code
     * google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior}
     */
    public enum MergeBehavior implements com.google.protobuf.ProtocolMessageEnum {
      /**
       *
       *
       * <pre>
       * Not specified. `APPEND` will be used.
       * </pre>
       *
       * <code>MERGE_BEHAVIOR_UNSPECIFIED = 0;</code>
       */
      MERGE_BEHAVIOR_UNSPECIFIED(0),
      /**
       *
       *
       * <pre>
       * `messages` will be appended to the list of messages waiting to be sent
       * to the user.
       * </pre>
       *
       * <code>APPEND = 1;</code>
       */
      APPEND(1),
      /**
       *
       *
       * <pre>
       * `messages` will replace the list of messages waiting to be sent to the
       * user.
       * </pre>
       *
       * <code>REPLACE = 2;</code>
       */
      REPLACE(2),
      UNRECOGNIZED(-1),
      ;

      /**
       *
       *
       * <pre>
       * Not specified. `APPEND` will be used.
       * </pre>
       *
       * <code>MERGE_BEHAVIOR_UNSPECIFIED = 0;</code>
       */
      public static final int MERGE_BEHAVIOR_UNSPECIFIED_VALUE = 0;
      /**
       *
       *
       * <pre>
       * `messages` will be appended to the list of messages waiting to be sent
       * to the user.
       * </pre>
       *
       * <code>APPEND = 1;</code>
       */
      public static final int APPEND_VALUE = 1;
      /**
       *
       *
       * <pre>
       * `messages` will replace the list of messages waiting to be sent to the
       * user.
       * </pre>
       *
       * <code>REPLACE = 2;</code>
       */
      public static final int REPLACE_VALUE = 2;

      public final int getNumber() {
        if (this == UNRECOGNIZED) {
          throw new java.lang.IllegalArgumentException(
              "Can't get the number of an unknown enum value.");
        }
        return value;
      }

      /**
       * @param value The numeric wire value of the corresponding enum entry.
       * @return The enum associated with the given numeric wire value.
       * @deprecated Use {@link #forNumber(int)} instead.
       */
      @java.lang.Deprecated
      public static MergeBehavior valueOf(int value) {
        return forNumber(value);
      }

      /**
       * @param value The numeric wire value of the corresponding enum entry.
       * @return The enum associated with the given numeric wire value.
       */
      public static MergeBehavior forNumber(int value) {
        switch (value) {
          case 0:
            return MERGE_BEHAVIOR_UNSPECIFIED;
          case 1:
            return APPEND;
          case 2:
            return REPLACE;
          default:
            return null;
        }
      }

      public static com.google.protobuf.Internal.EnumLiteMap<MergeBehavior> internalGetValueMap() {
        return internalValueMap;
      }

      private static final com.google.protobuf.Internal.EnumLiteMap<MergeBehavior>
          internalValueMap =
              new com.google.protobuf.Internal.EnumLiteMap<MergeBehavior>() {
                public MergeBehavior findValueByNumber(int number) {
                  return MergeBehavior.forNumber(number);
                }
              };

      public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
        if (this == UNRECOGNIZED) {
          throw new java.lang.IllegalStateException(
              "Can't get the descriptor of an unrecognized enum value.");
        }
        return getDescriptor().getValues().get(ordinal());
      }

      public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
        return getDescriptor();
      }

      public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
        return com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
            .getDescriptor()
            .getEnumTypes()
            .get(0);
      }

      private static final MergeBehavior[] VALUES = values();

      public static MergeBehavior valueOf(
          com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
          throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1) {
          return UNRECOGNIZED;
        }
        return VALUES[desc.getIndex()];
      }

      private final int value;

      private MergeBehavior(int value) {
        this.value = value;
      }

      // @@protoc_insertion_point(enum_scope:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior)
    }

    public static final int MESSAGES_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage> messages_;
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>
        getMessagesList() {
      return messages_;
    }
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    @java.lang.Override
    public java.util.List<? extends com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>
        getMessagesOrBuilderList() {
      return messages_;
    }
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    @java.lang.Override
    public int getMessagesCount() {
      return messages_.size();
    }
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    @java.lang.Override
    public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) {
      return messages_.get(index);
    }
    /**
     *
     *
     * <pre>
     * The list of rich message responses to present to the user.
     * </pre>
     *
     * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
     */
    @java.lang.Override
    public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder(
        int index) {
      return messages_.get(index);
    }

    public static final int MERGE_BEHAVIOR_FIELD_NUMBER = 2;
    private int mergeBehavior_ = 0;
    /**
     *
     *
     * <pre>
     * Merge behavior for `messages`.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
     * </code>
     *
     * @return The enum numeric value on the wire for mergeBehavior.
     */
    @java.lang.Override
    public int getMergeBehaviorValue() {
      return mergeBehavior_;
    }
    /**
     *
     *
     * <pre>
     * Merge behavior for `messages`.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
     * </code>
     *
     * @return The mergeBehavior.
     */
    @java.lang.Override
    public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior
        getMergeBehavior() {
      com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior
          result =
              com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                  .MergeBehavior.forNumber(mergeBehavior_);
      return result == null
          ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior
              .UNRECOGNIZED
          : result;
    }

    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 {
      for (int i = 0; i < messages_.size(); i++) {
        output.writeMessage(1, messages_.get(i));
      }
      if (mergeBehavior_
          != com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
              .MergeBehavior.MERGE_BEHAVIOR_UNSPECIFIED
              .getNumber()) {
        output.writeEnum(2, mergeBehavior_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      for (int i = 0; i < messages_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, messages_.get(i));
      }
      if (mergeBehavior_
          != com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
              .MergeBehavior.MERGE_BEHAVIOR_UNSPECIFIED
              .getNumber()) {
        size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, mergeBehavior_);
      }
      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.cx.v3beta1.WebhookResponse.FulfillmentResponse)) {
        return super.equals(obj);
      }
      com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse other =
          (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) obj;

      if (!getMessagesList().equals(other.getMessagesList())) return false;
      if (mergeBehavior_ != other.mergeBehavior_) 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 (getMessagesCount() > 0) {
        hash = (37 * hash) + MESSAGES_FIELD_NUMBER;
        hash = (53 * hash) + getMessagesList().hashCode();
      }
      hash = (37 * hash) + MERGE_BEHAVIOR_FIELD_NUMBER;
      hash = (53 * hash) + mergeBehavior_;
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        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.cx.v3beta1.WebhookResponse.FulfillmentResponse
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        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.cx.v3beta1.WebhookResponse.FulfillmentResponse
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

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

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

    public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        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.cx.v3beta1.WebhookResponse.FulfillmentResponse
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        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.cx.v3beta1.WebhookResponse.FulfillmentResponse
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        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.cx.v3beta1.WebhookResponse.FulfillmentResponse 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>
     * Represents a fulfillment response to the user.
     * </pre>
     *
     * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse)
        com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto
            .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_FulfillmentResponse_descriptor;
      }

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

      // Construct using
      // com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        if (messagesBuilder_ == null) {
          messages_ = java.util.Collections.emptyList();
        } else {
          messages_ = null;
          messagesBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        mergeBehavior_ = 0;
        return this;
      }

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

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

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

      @java.lang.Override
      public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
          buildPartial() {
        com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse result =
            new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse(this);
        buildPartialRepeatedFields(result);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        onBuilt();
        return result;
      }

      private void buildPartialRepeatedFields(
          com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse result) {
        if (messagesBuilder_ == null) {
          if (((bitField0_ & 0x00000001) != 0)) {
            messages_ = java.util.Collections.unmodifiableList(messages_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.messages_ = messages_;
        } else {
          result.messages_ = messagesBuilder_.build();
        }
      }

      private void buildPartial0(
          com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.mergeBehavior_ = mergeBehavior_;
        }
      }

      @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.cx.v3beta1.WebhookResponse.FulfillmentResponse) {
          return mergeFrom(
              (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse other) {
        if (other
            == com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                .getDefaultInstance()) return this;
        if (messagesBuilder_ == null) {
          if (!other.messages_.isEmpty()) {
            if (messages_.isEmpty()) {
              messages_ = other.messages_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureMessagesIsMutable();
              messages_.addAll(other.messages_);
            }
            onChanged();
          }
        } else {
          if (!other.messages_.isEmpty()) {
            if (messagesBuilder_.isEmpty()) {
              messagesBuilder_.dispose();
              messagesBuilder_ = null;
              messages_ = other.messages_;
              bitField0_ = (bitField0_ & ~0x00000001);
              messagesBuilder_ =
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
                      ? getMessagesFieldBuilder()
                      : null;
            } else {
              messagesBuilder_.addAllMessages(other.messages_);
            }
          }
        }
        if (other.mergeBehavior_ != 0) {
          setMergeBehaviorValue(other.getMergeBehaviorValue());
        }
        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:
                {
                  com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage m =
                      input.readMessage(
                          com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.parser(),
                          extensionRegistry);
                  if (messagesBuilder_ == null) {
                    ensureMessagesIsMutable();
                    messages_.add(m);
                  } else {
                    messagesBuilder_.addMessage(m);
                  }
                  break;
                } // case 10
              case 16:
                {
                  mergeBehavior_ = input.readEnum();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 16
              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.util.List<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage> messages_ =
          java.util.Collections.emptyList();

      private void ensureMessagesIsMutable() {
        if (!((bitField0_ & 0x00000001) != 0)) {
          messages_ =
              new java.util.ArrayList<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>(
                  messages_);
          bitField0_ |= 0x00000001;
        }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage,
              com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder,
              com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>
          messagesBuilder_;

      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>
          getMessagesList() {
        if (messagesBuilder_ == null) {
          return java.util.Collections.unmodifiableList(messages_);
        } else {
          return messagesBuilder_.getMessageList();
        }
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public int getMessagesCount() {
        if (messagesBuilder_ == null) {
          return messages_.size();
        } else {
          return messagesBuilder_.getCount();
        }
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage getMessages(int index) {
        if (messagesBuilder_ == null) {
          return messages_.get(index);
        } else {
          return messagesBuilder_.getMessage(index);
        }
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder setMessages(
          int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) {
        if (messagesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureMessagesIsMutable();
          messages_.set(index, value);
          onChanged();
        } else {
          messagesBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder setMessages(
          int index,
          com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) {
        if (messagesBuilder_ == null) {
          ensureMessagesIsMutable();
          messages_.set(index, builderForValue.build());
          onChanged();
        } else {
          messagesBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder addMessages(com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) {
        if (messagesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureMessagesIsMutable();
          messages_.add(value);
          onChanged();
        } else {
          messagesBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder addMessages(
          int index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage value) {
        if (messagesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureMessagesIsMutable();
          messages_.add(index, value);
          onChanged();
        } else {
          messagesBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder addMessages(
          com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) {
        if (messagesBuilder_ == null) {
          ensureMessagesIsMutable();
          messages_.add(builderForValue.build());
          onChanged();
        } else {
          messagesBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder addMessages(
          int index,
          com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder builderForValue) {
        if (messagesBuilder_ == null) {
          ensureMessagesIsMutable();
          messages_.add(index, builderForValue.build());
          onChanged();
        } else {
          messagesBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder addAllMessages(
          java.lang.Iterable<? extends com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage>
              values) {
        if (messagesBuilder_ == null) {
          ensureMessagesIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(values, messages_);
          onChanged();
        } else {
          messagesBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder clearMessages() {
        if (messagesBuilder_ == null) {
          messages_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          messagesBuilder_.clear();
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public Builder removeMessages(int index) {
        if (messagesBuilder_ == null) {
          ensureMessagesIsMutable();
          messages_.remove(index);
          onChanged();
        } else {
          messagesBuilder_.remove(index);
        }
        return this;
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder getMessagesBuilder(
          int index) {
        return getMessagesFieldBuilder().getBuilder(index);
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder getMessagesOrBuilder(
          int index) {
        if (messagesBuilder_ == null) {
          return messages_.get(index);
        } else {
          return messagesBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public java.util.List<
              ? extends com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>
          getMessagesOrBuilderList() {
        if (messagesBuilder_ != null) {
          return messagesBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(messages_);
        }
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder() {
        return getMessagesFieldBuilder()
            .addBuilder(
                com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder addMessagesBuilder(
          int index) {
        return getMessagesFieldBuilder()
            .addBuilder(
                index, com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.getDefaultInstance());
      }
      /**
       *
       *
       * <pre>
       * The list of rich message responses to present to the user.
       * </pre>
       *
       * <code>repeated .google.cloud.dialogflow.cx.v3beta1.ResponseMessage messages = 1;</code>
       */
      public java.util.List<com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder>
          getMessagesBuilderList() {
        return getMessagesFieldBuilder().getBuilderList();
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
              com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage,
              com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder,
              com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>
          getMessagesFieldBuilder() {
        if (messagesBuilder_ == null) {
          messagesBuilder_ =
              new com.google.protobuf.RepeatedFieldBuilderV3<
                  com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage,
                  com.google.cloud.dialogflow.cx.v3beta1.ResponseMessage.Builder,
                  com.google.cloud.dialogflow.cx.v3beta1.ResponseMessageOrBuilder>(
                  messages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
          messages_ = null;
        }
        return messagesBuilder_;
      }

      private int mergeBehavior_ = 0;
      /**
       *
       *
       * <pre>
       * Merge behavior for `messages`.
       * </pre>
       *
       * <code>
       * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
       * </code>
       *
       * @return The enum numeric value on the wire for mergeBehavior.
       */
      @java.lang.Override
      public int getMergeBehaviorValue() {
        return mergeBehavior_;
      }
      /**
       *
       *
       * <pre>
       * Merge behavior for `messages`.
       * </pre>
       *
       * <code>
       * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
       * </code>
       *
       * @param value The enum numeric value on the wire for mergeBehavior to set.
       * @return This builder for chaining.
       */
      public Builder setMergeBehaviorValue(int value) {
        mergeBehavior_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Merge behavior for `messages`.
       * </pre>
       *
       * <code>
       * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
       * </code>
       *
       * @return The mergeBehavior.
       */
      @java.lang.Override
      public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
              .MergeBehavior
          getMergeBehavior() {
        com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior
            result =
                com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                    .MergeBehavior.forNumber(mergeBehavior_);
        return result == null
            ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                .MergeBehavior.UNRECOGNIZED
            : result;
      }
      /**
       *
       *
       * <pre>
       * Merge behavior for `messages`.
       * </pre>
       *
       * <code>
       * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
       * </code>
       *
       * @param value The mergeBehavior to set.
       * @return This builder for chaining.
       */
      public Builder setMergeBehavior(
          com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior
              value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00000002;
        mergeBehavior_ = value.getNumber();
        onChanged();
        return this;
      }
      /**
       *
       *
       * <pre>
       * Merge behavior for `messages`.
       * </pre>
       *
       * <code>
       * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.MergeBehavior merge_behavior = 2;
       * </code>
       *
       * @return This builder for chaining.
       */
      public Builder clearMergeBehavior() {
        bitField0_ = (bitField0_ & ~0x00000002);
        mergeBehavior_ = 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.cx.v3beta1.WebhookResponse.FulfillmentResponse)
    }

    // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse)
    private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse();
    }

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

    private static final com.google.protobuf.Parser<FulfillmentResponse> PARSER =
        new com.google.protobuf.AbstractParser<FulfillmentResponse>() {
          @java.lang.Override
          public FulfillmentResponse 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<FulfillmentResponse> parser() {
      return PARSER;
    }

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

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

  private int transitionCase_ = 0;

  @SuppressWarnings("serial")
  private java.lang.Object transition_;

  public enum TransitionCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    TARGET_PAGE(5),
    TARGET_FLOW(6),
    TRANSITION_NOT_SET(0);
    private final int value;

    private TransitionCase(int value) {
      this.value = value;
    }
    /**
     * @param value The number of the enum to look for.
     * @return The enum associated with the given number.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TransitionCase valueOf(int value) {
      return forNumber(value);
    }

    public static TransitionCase forNumber(int value) {
      switch (value) {
        case 5:
          return TARGET_PAGE;
        case 6:
          return TARGET_FLOW;
        case 0:
          return TRANSITION_NOT_SET;
        default:
          return null;
      }
    }

    public int getNumber() {
      return this.value;
    }
  };

  public TransitionCase getTransitionCase() {
    return TransitionCase.forNumber(transitionCase_);
  }

  public static final int FULFILLMENT_RESPONSE_FIELD_NUMBER = 1;
  private com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
      fulfillmentResponse_;
  /**
   *
   *
   * <pre>
   * The fulfillment response to send to the user. This field can be omitted by
   * the webhook if it does not intend to send any response to the user.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
   * </code>
   *
   * @return Whether the fulfillmentResponse field is set.
   */
  @java.lang.Override
  public boolean hasFulfillmentResponse() {
    return fulfillmentResponse_ != null;
  }
  /**
   *
   *
   * <pre>
   * The fulfillment response to send to the user. This field can be omitted by
   * the webhook if it does not intend to send any response to the user.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
   * </code>
   *
   * @return The fulfillmentResponse.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
      getFulfillmentResponse() {
    return fulfillmentResponse_ == null
        ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
            .getDefaultInstance()
        : fulfillmentResponse_;
  }
  /**
   *
   *
   * <pre>
   * The fulfillment response to send to the user. This field can be omitted by
   * the webhook if it does not intend to send any response to the user.
   * </pre>
   *
   * <code>
   * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
   * </code>
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder
      getFulfillmentResponseOrBuilder() {
    return fulfillmentResponse_ == null
        ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
            .getDefaultInstance()
        : fulfillmentResponse_;
  }

  public static final int PAGE_INFO_FIELD_NUMBER = 2;
  private com.google.cloud.dialogflow.cx.v3beta1.PageInfo pageInfo_;
  /**
   *
   *
   * <pre>
   * Information about page status. This field can be omitted by the webhook if
   * it does not intend to modify page status.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
   *
   * @return Whether the pageInfo field is set.
   */
  @java.lang.Override
  public boolean hasPageInfo() {
    return pageInfo_ != null;
  }
  /**
   *
   *
   * <pre>
   * Information about page status. This field can be omitted by the webhook if
   * it does not intend to modify page status.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
   *
   * @return The pageInfo.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo() {
    return pageInfo_ == null
        ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance()
        : pageInfo_;
  }
  /**
   *
   *
   * <pre>
   * Information about page status. This field can be omitted by the webhook if
   * it does not intend to modify page status.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder() {
    return pageInfo_ == null
        ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance()
        : pageInfo_;
  }

  public static final int SESSION_INFO_FIELD_NUMBER = 3;
  private com.google.cloud.dialogflow.cx.v3beta1.SessionInfo sessionInfo_;
  /**
   *
   *
   * <pre>
   * Information about session status. This field can be omitted by the webhook
   * if it does not intend to modify session status.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
   *
   * @return Whether the sessionInfo field is set.
   */
  @java.lang.Override
  public boolean hasSessionInfo() {
    return sessionInfo_ != null;
  }
  /**
   *
   *
   * <pre>
   * Information about session status. This field can be omitted by the webhook
   * if it does not intend to modify session status.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
   *
   * @return The sessionInfo.
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo() {
    return sessionInfo_ == null
        ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance()
        : sessionInfo_;
  }
  /**
   *
   *
   * <pre>
   * Information about session status. This field can be omitted by the webhook
   * if it does not intend to modify session status.
   * </pre>
   *
   * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
   */
  @java.lang.Override
  public com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder() {
    return sessionInfo_ == null
        ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance()
        : sessionInfo_;
  }

  public static final int PAYLOAD_FIELD_NUMBER = 4;
  private com.google.protobuf.Struct payload_;
  /**
   *
   *
   * <pre>
   * Value to append directly to
   * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
   * </pre>
   *
   * <code>.google.protobuf.Struct payload = 4;</code>
   *
   * @return Whether the payload field is set.
   */
  @java.lang.Override
  public boolean hasPayload() {
    return payload_ != null;
  }
  /**
   *
   *
   * <pre>
   * Value to append directly to
   * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
   * </pre>
   *
   * <code>.google.protobuf.Struct payload = 4;</code>
   *
   * @return The payload.
   */
  @java.lang.Override
  public com.google.protobuf.Struct getPayload() {
    return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
  }
  /**
   *
   *
   * <pre>
   * Value to append directly to
   * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
   * </pre>
   *
   * <code>.google.protobuf.Struct payload = 4;</code>
   */
  @java.lang.Override
  public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() {
    return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
  }

  public static final int TARGET_PAGE_FIELD_NUMBER = 5;
  /**
   *
   *
   * <pre>
   * The target page to transition to.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
   * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
   * </pre>
   *
   * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return Whether the targetPage field is set.
   */
  public boolean hasTargetPage() {
    return transitionCase_ == 5;
  }
  /**
   *
   *
   * <pre>
   * The target page to transition to.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
   * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
   * </pre>
   *
   * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The targetPage.
   */
  public java.lang.String getTargetPage() {
    java.lang.Object ref = "";
    if (transitionCase_ == 5) {
      ref = transition_;
    }
    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();
      if (transitionCase_ == 5) {
        transition_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The target page to transition to.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
   * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
   * </pre>
   *
   * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for targetPage.
   */
  public com.google.protobuf.ByteString getTargetPageBytes() {
    java.lang.Object ref = "";
    if (transitionCase_ == 5) {
      ref = transition_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (transitionCase_ == 5) {
        transition_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TARGET_FLOW_FIELD_NUMBER = 6;
  /**
   *
   *
   * <pre>
   * The target flow to transition to.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
   * ID&gt;/flows/&lt;Flow ID&gt;`.
   * </pre>
   *
   * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return Whether the targetFlow field is set.
   */
  public boolean hasTargetFlow() {
    return transitionCase_ == 6;
  }
  /**
   *
   *
   * <pre>
   * The target flow to transition to.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
   * ID&gt;/flows/&lt;Flow ID&gt;`.
   * </pre>
   *
   * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The targetFlow.
   */
  public java.lang.String getTargetFlow() {
    java.lang.Object ref = "";
    if (transitionCase_ == 6) {
      ref = transition_;
    }
    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();
      if (transitionCase_ == 6) {
        transition_ = s;
      }
      return s;
    }
  }
  /**
   *
   *
   * <pre>
   * The target flow to transition to.
   * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
   * ID&gt;/flows/&lt;Flow ID&gt;`.
   * </pre>
   *
   * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
   *
   * @return The bytes for targetFlow.
   */
  public com.google.protobuf.ByteString getTargetFlowBytes() {
    java.lang.Object ref = "";
    if (transitionCase_ == 6) {
      ref = transition_;
    }
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      if (transitionCase_ == 6) {
        transition_ = b;
      }
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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 (fulfillmentResponse_ != null) {
      output.writeMessage(1, getFulfillmentResponse());
    }
    if (pageInfo_ != null) {
      output.writeMessage(2, getPageInfo());
    }
    if (sessionInfo_ != null) {
      output.writeMessage(3, getSessionInfo());
    }
    if (payload_ != null) {
      output.writeMessage(4, getPayload());
    }
    if (transitionCase_ == 5) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, transition_);
    }
    if (transitionCase_ == 6) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, transition_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (fulfillmentResponse_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getFulfillmentResponse());
    }
    if (pageInfo_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getPageInfo());
    }
    if (sessionInfo_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getSessionInfo());
    }
    if (payload_ != null) {
      size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPayload());
    }
    if (transitionCase_ == 5) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, transition_);
    }
    if (transitionCase_ == 6) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, transition_);
    }
    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.cx.v3beta1.WebhookResponse)) {
      return super.equals(obj);
    }
    com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse other =
        (com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse) obj;

    if (hasFulfillmentResponse() != other.hasFulfillmentResponse()) return false;
    if (hasFulfillmentResponse()) {
      if (!getFulfillmentResponse().equals(other.getFulfillmentResponse())) return false;
    }
    if (hasPageInfo() != other.hasPageInfo()) return false;
    if (hasPageInfo()) {
      if (!getPageInfo().equals(other.getPageInfo())) return false;
    }
    if (hasSessionInfo() != other.hasSessionInfo()) return false;
    if (hasSessionInfo()) {
      if (!getSessionInfo().equals(other.getSessionInfo())) return false;
    }
    if (hasPayload() != other.hasPayload()) return false;
    if (hasPayload()) {
      if (!getPayload().equals(other.getPayload())) return false;
    }
    if (!getTransitionCase().equals(other.getTransitionCase())) return false;
    switch (transitionCase_) {
      case 5:
        if (!getTargetPage().equals(other.getTargetPage())) return false;
        break;
      case 6:
        if (!getTargetFlow().equals(other.getTargetFlow())) return false;
        break;
      case 0:
      default:
    }
    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    if (hasFulfillmentResponse()) {
      hash = (37 * hash) + FULFILLMENT_RESPONSE_FIELD_NUMBER;
      hash = (53 * hash) + getFulfillmentResponse().hashCode();
    }
    if (hasPageInfo()) {
      hash = (37 * hash) + PAGE_INFO_FIELD_NUMBER;
      hash = (53 * hash) + getPageInfo().hashCode();
    }
    if (hasSessionInfo()) {
      hash = (37 * hash) + SESSION_INFO_FIELD_NUMBER;
      hash = (53 * hash) + getSessionInfo().hashCode();
    }
    if (hasPayload()) {
      hash = (37 * hash) + PAYLOAD_FIELD_NUMBER;
      hash = (53 * hash) + getPayload().hashCode();
    }
    switch (transitionCase_) {
      case 5:
        hash = (37 * hash) + TARGET_PAGE_FIELD_NUMBER;
        hash = (53 * hash) + getTargetPage().hashCode();
        break;
      case 6:
        hash = (37 * hash) + TARGET_FLOW_FIELD_NUMBER;
        hash = (53 * hash) + getTargetFlow().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  public static Builder newBuilder(
      com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }

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

  @java.lang.Override
  protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   *
   *
   * <pre>
   * The response message for a webhook call.
   * </pre>
   *
   * Protobuf type {@code google.cloud.dialogflow.cx.v3beta1.WebhookResponse}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.cloud.dialogflow.cx.v3beta1.WebhookResponse)
      com.google.cloud.dialogflow.cx.v3beta1.WebhookResponseOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.cloud.dialogflow.cx.v3beta1.WebhookProto
          .internal_static_google_cloud_dialogflow_cx_v3beta1_WebhookResponse_descriptor;
    }

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

    // Construct using com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      fulfillmentResponse_ = null;
      if (fulfillmentResponseBuilder_ != null) {
        fulfillmentResponseBuilder_.dispose();
        fulfillmentResponseBuilder_ = null;
      }
      pageInfo_ = null;
      if (pageInfoBuilder_ != null) {
        pageInfoBuilder_.dispose();
        pageInfoBuilder_ = null;
      }
      sessionInfo_ = null;
      if (sessionInfoBuilder_ != null) {
        sessionInfoBuilder_.dispose();
        sessionInfoBuilder_ = null;
      }
      payload_ = null;
      if (payloadBuilder_ != null) {
        payloadBuilder_.dispose();
        payloadBuilder_ = null;
      }
      transitionCase_ = 0;
      transition_ = null;
      return this;
    }

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

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

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

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

    private void buildPartial0(com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.fulfillmentResponse_ =
            fulfillmentResponseBuilder_ == null
                ? fulfillmentResponse_
                : fulfillmentResponseBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.pageInfo_ = pageInfoBuilder_ == null ? pageInfo_ : pageInfoBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000004) != 0)) {
        result.sessionInfo_ =
            sessionInfoBuilder_ == null ? sessionInfo_ : sessionInfoBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) != 0)) {
        result.payload_ = payloadBuilder_ == null ? payload_ : payloadBuilder_.build();
      }
    }

    private void buildPartialOneofs(com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse result) {
      result.transitionCase_ = transitionCase_;
      result.transition_ = this.transition_;
    }

    @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.cx.v3beta1.WebhookResponse) {
        return mergeFrom((com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse other) {
      if (other == com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.getDefaultInstance())
        return this;
      if (other.hasFulfillmentResponse()) {
        mergeFulfillmentResponse(other.getFulfillmentResponse());
      }
      if (other.hasPageInfo()) {
        mergePageInfo(other.getPageInfo());
      }
      if (other.hasSessionInfo()) {
        mergeSessionInfo(other.getSessionInfo());
      }
      if (other.hasPayload()) {
        mergePayload(other.getPayload());
      }
      switch (other.getTransitionCase()) {
        case TARGET_PAGE:
          {
            transitionCase_ = 5;
            transition_ = other.transition_;
            onChanged();
            break;
          }
        case TARGET_FLOW:
          {
            transitionCase_ = 6;
            transition_ = other.transition_;
            onChanged();
            break;
          }
        case TRANSITION_NOT_SET:
          {
            break;
          }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10:
              {
                input.readMessage(
                    getFulfillmentResponseFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                input.readMessage(getPageInfoFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(getSessionInfoFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000004;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getPayloadFieldBuilder().getBuilder(), extensionRegistry);
                bitField0_ |= 0x00000008;
                break;
              } // case 34
            case 42:
              {
                java.lang.String s = input.readStringRequireUtf8();
                transitionCase_ = 5;
                transition_ = s;
                break;
              } // case 42
            case 50:
              {
                java.lang.String s = input.readStringRequireUtf8();
                transitionCase_ = 6;
                transition_ = s;
                break;
              } // case 50
            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 transitionCase_ = 0;
    private java.lang.Object transition_;

    public TransitionCase getTransitionCase() {
      return TransitionCase.forNumber(transitionCase_);
    }

    public Builder clearTransition() {
      transitionCase_ = 0;
      transition_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        fulfillmentResponse_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse,
            com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder,
            com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder>
        fulfillmentResponseBuilder_;
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     *
     * @return Whether the fulfillmentResponse field is set.
     */
    public boolean hasFulfillmentResponse() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     *
     * @return The fulfillmentResponse.
     */
    public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
        getFulfillmentResponse() {
      if (fulfillmentResponseBuilder_ == null) {
        return fulfillmentResponse_ == null
            ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                .getDefaultInstance()
            : fulfillmentResponse_;
      } else {
        return fulfillmentResponseBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    public Builder setFulfillmentResponse(
        com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse value) {
      if (fulfillmentResponseBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        fulfillmentResponse_ = value;
      } else {
        fulfillmentResponseBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    public Builder setFulfillmentResponse(
        com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder
            builderForValue) {
      if (fulfillmentResponseBuilder_ == null) {
        fulfillmentResponse_ = builderForValue.build();
      } else {
        fulfillmentResponseBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    public Builder mergeFulfillmentResponse(
        com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse value) {
      if (fulfillmentResponseBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)
            && fulfillmentResponse_ != null
            && fulfillmentResponse_
                != com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                    .getDefaultInstance()) {
          getFulfillmentResponseBuilder().mergeFrom(value);
        } else {
          fulfillmentResponse_ = value;
        }
      } else {
        fulfillmentResponseBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    public Builder clearFulfillmentResponse() {
      bitField0_ = (bitField0_ & ~0x00000001);
      fulfillmentResponse_ = null;
      if (fulfillmentResponseBuilder_ != null) {
        fulfillmentResponseBuilder_.dispose();
        fulfillmentResponseBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder
        getFulfillmentResponseBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getFulfillmentResponseFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    public com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder
        getFulfillmentResponseOrBuilder() {
      if (fulfillmentResponseBuilder_ != null) {
        return fulfillmentResponseBuilder_.getMessageOrBuilder();
      } else {
        return fulfillmentResponse_ == null
            ? com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse
                .getDefaultInstance()
            : fulfillmentResponse_;
      }
    }
    /**
     *
     *
     * <pre>
     * The fulfillment response to send to the user. This field can be omitted by
     * the webhook if it does not intend to send any response to the user.
     * </pre>
     *
     * <code>
     * .google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse fulfillment_response = 1;
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse,
            com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder,
            com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponseOrBuilder>
        getFulfillmentResponseFieldBuilder() {
      if (fulfillmentResponseBuilder_ == null) {
        fulfillmentResponseBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse,
                com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse.FulfillmentResponse.Builder,
                com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse
                    .FulfillmentResponseOrBuilder>(
                getFulfillmentResponse(), getParentForChildren(), isClean());
        fulfillmentResponse_ = null;
      }
      return fulfillmentResponseBuilder_;
    }

    private com.google.cloud.dialogflow.cx.v3beta1.PageInfo pageInfo_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.cx.v3beta1.PageInfo,
            com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder,
            com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder>
        pageInfoBuilder_;
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     *
     * @return Whether the pageInfo field is set.
     */
    public boolean hasPageInfo() {
      return ((bitField0_ & 0x00000002) != 0);
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     *
     * @return The pageInfo.
     */
    public com.google.cloud.dialogflow.cx.v3beta1.PageInfo getPageInfo() {
      if (pageInfoBuilder_ == null) {
        return pageInfo_ == null
            ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance()
            : pageInfo_;
      } else {
        return pageInfoBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    public Builder setPageInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo value) {
      if (pageInfoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        pageInfo_ = value;
      } else {
        pageInfoBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    public Builder setPageInfo(
        com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder builderForValue) {
      if (pageInfoBuilder_ == null) {
        pageInfo_ = builderForValue.build();
      } else {
        pageInfoBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    public Builder mergePageInfo(com.google.cloud.dialogflow.cx.v3beta1.PageInfo value) {
      if (pageInfoBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)
            && pageInfo_ != null
            && pageInfo_ != com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance()) {
          getPageInfoBuilder().mergeFrom(value);
        } else {
          pageInfo_ = value;
        }
      } else {
        pageInfoBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    public Builder clearPageInfo() {
      bitField0_ = (bitField0_ & ~0x00000002);
      pageInfo_ = null;
      if (pageInfoBuilder_ != null) {
        pageInfoBuilder_.dispose();
        pageInfoBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    public com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder getPageInfoBuilder() {
      bitField0_ |= 0x00000002;
      onChanged();
      return getPageInfoFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    public com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder getPageInfoOrBuilder() {
      if (pageInfoBuilder_ != null) {
        return pageInfoBuilder_.getMessageOrBuilder();
      } else {
        return pageInfo_ == null
            ? com.google.cloud.dialogflow.cx.v3beta1.PageInfo.getDefaultInstance()
            : pageInfo_;
      }
    }
    /**
     *
     *
     * <pre>
     * Information about page status. This field can be omitted by the webhook if
     * it does not intend to modify page status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.PageInfo page_info = 2;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.cx.v3beta1.PageInfo,
            com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder,
            com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder>
        getPageInfoFieldBuilder() {
      if (pageInfoBuilder_ == null) {
        pageInfoBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.dialogflow.cx.v3beta1.PageInfo,
                com.google.cloud.dialogflow.cx.v3beta1.PageInfo.Builder,
                com.google.cloud.dialogflow.cx.v3beta1.PageInfoOrBuilder>(
                getPageInfo(), getParentForChildren(), isClean());
        pageInfo_ = null;
      }
      return pageInfoBuilder_;
    }

    private com.google.cloud.dialogflow.cx.v3beta1.SessionInfo sessionInfo_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.cx.v3beta1.SessionInfo,
            com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder,
            com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder>
        sessionInfoBuilder_;
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     *
     * @return Whether the sessionInfo field is set.
     */
    public boolean hasSessionInfo() {
      return ((bitField0_ & 0x00000004) != 0);
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     *
     * @return The sessionInfo.
     */
    public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo getSessionInfo() {
      if (sessionInfoBuilder_ == null) {
        return sessionInfo_ == null
            ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance()
            : sessionInfo_;
      } else {
        return sessionInfoBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    public Builder setSessionInfo(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo value) {
      if (sessionInfoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        sessionInfo_ = value;
      } else {
        sessionInfoBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    public Builder setSessionInfo(
        com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder builderForValue) {
      if (sessionInfoBuilder_ == null) {
        sessionInfo_ = builderForValue.build();
      } else {
        sessionInfoBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    public Builder mergeSessionInfo(com.google.cloud.dialogflow.cx.v3beta1.SessionInfo value) {
      if (sessionInfoBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)
            && sessionInfo_ != null
            && sessionInfo_
                != com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance()) {
          getSessionInfoBuilder().mergeFrom(value);
        } else {
          sessionInfo_ = value;
        }
      } else {
        sessionInfoBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    public Builder clearSessionInfo() {
      bitField0_ = (bitField0_ & ~0x00000004);
      sessionInfo_ = null;
      if (sessionInfoBuilder_ != null) {
        sessionInfoBuilder_.dispose();
        sessionInfoBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    public com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder getSessionInfoBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getSessionInfoFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    public com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder getSessionInfoOrBuilder() {
      if (sessionInfoBuilder_ != null) {
        return sessionInfoBuilder_.getMessageOrBuilder();
      } else {
        return sessionInfo_ == null
            ? com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.getDefaultInstance()
            : sessionInfo_;
      }
    }
    /**
     *
     *
     * <pre>
     * Information about session status. This field can be omitted by the webhook
     * if it does not intend to modify session status.
     * </pre>
     *
     * <code>.google.cloud.dialogflow.cx.v3beta1.SessionInfo session_info = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.cloud.dialogflow.cx.v3beta1.SessionInfo,
            com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder,
            com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder>
        getSessionInfoFieldBuilder() {
      if (sessionInfoBuilder_ == null) {
        sessionInfoBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.cloud.dialogflow.cx.v3beta1.SessionInfo,
                com.google.cloud.dialogflow.cx.v3beta1.SessionInfo.Builder,
                com.google.cloud.dialogflow.cx.v3beta1.SessionInfoOrBuilder>(
                getSessionInfo(), getParentForChildren(), isClean());
        sessionInfo_ = null;
      }
      return sessionInfoBuilder_;
    }

    private com.google.protobuf.Struct payload_;
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct,
            com.google.protobuf.Struct.Builder,
            com.google.protobuf.StructOrBuilder>
        payloadBuilder_;
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     *
     * @return Whether the payload field is set.
     */
    public boolean hasPayload() {
      return ((bitField0_ & 0x00000008) != 0);
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     *
     * @return The payload.
     */
    public com.google.protobuf.Struct getPayload() {
      if (payloadBuilder_ == null) {
        return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
      } else {
        return payloadBuilder_.getMessage();
      }
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder setPayload(com.google.protobuf.Struct value) {
      if (payloadBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        payload_ = value;
      } else {
        payloadBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder setPayload(com.google.protobuf.Struct.Builder builderForValue) {
      if (payloadBuilder_ == null) {
        payload_ = builderForValue.build();
      } else {
        payloadBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder mergePayload(com.google.protobuf.Struct value) {
      if (payloadBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)
            && payload_ != null
            && payload_ != com.google.protobuf.Struct.getDefaultInstance()) {
          getPayloadBuilder().mergeFrom(value);
        } else {
          payload_ = value;
        }
      } else {
        payloadBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public Builder clearPayload() {
      bitField0_ = (bitField0_ & ~0x00000008);
      payload_ = null;
      if (payloadBuilder_ != null) {
        payloadBuilder_.dispose();
        payloadBuilder_ = null;
      }
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public com.google.protobuf.Struct.Builder getPayloadBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getPayloadFieldBuilder().getBuilder();
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    public com.google.protobuf.StructOrBuilder getPayloadOrBuilder() {
      if (payloadBuilder_ != null) {
        return payloadBuilder_.getMessageOrBuilder();
      } else {
        return payload_ == null ? com.google.protobuf.Struct.getDefaultInstance() : payload_;
      }
    }
    /**
     *
     *
     * <pre>
     * Value to append directly to
     * [QueryResult.webhook_payloads][google.cloud.dialogflow.cx.v3beta1.QueryResult.webhook_payloads].
     * </pre>
     *
     * <code>.google.protobuf.Struct payload = 4;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.protobuf.Struct,
            com.google.protobuf.Struct.Builder,
            com.google.protobuf.StructOrBuilder>
        getPayloadFieldBuilder() {
      if (payloadBuilder_ == null) {
        payloadBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.protobuf.Struct,
                com.google.protobuf.Struct.Builder,
                com.google.protobuf.StructOrBuilder>(
                getPayload(), getParentForChildren(), isClean());
        payload_ = null;
      }
      return payloadBuilder_;
    }

    /**
     *
     *
     * <pre>
     * The target page to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
     * </pre>
     *
     * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return Whether the targetPage field is set.
     */
    @java.lang.Override
    public boolean hasTargetPage() {
      return transitionCase_ == 5;
    }
    /**
     *
     *
     * <pre>
     * The target page to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
     * </pre>
     *
     * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The targetPage.
     */
    @java.lang.Override
    public java.lang.String getTargetPage() {
      java.lang.Object ref = "";
      if (transitionCase_ == 5) {
        ref = transition_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (transitionCase_ == 5) {
          transition_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The target page to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
     * </pre>
     *
     * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for targetPage.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getTargetPageBytes() {
      java.lang.Object ref = "";
      if (transitionCase_ == 5) {
        ref = transition_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (transitionCase_ == 5) {
          transition_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The target page to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
     * </pre>
     *
     * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The targetPage to set.
     * @return This builder for chaining.
     */
    public Builder setTargetPage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      transitionCase_ = 5;
      transition_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The target page to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
     * </pre>
     *
     * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTargetPage() {
      if (transitionCase_ == 5) {
        transitionCase_ = 0;
        transition_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The target page to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;/pages/&lt;Page ID&gt;`.
     * </pre>
     *
     * <code>string target_page = 5 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for targetPage to set.
     * @return This builder for chaining.
     */
    public Builder setTargetPageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      transitionCase_ = 5;
      transition_ = value;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * The target flow to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;`.
     * </pre>
     *
     * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return Whether the targetFlow field is set.
     */
    @java.lang.Override
    public boolean hasTargetFlow() {
      return transitionCase_ == 6;
    }
    /**
     *
     *
     * <pre>
     * The target flow to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;`.
     * </pre>
     *
     * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The targetFlow.
     */
    @java.lang.Override
    public java.lang.String getTargetFlow() {
      java.lang.Object ref = "";
      if (transitionCase_ == 6) {
        ref = transition_;
      }
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (transitionCase_ == 6) {
          transition_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The target flow to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;`.
     * </pre>
     *
     * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return The bytes for targetFlow.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getTargetFlowBytes() {
      java.lang.Object ref = "";
      if (transitionCase_ == 6) {
        ref = transition_;
      }
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        if (transitionCase_ == 6) {
          transition_ = b;
        }
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     *
     *
     * <pre>
     * The target flow to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;`.
     * </pre>
     *
     * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The targetFlow to set.
     * @return This builder for chaining.
     */
    public Builder setTargetFlow(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      transitionCase_ = 6;
      transition_ = value;
      onChanged();
      return this;
    }
    /**
     *
     *
     * <pre>
     * The target flow to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;`.
     * </pre>
     *
     * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTargetFlow() {
      if (transitionCase_ == 6) {
        transitionCase_ = 0;
        transition_ = null;
        onChanged();
      }
      return this;
    }
    /**
     *
     *
     * <pre>
     * The target flow to transition to.
     * Format: `projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent
     * ID&gt;/flows/&lt;Flow ID&gt;`.
     * </pre>
     *
     * <code>string target_flow = 6 [(.google.api.resource_reference) = { ... }</code>
     *
     * @param value The bytes for targetFlow to set.
     * @return This builder for chaining.
     */
    public Builder setTargetFlowBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      transitionCase_ = 6;
      transition_ = value;
      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.cx.v3beta1.WebhookResponse)
  }

  // @@protoc_insertion_point(class_scope:google.cloud.dialogflow.cx.v3beta1.WebhookResponse)
  private static final com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.cloud.dialogflow.cx.v3beta1.WebhookResponse();
  }

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

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

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

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