/*
 * Copyright 2025 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/pubsub/v1/pubsub.proto

// Protobuf Java Version: 3.25.8
package com.google.pubsub.v1;

/**
 *
 *
 * <pre>
 * Payload of the Platform Log entry sent when a failure is encountered while
 * ingesting.
 * </pre>
 *
 * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent}
 */
public final class IngestionFailureEvent extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent)
    IngestionFailureEventOrBuilder {
  private static final long serialVersionUID = 0L;

  // Use IngestionFailureEvent.newBuilder() to construct.
  private IngestionFailureEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }

  private IngestionFailureEvent() {
    topic_ = "";
    errorMessage_ = "";
  }

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

  public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
    return com.google.pubsub.v1.PubsubProto
        .internal_static_google_pubsub_v1_IngestionFailureEvent_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.google.pubsub.v1.PubsubProto
        .internal_static_google_pubsub_v1_IngestionFailureEvent_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.google.pubsub.v1.IngestionFailureEvent.class,
            com.google.pubsub.v1.IngestionFailureEvent.Builder.class);
  }

  public interface ApiViolationReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.ApiViolationReason)
      com.google.protobuf.MessageOrBuilder {}

  /**
   *
   *
   * <pre>
   * Specifies the reason why some data may have been left out of
   * the desired Pub/Sub message due to the API message limits
   * (https://cloud.google.com/pubsub/quotas#resource_limits). For example,
   * when the number of attributes is larger than 100, the number of
   * attributes is truncated to 100 to respect the limit on the attribute count.
   * Other attribute limits are treated similarly. When the size of the desired
   * message would've been larger than 10MB, the message won't be published at
   * all, and ingestion of the subsequent messages will proceed as normal.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.ApiViolationReason}
   */
  public static final class ApiViolationReason extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.ApiViolationReason)
      ApiViolationReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use ApiViolationReason.newBuilder() to construct.
    private ApiViolationReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ApiViolationReason() {}

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_ApiViolationReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_ApiViolationReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder.class);
    }

    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 {
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      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.pubsub.v1.IngestionFailureEvent.ApiViolationReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) obj;

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

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason 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.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason 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.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason 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.pubsub.v1.IngestionFailureEvent.ApiViolationReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason 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.pubsub.v1.IngestionFailureEvent.ApiViolationReason 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>
     * Specifies the reason why some data may have been left out of
     * the desired Pub/Sub message due to the API message limits
     * (https://cloud.google.com/pubsub/quotas#resource_limits). For example,
     * when the number of attributes is larger than 100, the number of
     * attributes is truncated to 100 to respect the limit on the attribute count.
     * Other attribute limits are treated similarly. When the size of the desired
     * message would've been larger than 10MB, the message won't be published at
     * all, and ingestion of the subsequent messages will proceed as normal.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.ApiViolationReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.ApiViolationReason)
        com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_ApiViolationReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_ApiViolationReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder.class);
      }

      // Construct using com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.newBuilder()
      private Builder() {}

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

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

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_ApiViolationReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason(this);
        onBuilt();
        return result;
      }

      @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.pubsub.v1.IngestionFailureEvent.ApiViolationReason) {
          return mergeFrom((com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance())
          return this;
        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;
              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;
      }

      @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.pubsub.v1.IngestionFailureEvent.ApiViolationReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.ApiViolationReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface AvroFailureReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.AvroFailureReason)
      com.google.protobuf.MessageOrBuilder {}

  /**
   *
   *
   * <pre>
   * Set when an Avro file is unsupported or its format is not valid. When this
   * occurs, one or more Avro objects won't be ingested.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AvroFailureReason}
   */
  public static final class AvroFailureReason extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.AvroFailureReason)
      AvroFailureReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use AvroFailureReason.newBuilder() to construct.
    private AvroFailureReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private AvroFailureReason() {}

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AvroFailureReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AvroFailureReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder.class);
    }

    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 {
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      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.pubsub.v1.IngestionFailureEvent.AvroFailureReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) obj;

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

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason 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.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason 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.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason 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.pubsub.v1.IngestionFailureEvent.AvroFailureReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason 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.pubsub.v1.IngestionFailureEvent.AvroFailureReason 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>
     * Set when an Avro file is unsupported or its format is not valid. When this
     * occurs, one or more Avro objects won't be ingested.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AvroFailureReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.AvroFailureReason)
        com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AvroFailureReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AvroFailureReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder.class);
      }

      // Construct using com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.newBuilder()
      private Builder() {}

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

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

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AvroFailureReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason(this);
        onBuilt();
        return result;
      }

      @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.pubsub.v1.IngestionFailureEvent.AvroFailureReason) {
          return mergeFrom((com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance())
          return this;
        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;
              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;
      }

      @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.pubsub.v1.IngestionFailureEvent.AvroFailureReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.AvroFailureReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface SchemaViolationReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason)
      com.google.protobuf.MessageOrBuilder {}

  /**
   *
   *
   * <pre>
   * Set when a Pub/Sub message fails to get published due to a schema
   * validation violation.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason}
   */
  public static final class SchemaViolationReason extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason)
      SchemaViolationReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use SchemaViolationReason.newBuilder() to construct.
    private SchemaViolationReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private SchemaViolationReason() {}

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_SchemaViolationReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_SchemaViolationReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder.class);
    }

    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 {
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) obj;

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

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason 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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason 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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason 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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason 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>
     * Set when a Pub/Sub message fails to get published due to a schema
     * validation violation.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason)
        com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_SchemaViolationReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_SchemaViolationReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder.class);
      }

      // Construct using
      // com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.newBuilder()
      private Builder() {}

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

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

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_SchemaViolationReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason(this);
        onBuilt();
        return result;
      }

      @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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) {
          return mergeFrom(
              (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                .getDefaultInstance()) return this;
        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;
              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;
      }

      @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.pubsub.v1.IngestionFailureEvent.SchemaViolationReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface MessageTransformationFailureReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
      com.google.protobuf.MessageOrBuilder {}

  /**
   *
   *
   * <pre>
   * Set when a Pub/Sub message fails to get published due to a message
   * transformation error.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason}
   */
  public static final class MessageTransformationFailureReason
      extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
      MessageTransformationFailureReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use MessageTransformationFailureReason.newBuilder() to construct.
    private MessageTransformationFailureReason(
        com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private MessageTransformationFailureReason() {}

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_MessageTransformationFailureReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_MessageTransformationFailureReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
                  .class);
    }

    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 {
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason) obj;

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

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(
            java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason 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>
     * Set when a Pub/Sub message fails to get published due to a message
     * transformation error.
     * </pre>
     *
     * Protobuf type {@code
     * google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
        com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_MessageTransformationFailureReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_MessageTransformationFailureReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .Builder.class);
      }

      // Construct using
      // com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.newBuilder()
      private Builder() {}

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

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

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_MessageTransformationFailureReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason(this);
        onBuilt();
        return result;
      }

      @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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason) {
          return mergeFrom(
              (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                  other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                .getDefaultInstance()) return this;
        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;
              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;
      }

      @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.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent
            .MessageTransformationFailureReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface CloudStorageFailureOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage bucket used for ingestion.
     * </pre>
     *
     * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bucket.
     */
    java.lang.String getBucket();

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage bucket used for ingestion.
     * </pre>
     *
     * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for bucket.
     */
    com.google.protobuf.ByteString getBucketBytes();

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage object which contained the section
     * that couldn't be ingested.
     * </pre>
     *
     * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The objectName.
     */
    java.lang.String getObjectName();

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage object which contained the section
     * that couldn't be ingested.
     * </pre>
     *
     * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for objectName.
     */
    com.google.protobuf.ByteString getObjectNameBytes();

    /**
     *
     *
     * <pre>
     * Optional. Generation of the Cloud Storage object which contained the
     * section that couldn't be ingested.
     * </pre>
     *
     * <code>int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The objectGeneration.
     */
    long getObjectGeneration();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when parsing an Avro file.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the avroFailureReason field is set.
     */
    boolean hasAvroFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when parsing an Avro file.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The avroFailureReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason getAvroFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when parsing an Avro file.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder
        getAvroFailureReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    boolean hasApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    boolean hasSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason getSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    boolean hasMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder();

    com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.ReasonCase getReasonCase();
  }

  /**
   *
   *
   * <pre>
   * Failure when ingesting from a Cloud Storage source.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure}
   */
  public static final class CloudStorageFailure extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure)
      CloudStorageFailureOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use CloudStorageFailure.newBuilder() to construct.
    private CloudStorageFailure(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private CloudStorageFailure() {
      bucket_ = "";
      objectName_ = "";
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_CloudStorageFailure_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_CloudStorageFailure_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.class,
              com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder.class);
    }

    private int reasonCase_ = 0;

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

    public enum ReasonCase
        implements
            com.google.protobuf.Internal.EnumLite,
            com.google.protobuf.AbstractMessage.InternalOneOfEnum {
      AVRO_FAILURE_REASON(5),
      API_VIOLATION_REASON(6),
      SCHEMA_VIOLATION_REASON(7),
      MESSAGE_TRANSFORMATION_FAILURE_REASON(8),
      REASON_NOT_SET(0);
      private final int value;

      private ReasonCase(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 ReasonCase valueOf(int value) {
        return forNumber(value);
      }

      public static ReasonCase forNumber(int value) {
        switch (value) {
          case 5:
            return AVRO_FAILURE_REASON;
          case 6:
            return API_VIOLATION_REASON;
          case 7:
            return SCHEMA_VIOLATION_REASON;
          case 8:
            return MESSAGE_TRANSFORMATION_FAILURE_REASON;
          case 0:
            return REASON_NOT_SET;
          default:
            return null;
        }
      }

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

    public ReasonCase getReasonCase() {
      return ReasonCase.forNumber(reasonCase_);
    }

    public static final int BUCKET_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private volatile java.lang.Object bucket_ = "";

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage bucket used for ingestion.
     * </pre>
     *
     * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bucket.
     */
    @java.lang.Override
    public java.lang.String getBucket() {
      java.lang.Object ref = bucket_;
      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();
        bucket_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage bucket used for ingestion.
     * </pre>
     *
     * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for bucket.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getBucketBytes() {
      java.lang.Object ref = bucket_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        bucket_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int OBJECT_NAME_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private volatile java.lang.Object objectName_ = "";

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage object which contained the section
     * that couldn't be ingested.
     * </pre>
     *
     * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The objectName.
     */
    @java.lang.Override
    public java.lang.String getObjectName() {
      java.lang.Object ref = objectName_;
      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();
        objectName_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Name of the Cloud Storage object which contained the section
     * that couldn't be ingested.
     * </pre>
     *
     * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for objectName.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getObjectNameBytes() {
      java.lang.Object ref = objectName_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        objectName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int OBJECT_GENERATION_FIELD_NUMBER = 3;
    private long objectGeneration_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. Generation of the Cloud Storage object which contained the
     * section that couldn't be ingested.
     * </pre>
     *
     * <code>int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The objectGeneration.
     */
    @java.lang.Override
    public long getObjectGeneration() {
      return objectGeneration_;
    }

    public static final int AVRO_FAILURE_REASON_FIELD_NUMBER = 5;

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when parsing an Avro file.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the avroFailureReason field is set.
     */
    @java.lang.Override
    public boolean hasAvroFailureReason() {
      return reasonCase_ == 5;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when parsing an Avro file.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The avroFailureReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason getAvroFailureReason() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when parsing an Avro file.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder
        getAvroFailureReasonOrBuilder() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
    }

    public static final int API_VIOLATION_REASON_FIELD_NUMBER = 6;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasApiViolationReason() {
      return reasonCase_ == 6;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    public static final int SCHEMA_VIOLATION_REASON_FIELD_NUMBER = 7;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasSchemaViolationReason() {
      return reasonCase_ == 7;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getSchemaViolationReason() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    public static final int MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER = 8;

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    @java.lang.Override
    public boolean hasMessageTransformationFailureReason() {
      return reasonCase_ == 8;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason() {
      if (reasonCase_ == 8) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder() {
      if (reasonCase_ == 8) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    private byte memoizedIsInitialized = -1;

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

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, bucket_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(objectName_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, objectName_);
      }
      if (objectGeneration_ != 0L) {
        output.writeInt64(3, objectGeneration_);
      }
      if (reasonCase_ == 5) {
        output.writeMessage(
            5, (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_);
      }
      if (reasonCase_ == 6) {
        output.writeMessage(
            6, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        output.writeMessage(
            7, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 8) {
        output.writeMessage(
            8,
            (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(bucket_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, bucket_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(objectName_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, objectName_);
      }
      if (objectGeneration_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, objectGeneration_);
      }
      if (reasonCase_ == 5) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                5, (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_);
      }
      if (reasonCase_ == 6) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                6, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                7, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 8) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                8,
                (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                    reason_);
      }
      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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure other =
          (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) obj;

      if (!getBucket().equals(other.getBucket())) return false;
      if (!getObjectName().equals(other.getObjectName())) return false;
      if (getObjectGeneration() != other.getObjectGeneration()) return false;
      if (!getReasonCase().equals(other.getReasonCase())) return false;
      switch (reasonCase_) {
        case 5:
          if (!getAvroFailureReason().equals(other.getAvroFailureReason())) return false;
          break;
        case 6:
          if (!getApiViolationReason().equals(other.getApiViolationReason())) return false;
          break;
        case 7:
          if (!getSchemaViolationReason().equals(other.getSchemaViolationReason())) return false;
          break;
        case 8:
          if (!getMessageTransformationFailureReason()
              .equals(other.getMessageTransformationFailureReason())) 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();
      hash = (37 * hash) + BUCKET_FIELD_NUMBER;
      hash = (53 * hash) + getBucket().hashCode();
      hash = (37 * hash) + OBJECT_NAME_FIELD_NUMBER;
      hash = (53 * hash) + getObjectName().hashCode();
      hash = (37 * hash) + OBJECT_GENERATION_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getObjectGeneration());
      switch (reasonCase_) {
        case 5:
          hash = (37 * hash) + AVRO_FAILURE_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getAvroFailureReason().hashCode();
          break;
        case 6:
          hash = (37 * hash) + API_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getApiViolationReason().hashCode();
          break;
        case 7:
          hash = (37 * hash) + SCHEMA_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getSchemaViolationReason().hashCode();
          break;
        case 8:
          hash = (37 * hash) + MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getMessageTransformationFailureReason().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure 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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure 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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure 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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure 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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure 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>
     * Failure when ingesting from a Cloud Storage source.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure)
        com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailureOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_CloudStorageFailure_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_CloudStorageFailure_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.class,
                com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder.class);
      }

      // Construct using com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        bucket_ = "";
        objectName_ = "";
        objectGeneration_ = 0L;
        if (avroFailureReasonBuilder_ != null) {
          avroFailureReasonBuilder_.clear();
        }
        if (apiViolationReasonBuilder_ != null) {
          apiViolationReasonBuilder_.clear();
        }
        if (schemaViolationReasonBuilder_ != null) {
          schemaViolationReasonBuilder_.clear();
        }
        if (messageTransformationFailureReasonBuilder_ != null) {
          messageTransformationFailureReasonBuilder_.clear();
        }
        reasonCase_ = 0;
        reason_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_CloudStorageFailure_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure build() {
        com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure result =
            new com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        buildPartialOneofs(result);
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.bucket_ = bucket_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.objectName_ = objectName_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.objectGeneration_ = objectGeneration_;
        }
      }

      private void buildPartialOneofs(
          com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure result) {
        result.reasonCase_ = reasonCase_;
        result.reason_ = this.reason_;
        if (reasonCase_ == 5 && avroFailureReasonBuilder_ != null) {
          result.reason_ = avroFailureReasonBuilder_.build();
        }
        if (reasonCase_ == 6 && apiViolationReasonBuilder_ != null) {
          result.reason_ = apiViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 7 && schemaViolationReasonBuilder_ != null) {
          result.reason_ = schemaViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 8 && messageTransformationFailureReasonBuilder_ != null) {
          result.reason_ = messageTransformationFailureReasonBuilder_.build();
        }
      }

      @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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) {
          return mergeFrom((com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance())
          return this;
        if (!other.getBucket().isEmpty()) {
          bucket_ = other.bucket_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (!other.getObjectName().isEmpty()) {
          objectName_ = other.objectName_;
          bitField0_ |= 0x00000002;
          onChanged();
        }
        if (other.getObjectGeneration() != 0L) {
          setObjectGeneration(other.getObjectGeneration());
        }
        switch (other.getReasonCase()) {
          case AVRO_FAILURE_REASON:
            {
              mergeAvroFailureReason(other.getAvroFailureReason());
              break;
            }
          case API_VIOLATION_REASON:
            {
              mergeApiViolationReason(other.getApiViolationReason());
              break;
            }
          case SCHEMA_VIOLATION_REASON:
            {
              mergeSchemaViolationReason(other.getSchemaViolationReason());
              break;
            }
          case MESSAGE_TRANSFORMATION_FAILURE_REASON:
            {
              mergeMessageTransformationFailureReason(
                  other.getMessageTransformationFailureReason());
              break;
            }
          case REASON_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:
                {
                  bucket_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  objectName_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              case 24:
                {
                  objectGeneration_ = input.readInt64();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 24
              case 42:
                {
                  input.readMessage(
                      getAvroFailureReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 5;
                  break;
                } // case 42
              case 50:
                {
                  input.readMessage(
                      getApiViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 6;
                  break;
                } // case 50
              case 58:
                {
                  input.readMessage(
                      getSchemaViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 7;
                  break;
                } // case 58
              case 66:
                {
                  input.readMessage(
                      getMessageTransformationFailureReasonFieldBuilder().getBuilder(),
                      extensionRegistry);
                  reasonCase_ = 8;
                  break;
                } // case 66
              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 reasonCase_ = 0;
      private java.lang.Object reason_;

      public ReasonCase getReasonCase() {
        return ReasonCase.forNumber(reasonCase_);
      }

      public Builder clearReason() {
        reasonCase_ = 0;
        reason_ = null;
        onChanged();
        return this;
      }

      private int bitField0_;

      private java.lang.Object bucket_ = "";

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage bucket used for ingestion.
       * </pre>
       *
       * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bucket.
       */
      public java.lang.String getBucket() {
        java.lang.Object ref = bucket_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          bucket_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage bucket used for ingestion.
       * </pre>
       *
       * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for bucket.
       */
      public com.google.protobuf.ByteString getBucketBytes() {
        java.lang.Object ref = bucket_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          bucket_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage bucket used for ingestion.
       * </pre>
       *
       * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bucket to set.
       * @return This builder for chaining.
       */
      public Builder setBucket(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bucket_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage bucket used for ingestion.
       * </pre>
       *
       * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearBucket() {
        bucket_ = getDefaultInstance().getBucket();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage bucket used for ingestion.
       * </pre>
       *
       * <code>string bucket = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for bucket to set.
       * @return This builder for chaining.
       */
      public Builder setBucketBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        bucket_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private java.lang.Object objectName_ = "";

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage object which contained the section
       * that couldn't be ingested.
       * </pre>
       *
       * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The objectName.
       */
      public java.lang.String getObjectName() {
        java.lang.Object ref = objectName_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          objectName_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage object which contained the section
       * that couldn't be ingested.
       * </pre>
       *
       * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for objectName.
       */
      public com.google.protobuf.ByteString getObjectNameBytes() {
        java.lang.Object ref = objectName_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          objectName_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage object which contained the section
       * that couldn't be ingested.
       * </pre>
       *
       * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The objectName to set.
       * @return This builder for chaining.
       */
      public Builder setObjectName(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        objectName_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage object which contained the section
       * that couldn't be ingested.
       * </pre>
       *
       * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearObjectName() {
        objectName_ = getDefaultInstance().getObjectName();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Name of the Cloud Storage object which contained the section
       * that couldn't be ingested.
       * </pre>
       *
       * <code>string object_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for objectName to set.
       * @return This builder for chaining.
       */
      public Builder setObjectNameBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        objectName_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      private long objectGeneration_;

      /**
       *
       *
       * <pre>
       * Optional. Generation of the Cloud Storage object which contained the
       * section that couldn't be ingested.
       * </pre>
       *
       * <code>int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The objectGeneration.
       */
      @java.lang.Override
      public long getObjectGeneration() {
        return objectGeneration_;
      }

      /**
       *
       *
       * <pre>
       * Optional. Generation of the Cloud Storage object which contained the
       * section that couldn't be ingested.
       * </pre>
       *
       * <code>int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The objectGeneration to set.
       * @return This builder for chaining.
       */
      public Builder setObjectGeneration(long value) {

        objectGeneration_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Generation of the Cloud Storage object which contained the
       * section that couldn't be ingested.
       * </pre>
       *
       * <code>int64 object_generation = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearObjectGeneration() {
        bitField0_ = (bitField0_ & ~0x00000004);
        objectGeneration_ = 0L;
        onChanged();
        return this;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder>
          avroFailureReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the avroFailureReason field is set.
       */
      @java.lang.Override
      public boolean hasAvroFailureReason() {
        return reasonCase_ == 5;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The avroFailureReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason getAvroFailureReason() {
        if (avroFailureReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
        } else {
          if (reasonCase_ == 5) {
            return avroFailureReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setAvroFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason value) {
        if (avroFailureReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          avroFailureReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setAvroFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder builderForValue) {
        if (avroFailureReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          avroFailureReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeAvroFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason value) {
        if (avroFailureReasonBuilder_ == null) {
          if (reasonCase_ == 5
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 5) {
            avroFailureReasonBuilder_.mergeFrom(value);
          } else {
            avroFailureReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearAvroFailureReason() {
        if (avroFailureReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
          }
          avroFailureReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder
          getAvroFailureReasonBuilder() {
        return getAvroFailureReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder
          getAvroFailureReasonOrBuilder() {
        if ((reasonCase_ == 5) && (avroFailureReasonBuilder_ != null)) {
          return avroFailureReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when parsing an Avro file.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.AvroFailureReason avro_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder>
          getAvroFailureReasonFieldBuilder() {
        if (avroFailureReasonBuilder_ == null) {
          if (!(reasonCase_ == 5)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.getDefaultInstance();
          }
          avroFailureReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason,
                  com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.AvroFailureReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 5;
        onChanged();
        return avroFailureReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          apiViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the apiViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasApiViolationReason() {
        return reasonCase_ == 6;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The apiViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        } else {
          if (reasonCase_ == 6) {
            return apiViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder builderForValue) {
        if (apiViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 6) {
            apiViolationReasonBuilder_.mergeFrom(value);
          } else {
            apiViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
          }
          apiViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder
          getApiViolationReasonBuilder() {
        return getApiViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
          getApiViolationReasonOrBuilder() {
        if ((reasonCase_ == 6) && (apiViolationReasonBuilder_ != null)) {
          return apiViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          getApiViolationReasonFieldBuilder() {
        if (apiViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 6)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
          }
          apiViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 6;
        onChanged();
        return apiViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          schemaViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the schemaViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasSchemaViolationReason() {
        return reasonCase_ == 7;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The schemaViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
          getSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 7) {
            return schemaViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
              builderForValue) {
        if (schemaViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 7
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 7) {
            schemaViolationReasonBuilder_.mergeFrom(value);
          } else {
            schemaViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
          }
          schemaViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
          getSchemaViolationReasonBuilder() {
        return getSchemaViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
          getSchemaViolationReasonOrBuilder() {
        if ((reasonCase_ == 7) && (schemaViolationReasonBuilder_ != null)) {
          return schemaViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          getSchemaViolationReasonFieldBuilder() {
        if (schemaViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 7)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                    .getDefaultInstance();
          }
          schemaViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 7;
        onChanged();
        return schemaViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          messageTransformationFailureReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the messageTransformationFailureReason field is set.
       */
      @java.lang.Override
      public boolean hasMessageTransformationFailureReason() {
        return reasonCase_ == 8;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The messageTransformationFailureReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          getMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 8) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 8) {
            return messageTransformationFailureReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 8;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
              builderForValue) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 8;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 8
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent
                                .MessageTransformationFailureReason)
                            reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 8) {
            messageTransformationFailureReasonBuilder_.mergeFrom(value);
          } else {
            messageTransformationFailureReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 8;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 8) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 8) {
            reasonCase_ = 0;
            reason_ = null;
          }
          messageTransformationFailureReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
          getMessageTransformationFailureReasonBuilder() {
        return getMessageTransformationFailureReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
          getMessageTransformationFailureReasonOrBuilder() {
        if ((reasonCase_ == 8) && (messageTransformationFailureReasonBuilder_ != null)) {
          return messageTransformationFailureReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 8) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 8 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          getMessageTransformationFailureReasonFieldBuilder() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (!(reasonCase_ == 8)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .getDefaultInstance();
          }
          messageTransformationFailureReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .Builder,
                  com.google.pubsub.v1.IngestionFailureEvent
                      .MessageTransformationFailureReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                      reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 8;
        onChanged();
        return messageTransformationFailureReasonBuilder_;
      }

      @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.pubsub.v1.IngestionFailureEvent.CloudStorageFailure)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure)
    private static final com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface AwsMskFailureReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. The ARN of the cluster of the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The clusterArn.
     */
    java.lang.String getClusterArn();

    /**
     *
     *
     * <pre>
     * Optional. The ARN of the cluster of the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for clusterArn.
     */
    com.google.protobuf.ByteString getClusterArnBytes();

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The kafkaTopic.
     */
    java.lang.String getKafkaTopic();

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for kafkaTopic.
     */
    com.google.protobuf.ByteString getKafkaTopicBytes();

    /**
     *
     *
     * <pre>
     * Optional. The partition ID of the message that failed to be ingested.
     * </pre>
     *
     * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionId.
     */
    long getPartitionId();

    /**
     *
     *
     * <pre>
     * Optional. The offset within the partition of the message that failed to
     * be ingested.
     * </pre>
     *
     * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The offset.
     */
    long getOffset();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    boolean hasApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    boolean hasSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason getSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    boolean hasMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder();

    com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.ReasonCase getReasonCase();
  }

  /**
   *
   *
   * <pre>
   * Failure when ingesting from an Amazon MSK source.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason}
   */
  public static final class AwsMskFailureReason extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason)
      AwsMskFailureReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use AwsMskFailureReason.newBuilder() to construct.
    private AwsMskFailureReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private AwsMskFailureReason() {
      clusterArn_ = "";
      kafkaTopic_ = "";
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsMskFailureReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsMskFailureReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder.class);
    }

    private int reasonCase_ = 0;

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

    public enum ReasonCase
        implements
            com.google.protobuf.Internal.EnumLite,
            com.google.protobuf.AbstractMessage.InternalOneOfEnum {
      API_VIOLATION_REASON(5),
      SCHEMA_VIOLATION_REASON(6),
      MESSAGE_TRANSFORMATION_FAILURE_REASON(7),
      REASON_NOT_SET(0);
      private final int value;

      private ReasonCase(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 ReasonCase valueOf(int value) {
        return forNumber(value);
      }

      public static ReasonCase forNumber(int value) {
        switch (value) {
          case 5:
            return API_VIOLATION_REASON;
          case 6:
            return SCHEMA_VIOLATION_REASON;
          case 7:
            return MESSAGE_TRANSFORMATION_FAILURE_REASON;
          case 0:
            return REASON_NOT_SET;
          default:
            return null;
        }
      }

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

    public ReasonCase getReasonCase() {
      return ReasonCase.forNumber(reasonCase_);
    }

    public static final int CLUSTER_ARN_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private volatile java.lang.Object clusterArn_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The ARN of the cluster of the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The clusterArn.
     */
    @java.lang.Override
    public java.lang.String getClusterArn() {
      java.lang.Object ref = clusterArn_;
      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();
        clusterArn_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The ARN of the cluster of the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for clusterArn.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getClusterArnBytes() {
      java.lang.Object ref = clusterArn_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        clusterArn_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int KAFKA_TOPIC_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private volatile java.lang.Object kafkaTopic_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The kafkaTopic.
     */
    @java.lang.Override
    public java.lang.String getKafkaTopic() {
      java.lang.Object ref = kafkaTopic_;
      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();
        kafkaTopic_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for kafkaTopic.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getKafkaTopicBytes() {
      java.lang.Object ref = kafkaTopic_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        kafkaTopic_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int PARTITION_ID_FIELD_NUMBER = 3;
    private long partitionId_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. The partition ID of the message that failed to be ingested.
     * </pre>
     *
     * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionId.
     */
    @java.lang.Override
    public long getPartitionId() {
      return partitionId_;
    }

    public static final int OFFSET_FIELD_NUMBER = 4;
    private long offset_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. The offset within the partition of the message that failed to
     * be ingested.
     * </pre>
     *
     * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The offset.
     */
    @java.lang.Override
    public long getOffset() {
      return offset_;
    }

    public static final int API_VIOLATION_REASON_FIELD_NUMBER = 5;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasApiViolationReason() {
      return reasonCase_ == 5;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    public static final int SCHEMA_VIOLATION_REASON_FIELD_NUMBER = 6;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasSchemaViolationReason() {
      return reasonCase_ == 6;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getSchemaViolationReason() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    public static final int MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER = 7;

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    @java.lang.Override
    public boolean hasMessageTransformationFailureReason() {
      return reasonCase_ == 7;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    private byte memoizedIsInitialized = -1;

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

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterArn_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clusterArn_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kafkaTopic_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kafkaTopic_);
      }
      if (partitionId_ != 0L) {
        output.writeInt64(3, partitionId_);
      }
      if (offset_ != 0L) {
        output.writeInt64(4, offset_);
      }
      if (reasonCase_ == 5) {
        output.writeMessage(
            5, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 6) {
        output.writeMessage(
            6, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        output.writeMessage(
            7,
            (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterArn_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clusterArn_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kafkaTopic_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kafkaTopic_);
      }
      if (partitionId_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, partitionId_);
      }
      if (offset_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, offset_);
      }
      if (reasonCase_ == 5) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                5, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 6) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                6, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                7,
                (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                    reason_);
      }
      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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) obj;

      if (!getClusterArn().equals(other.getClusterArn())) return false;
      if (!getKafkaTopic().equals(other.getKafkaTopic())) return false;
      if (getPartitionId() != other.getPartitionId()) return false;
      if (getOffset() != other.getOffset()) return false;
      if (!getReasonCase().equals(other.getReasonCase())) return false;
      switch (reasonCase_) {
        case 5:
          if (!getApiViolationReason().equals(other.getApiViolationReason())) return false;
          break;
        case 6:
          if (!getSchemaViolationReason().equals(other.getSchemaViolationReason())) return false;
          break;
        case 7:
          if (!getMessageTransformationFailureReason()
              .equals(other.getMessageTransformationFailureReason())) 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();
      hash = (37 * hash) + CLUSTER_ARN_FIELD_NUMBER;
      hash = (53 * hash) + getClusterArn().hashCode();
      hash = (37 * hash) + KAFKA_TOPIC_FIELD_NUMBER;
      hash = (53 * hash) + getKafkaTopic().hashCode();
      hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPartitionId());
      hash = (37 * hash) + OFFSET_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffset());
      switch (reasonCase_) {
        case 5:
          hash = (37 * hash) + API_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getApiViolationReason().hashCode();
          break;
        case 6:
          hash = (37 * hash) + SCHEMA_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getSchemaViolationReason().hashCode();
          break;
        case 7:
          hash = (37 * hash) + MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getMessageTransformationFailureReason().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseDelimitedFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason 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>
     * Failure when ingesting from an Amazon MSK source.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason)
        com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsMskFailureReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsMskFailureReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder.class);
      }

      // Construct using com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        clusterArn_ = "";
        kafkaTopic_ = "";
        partitionId_ = 0L;
        offset_ = 0L;
        if (apiViolationReasonBuilder_ != null) {
          apiViolationReasonBuilder_.clear();
        }
        if (schemaViolationReasonBuilder_ != null) {
          schemaViolationReasonBuilder_.clear();
        }
        if (messageTransformationFailureReasonBuilder_ != null) {
          messageTransformationFailureReasonBuilder_.clear();
        }
        reasonCase_ = 0;
        reason_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsMskFailureReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        buildPartialOneofs(result);
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.clusterArn_ = clusterArn_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.kafkaTopic_ = kafkaTopic_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.partitionId_ = partitionId_;
        }
        if (((from_bitField0_ & 0x00000008) != 0)) {
          result.offset_ = offset_;
        }
      }

      private void buildPartialOneofs(
          com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason result) {
        result.reasonCase_ = reasonCase_;
        result.reason_ = this.reason_;
        if (reasonCase_ == 5 && apiViolationReasonBuilder_ != null) {
          result.reason_ = apiViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 6 && schemaViolationReasonBuilder_ != null) {
          result.reason_ = schemaViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 7 && messageTransformationFailureReasonBuilder_ != null) {
          result.reason_ = messageTransformationFailureReasonBuilder_.build();
        }
      }

      @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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) {
          return mergeFrom((com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance())
          return this;
        if (!other.getClusterArn().isEmpty()) {
          clusterArn_ = other.clusterArn_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (!other.getKafkaTopic().isEmpty()) {
          kafkaTopic_ = other.kafkaTopic_;
          bitField0_ |= 0x00000002;
          onChanged();
        }
        if (other.getPartitionId() != 0L) {
          setPartitionId(other.getPartitionId());
        }
        if (other.getOffset() != 0L) {
          setOffset(other.getOffset());
        }
        switch (other.getReasonCase()) {
          case API_VIOLATION_REASON:
            {
              mergeApiViolationReason(other.getApiViolationReason());
              break;
            }
          case SCHEMA_VIOLATION_REASON:
            {
              mergeSchemaViolationReason(other.getSchemaViolationReason());
              break;
            }
          case MESSAGE_TRANSFORMATION_FAILURE_REASON:
            {
              mergeMessageTransformationFailureReason(
                  other.getMessageTransformationFailureReason());
              break;
            }
          case REASON_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:
                {
                  clusterArn_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  kafkaTopic_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              case 24:
                {
                  partitionId_ = input.readInt64();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 24
              case 32:
                {
                  offset_ = input.readInt64();
                  bitField0_ |= 0x00000008;
                  break;
                } // case 32
              case 42:
                {
                  input.readMessage(
                      getApiViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 5;
                  break;
                } // case 42
              case 50:
                {
                  input.readMessage(
                      getSchemaViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 6;
                  break;
                } // case 50
              case 58:
                {
                  input.readMessage(
                      getMessageTransformationFailureReasonFieldBuilder().getBuilder(),
                      extensionRegistry);
                  reasonCase_ = 7;
                  break;
                } // case 58
              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 reasonCase_ = 0;
      private java.lang.Object reason_;

      public ReasonCase getReasonCase() {
        return ReasonCase.forNumber(reasonCase_);
      }

      public Builder clearReason() {
        reasonCase_ = 0;
        reason_ = null;
        onChanged();
        return this;
      }

      private int bitField0_;

      private java.lang.Object clusterArn_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The ARN of the cluster of the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The clusterArn.
       */
      public java.lang.String getClusterArn() {
        java.lang.Object ref = clusterArn_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          clusterArn_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The ARN of the cluster of the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for clusterArn.
       */
      public com.google.protobuf.ByteString getClusterArnBytes() {
        java.lang.Object ref = clusterArn_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          clusterArn_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The ARN of the cluster of the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The clusterArn to set.
       * @return This builder for chaining.
       */
      public Builder setClusterArn(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        clusterArn_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The ARN of the cluster of the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearClusterArn() {
        clusterArn_ = getDefaultInstance().getClusterArn();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The ARN of the cluster of the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for clusterArn to set.
       * @return This builder for chaining.
       */
      public Builder setClusterArnBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        clusterArn_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private java.lang.Object kafkaTopic_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The kafkaTopic.
       */
      public java.lang.String getKafkaTopic() {
        java.lang.Object ref = kafkaTopic_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          kafkaTopic_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for kafkaTopic.
       */
      public com.google.protobuf.ByteString getKafkaTopicBytes() {
        java.lang.Object ref = kafkaTopic_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          kafkaTopic_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The kafkaTopic to set.
       * @return This builder for chaining.
       */
      public Builder setKafkaTopic(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        kafkaTopic_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearKafkaTopic() {
        kafkaTopic_ = getDefaultInstance().getKafkaTopic();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for kafkaTopic to set.
       * @return This builder for chaining.
       */
      public Builder setKafkaTopicBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        kafkaTopic_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      private long partitionId_;

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The partitionId.
       */
      @java.lang.Override
      public long getPartitionId() {
        return partitionId_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The partitionId to set.
       * @return This builder for chaining.
       */
      public Builder setPartitionId(long value) {

        partitionId_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPartitionId() {
        bitField0_ = (bitField0_ & ~0x00000004);
        partitionId_ = 0L;
        onChanged();
        return this;
      }

      private long offset_;

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The offset.
       */
      @java.lang.Override
      public long getOffset() {
        return offset_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The offset to set.
       * @return This builder for chaining.
       */
      public Builder setOffset(long value) {

        offset_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearOffset() {
        bitField0_ = (bitField0_ & ~0x00000008);
        offset_ = 0L;
        onChanged();
        return this;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          apiViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the apiViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasApiViolationReason() {
        return reasonCase_ == 5;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The apiViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        } else {
          if (reasonCase_ == 5) {
            return apiViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder builderForValue) {
        if (apiViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 5) {
            apiViolationReasonBuilder_.mergeFrom(value);
          } else {
            apiViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
          }
          apiViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder
          getApiViolationReasonBuilder() {
        return getApiViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
          getApiViolationReasonOrBuilder() {
        if ((reasonCase_ == 5) && (apiViolationReasonBuilder_ != null)) {
          return apiViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          getApiViolationReasonFieldBuilder() {
        if (apiViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 5)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
          }
          apiViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 5;
        onChanged();
        return apiViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          schemaViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the schemaViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasSchemaViolationReason() {
        return reasonCase_ == 6;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The schemaViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
          getSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 6) {
            return schemaViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
              builderForValue) {
        if (schemaViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 6) {
            schemaViolationReasonBuilder_.mergeFrom(value);
          } else {
            schemaViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
          }
          schemaViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
          getSchemaViolationReasonBuilder() {
        return getSchemaViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
          getSchemaViolationReasonOrBuilder() {
        if ((reasonCase_ == 6) && (schemaViolationReasonBuilder_ != null)) {
          return schemaViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          getSchemaViolationReasonFieldBuilder() {
        if (schemaViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 6)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                    .getDefaultInstance();
          }
          schemaViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 6;
        onChanged();
        return schemaViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          messageTransformationFailureReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the messageTransformationFailureReason field is set.
       */
      @java.lang.Override
      public boolean hasMessageTransformationFailureReason() {
        return reasonCase_ == 7;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The messageTransformationFailureReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          getMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 7) {
            return messageTransformationFailureReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
              builderForValue) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent
                                .MessageTransformationFailureReason)
                            reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 7) {
            messageTransformationFailureReasonBuilder_.mergeFrom(value);
          } else {
            messageTransformationFailureReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
          }
          messageTransformationFailureReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
          getMessageTransformationFailureReasonBuilder() {
        return getMessageTransformationFailureReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
          getMessageTransformationFailureReasonOrBuilder() {
        if ((reasonCase_ == 7) && (messageTransformationFailureReasonBuilder_ != null)) {
          return messageTransformationFailureReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          getMessageTransformationFailureReasonFieldBuilder() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (!(reasonCase_ == 7)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .getDefaultInstance();
          }
          messageTransformationFailureReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .Builder,
                  com.google.pubsub.v1.IngestionFailureEvent
                      .MessageTransformationFailureReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                      reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 7;
        onChanged();
        return messageTransformationFailureReasonBuilder_;
      }

      @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.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface AzureEventHubsFailureReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. The namespace containing the event hub being ingested from.
     * </pre>
     *
     * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The namespace.
     */
    java.lang.String getNamespace();

    /**
     *
     *
     * <pre>
     * Optional. The namespace containing the event hub being ingested from.
     * </pre>
     *
     * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for namespace.
     */
    com.google.protobuf.ByteString getNamespaceBytes();

    /**
     *
     *
     * <pre>
     * Optional. The name of the event hub being ingested from.
     * </pre>
     *
     * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The eventHub.
     */
    java.lang.String getEventHub();

    /**
     *
     *
     * <pre>
     * Optional. The name of the event hub being ingested from.
     * </pre>
     *
     * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for eventHub.
     */
    com.google.protobuf.ByteString getEventHubBytes();

    /**
     *
     *
     * <pre>
     * Optional. The partition ID of the message that failed to be ingested.
     * </pre>
     *
     * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionId.
     */
    long getPartitionId();

    /**
     *
     *
     * <pre>
     * Optional. The offset within the partition of the message that failed to
     * be ingested.
     * </pre>
     *
     * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The offset.
     */
    long getOffset();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    boolean hasApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    boolean hasSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason getSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    boolean hasMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder();

    com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.ReasonCase
        getReasonCase();
  }

  /**
   *
   *
   * <pre>
   * Failure when ingesting from an Azure Event Hubs source.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason}
   */
  public static final class AzureEventHubsFailureReason
      extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)
      AzureEventHubsFailureReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use AzureEventHubsFailureReason.newBuilder() to construct.
    private AzureEventHubsFailureReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private AzureEventHubsFailureReason() {
      namespace_ = "";
      eventHub_ = "";
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AzureEventHubsFailureReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AzureEventHubsFailureReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder.class);
    }

    private int reasonCase_ = 0;

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

    public enum ReasonCase
        implements
            com.google.protobuf.Internal.EnumLite,
            com.google.protobuf.AbstractMessage.InternalOneOfEnum {
      API_VIOLATION_REASON(5),
      SCHEMA_VIOLATION_REASON(6),
      MESSAGE_TRANSFORMATION_FAILURE_REASON(7),
      REASON_NOT_SET(0);
      private final int value;

      private ReasonCase(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 ReasonCase valueOf(int value) {
        return forNumber(value);
      }

      public static ReasonCase forNumber(int value) {
        switch (value) {
          case 5:
            return API_VIOLATION_REASON;
          case 6:
            return SCHEMA_VIOLATION_REASON;
          case 7:
            return MESSAGE_TRANSFORMATION_FAILURE_REASON;
          case 0:
            return REASON_NOT_SET;
          default:
            return null;
        }
      }

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

    public ReasonCase getReasonCase() {
      return ReasonCase.forNumber(reasonCase_);
    }

    public static final int NAMESPACE_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private volatile java.lang.Object namespace_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The namespace containing the event hub being ingested from.
     * </pre>
     *
     * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The namespace.
     */
    @java.lang.Override
    public java.lang.String getNamespace() {
      java.lang.Object ref = namespace_;
      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();
        namespace_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The namespace containing the event hub being ingested from.
     * </pre>
     *
     * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for namespace.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getNamespaceBytes() {
      java.lang.Object ref = namespace_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        namespace_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int EVENT_HUB_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private volatile java.lang.Object eventHub_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The name of the event hub being ingested from.
     * </pre>
     *
     * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The eventHub.
     */
    @java.lang.Override
    public java.lang.String getEventHub() {
      java.lang.Object ref = eventHub_;
      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();
        eventHub_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The name of the event hub being ingested from.
     * </pre>
     *
     * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for eventHub.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getEventHubBytes() {
      java.lang.Object ref = eventHub_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        eventHub_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int PARTITION_ID_FIELD_NUMBER = 3;
    private long partitionId_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. The partition ID of the message that failed to be ingested.
     * </pre>
     *
     * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionId.
     */
    @java.lang.Override
    public long getPartitionId() {
      return partitionId_;
    }

    public static final int OFFSET_FIELD_NUMBER = 4;
    private long offset_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. The offset within the partition of the message that failed to
     * be ingested.
     * </pre>
     *
     * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The offset.
     */
    @java.lang.Override
    public long getOffset() {
      return offset_;
    }

    public static final int API_VIOLATION_REASON_FIELD_NUMBER = 5;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasApiViolationReason() {
      return reasonCase_ == 5;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    public static final int SCHEMA_VIOLATION_REASON_FIELD_NUMBER = 6;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasSchemaViolationReason() {
      return reasonCase_ == 6;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getSchemaViolationReason() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    public static final int MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER = 7;

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    @java.lang.Override
    public boolean hasMessageTransformationFailureReason() {
      return reasonCase_ == 7;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    private byte memoizedIsInitialized = -1;

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

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, namespace_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventHub_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, eventHub_);
      }
      if (partitionId_ != 0L) {
        output.writeInt64(3, partitionId_);
      }
      if (offset_ != 0L) {
        output.writeInt64(4, offset_);
      }
      if (reasonCase_ == 5) {
        output.writeMessage(
            5, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 6) {
        output.writeMessage(
            6, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        output.writeMessage(
            7,
            (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(namespace_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, namespace_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(eventHub_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, eventHub_);
      }
      if (partitionId_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, partitionId_);
      }
      if (offset_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, offset_);
      }
      if (reasonCase_ == 5) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                5, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 6) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                6, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                7,
                (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                    reason_);
      }
      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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) obj;

      if (!getNamespace().equals(other.getNamespace())) return false;
      if (!getEventHub().equals(other.getEventHub())) return false;
      if (getPartitionId() != other.getPartitionId()) return false;
      if (getOffset() != other.getOffset()) return false;
      if (!getReasonCase().equals(other.getReasonCase())) return false;
      switch (reasonCase_) {
        case 5:
          if (!getApiViolationReason().equals(other.getApiViolationReason())) return false;
          break;
        case 6:
          if (!getSchemaViolationReason().equals(other.getSchemaViolationReason())) return false;
          break;
        case 7:
          if (!getMessageTransformationFailureReason()
              .equals(other.getMessageTransformationFailureReason())) 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();
      hash = (37 * hash) + NAMESPACE_FIELD_NUMBER;
      hash = (53 * hash) + getNamespace().hashCode();
      hash = (37 * hash) + EVENT_HUB_FIELD_NUMBER;
      hash = (53 * hash) + getEventHub().hashCode();
      hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPartitionId());
      hash = (37 * hash) + OFFSET_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffset());
      switch (reasonCase_) {
        case 5:
          hash = (37 * hash) + API_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getApiViolationReason().hashCode();
          break;
        case 6:
          hash = (37 * hash) + SCHEMA_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getSchemaViolationReason().hashCode();
          break;
        case 7:
          hash = (37 * hash) + MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getMessageTransformationFailureReason().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason 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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason 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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason 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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason 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>
     * Failure when ingesting from an Azure Event Hubs source.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)
        com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AzureEventHubsFailureReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AzureEventHubsFailureReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder
                    .class);
      }

      // Construct using
      // com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        namespace_ = "";
        eventHub_ = "";
        partitionId_ = 0L;
        offset_ = 0L;
        if (apiViolationReasonBuilder_ != null) {
          apiViolationReasonBuilder_.clear();
        }
        if (schemaViolationReasonBuilder_ != null) {
          schemaViolationReasonBuilder_.clear();
        }
        if (messageTransformationFailureReasonBuilder_ != null) {
          messageTransformationFailureReasonBuilder_.clear();
        }
        reasonCase_ = 0;
        reason_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AzureEventHubsFailureReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        buildPartialOneofs(result);
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.namespace_ = namespace_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.eventHub_ = eventHub_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.partitionId_ = partitionId_;
        }
        if (((from_bitField0_ & 0x00000008) != 0)) {
          result.offset_ = offset_;
        }
      }

      private void buildPartialOneofs(
          com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason result) {
        result.reasonCase_ = reasonCase_;
        result.reason_ = this.reason_;
        if (reasonCase_ == 5 && apiViolationReasonBuilder_ != null) {
          result.reason_ = apiViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 6 && schemaViolationReasonBuilder_ != null) {
          result.reason_ = schemaViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 7 && messageTransformationFailureReasonBuilder_ != null) {
          result.reason_ = messageTransformationFailureReasonBuilder_.build();
        }
      }

      @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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) {
          return mergeFrom(
              (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
                .getDefaultInstance()) return this;
        if (!other.getNamespace().isEmpty()) {
          namespace_ = other.namespace_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (!other.getEventHub().isEmpty()) {
          eventHub_ = other.eventHub_;
          bitField0_ |= 0x00000002;
          onChanged();
        }
        if (other.getPartitionId() != 0L) {
          setPartitionId(other.getPartitionId());
        }
        if (other.getOffset() != 0L) {
          setOffset(other.getOffset());
        }
        switch (other.getReasonCase()) {
          case API_VIOLATION_REASON:
            {
              mergeApiViolationReason(other.getApiViolationReason());
              break;
            }
          case SCHEMA_VIOLATION_REASON:
            {
              mergeSchemaViolationReason(other.getSchemaViolationReason());
              break;
            }
          case MESSAGE_TRANSFORMATION_FAILURE_REASON:
            {
              mergeMessageTransformationFailureReason(
                  other.getMessageTransformationFailureReason());
              break;
            }
          case REASON_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:
                {
                  namespace_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  eventHub_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              case 24:
                {
                  partitionId_ = input.readInt64();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 24
              case 32:
                {
                  offset_ = input.readInt64();
                  bitField0_ |= 0x00000008;
                  break;
                } // case 32
              case 42:
                {
                  input.readMessage(
                      getApiViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 5;
                  break;
                } // case 42
              case 50:
                {
                  input.readMessage(
                      getSchemaViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 6;
                  break;
                } // case 50
              case 58:
                {
                  input.readMessage(
                      getMessageTransformationFailureReasonFieldBuilder().getBuilder(),
                      extensionRegistry);
                  reasonCase_ = 7;
                  break;
                } // case 58
              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 reasonCase_ = 0;
      private java.lang.Object reason_;

      public ReasonCase getReasonCase() {
        return ReasonCase.forNumber(reasonCase_);
      }

      public Builder clearReason() {
        reasonCase_ = 0;
        reason_ = null;
        onChanged();
        return this;
      }

      private int bitField0_;

      private java.lang.Object namespace_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The namespace containing the event hub being ingested from.
       * </pre>
       *
       * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The namespace.
       */
      public java.lang.String getNamespace() {
        java.lang.Object ref = namespace_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          namespace_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The namespace containing the event hub being ingested from.
       * </pre>
       *
       * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for namespace.
       */
      public com.google.protobuf.ByteString getNamespaceBytes() {
        java.lang.Object ref = namespace_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          namespace_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The namespace containing the event hub being ingested from.
       * </pre>
       *
       * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The namespace to set.
       * @return This builder for chaining.
       */
      public Builder setNamespace(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        namespace_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The namespace containing the event hub being ingested from.
       * </pre>
       *
       * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearNamespace() {
        namespace_ = getDefaultInstance().getNamespace();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The namespace containing the event hub being ingested from.
       * </pre>
       *
       * <code>string namespace = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for namespace to set.
       * @return This builder for chaining.
       */
      public Builder setNamespaceBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        namespace_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private java.lang.Object eventHub_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The name of the event hub being ingested from.
       * </pre>
       *
       * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The eventHub.
       */
      public java.lang.String getEventHub() {
        java.lang.Object ref = eventHub_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          eventHub_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the event hub being ingested from.
       * </pre>
       *
       * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for eventHub.
       */
      public com.google.protobuf.ByteString getEventHubBytes() {
        java.lang.Object ref = eventHub_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          eventHub_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the event hub being ingested from.
       * </pre>
       *
       * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The eventHub to set.
       * @return This builder for chaining.
       */
      public Builder setEventHub(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        eventHub_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the event hub being ingested from.
       * </pre>
       *
       * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearEventHub() {
        eventHub_ = getDefaultInstance().getEventHub();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the event hub being ingested from.
       * </pre>
       *
       * <code>string event_hub = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for eventHub to set.
       * @return This builder for chaining.
       */
      public Builder setEventHubBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        eventHub_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      private long partitionId_;

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The partitionId.
       */
      @java.lang.Override
      public long getPartitionId() {
        return partitionId_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The partitionId to set.
       * @return This builder for chaining.
       */
      public Builder setPartitionId(long value) {

        partitionId_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPartitionId() {
        bitField0_ = (bitField0_ & ~0x00000004);
        partitionId_ = 0L;
        onChanged();
        return this;
      }

      private long offset_;

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The offset.
       */
      @java.lang.Override
      public long getOffset() {
        return offset_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The offset to set.
       * @return This builder for chaining.
       */
      public Builder setOffset(long value) {

        offset_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearOffset() {
        bitField0_ = (bitField0_ & ~0x00000008);
        offset_ = 0L;
        onChanged();
        return this;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          apiViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the apiViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasApiViolationReason() {
        return reasonCase_ == 5;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The apiViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        } else {
          if (reasonCase_ == 5) {
            return apiViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder builderForValue) {
        if (apiViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 5) {
            apiViolationReasonBuilder_.mergeFrom(value);
          } else {
            apiViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
          }
          apiViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder
          getApiViolationReasonBuilder() {
        return getApiViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
          getApiViolationReasonOrBuilder() {
        if ((reasonCase_ == 5) && (apiViolationReasonBuilder_ != null)) {
          return apiViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          getApiViolationReasonFieldBuilder() {
        if (apiViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 5)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
          }
          apiViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 5;
        onChanged();
        return apiViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          schemaViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the schemaViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasSchemaViolationReason() {
        return reasonCase_ == 6;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The schemaViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
          getSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 6) {
            return schemaViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
              builderForValue) {
        if (schemaViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 6) {
            schemaViolationReasonBuilder_.mergeFrom(value);
          } else {
            schemaViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
          }
          schemaViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
          getSchemaViolationReasonBuilder() {
        return getSchemaViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
          getSchemaViolationReasonOrBuilder() {
        if ((reasonCase_ == 6) && (schemaViolationReasonBuilder_ != null)) {
          return schemaViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          getSchemaViolationReasonFieldBuilder() {
        if (schemaViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 6)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                    .getDefaultInstance();
          }
          schemaViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 6;
        onChanged();
        return schemaViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          messageTransformationFailureReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the messageTransformationFailureReason field is set.
       */
      @java.lang.Override
      public boolean hasMessageTransformationFailureReason() {
        return reasonCase_ == 7;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The messageTransformationFailureReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          getMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 7) {
            return messageTransformationFailureReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
              builderForValue) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent
                                .MessageTransformationFailureReason)
                            reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 7) {
            messageTransformationFailureReasonBuilder_.mergeFrom(value);
          } else {
            messageTransformationFailureReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
          }
          messageTransformationFailureReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
          getMessageTransformationFailureReasonBuilder() {
        return getMessageTransformationFailureReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
          getMessageTransformationFailureReasonOrBuilder() {
        if ((reasonCase_ == 7) && (messageTransformationFailureReasonBuilder_ != null)) {
          return messageTransformationFailureReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          getMessageTransformationFailureReasonFieldBuilder() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (!(reasonCase_ == 7)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .getDefaultInstance();
          }
          messageTransformationFailureReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .Builder,
                  com.google.pubsub.v1.IngestionFailureEvent
                      .MessageTransformationFailureReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                      reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 7;
        onChanged();
        return messageTransformationFailureReasonBuilder_;
      }

      @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.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface ConfluentCloudFailureReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. The cluster ID containing the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The clusterId.
     */
    java.lang.String getClusterId();

    /**
     *
     *
     * <pre>
     * Optional. The cluster ID containing the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for clusterId.
     */
    com.google.protobuf.ByteString getClusterIdBytes();

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The kafkaTopic.
     */
    java.lang.String getKafkaTopic();

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for kafkaTopic.
     */
    com.google.protobuf.ByteString getKafkaTopicBytes();

    /**
     *
     *
     * <pre>
     * Optional. The partition ID of the message that failed to be ingested.
     * </pre>
     *
     * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionId.
     */
    long getPartitionId();

    /**
     *
     *
     * <pre>
     * Optional. The offset within the partition of the message that failed to
     * be ingested.
     * </pre>
     *
     * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The offset.
     */
    long getOffset();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    boolean hasApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    boolean hasSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason getSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    boolean hasMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder();

    com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.ReasonCase
        getReasonCase();
  }

  /**
   *
   *
   * <pre>
   * Failure when ingesting from a Confluent Cloud source.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason}
   */
  public static final class ConfluentCloudFailureReason
      extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)
      ConfluentCloudFailureReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use ConfluentCloudFailureReason.newBuilder() to construct.
    private ConfluentCloudFailureReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private ConfluentCloudFailureReason() {
      clusterId_ = "";
      kafkaTopic_ = "";
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_ConfluentCloudFailureReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_ConfluentCloudFailureReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder.class);
    }

    private int reasonCase_ = 0;

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

    public enum ReasonCase
        implements
            com.google.protobuf.Internal.EnumLite,
            com.google.protobuf.AbstractMessage.InternalOneOfEnum {
      API_VIOLATION_REASON(5),
      SCHEMA_VIOLATION_REASON(6),
      MESSAGE_TRANSFORMATION_FAILURE_REASON(7),
      REASON_NOT_SET(0);
      private final int value;

      private ReasonCase(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 ReasonCase valueOf(int value) {
        return forNumber(value);
      }

      public static ReasonCase forNumber(int value) {
        switch (value) {
          case 5:
            return API_VIOLATION_REASON;
          case 6:
            return SCHEMA_VIOLATION_REASON;
          case 7:
            return MESSAGE_TRANSFORMATION_FAILURE_REASON;
          case 0:
            return REASON_NOT_SET;
          default:
            return null;
        }
      }

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

    public ReasonCase getReasonCase() {
      return ReasonCase.forNumber(reasonCase_);
    }

    public static final int CLUSTER_ID_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private volatile java.lang.Object clusterId_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The cluster ID containing the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The clusterId.
     */
    @java.lang.Override
    public java.lang.String getClusterId() {
      java.lang.Object ref = clusterId_;
      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();
        clusterId_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The cluster ID containing the topic being ingested from.
     * </pre>
     *
     * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for clusterId.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getClusterIdBytes() {
      java.lang.Object ref = clusterId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        clusterId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int KAFKA_TOPIC_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private volatile java.lang.Object kafkaTopic_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The kafkaTopic.
     */
    @java.lang.Override
    public java.lang.String getKafkaTopic() {
      java.lang.Object ref = kafkaTopic_;
      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();
        kafkaTopic_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The name of the Kafka topic being ingested from.
     * </pre>
     *
     * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for kafkaTopic.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getKafkaTopicBytes() {
      java.lang.Object ref = kafkaTopic_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        kafkaTopic_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int PARTITION_ID_FIELD_NUMBER = 3;
    private long partitionId_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. The partition ID of the message that failed to be ingested.
     * </pre>
     *
     * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionId.
     */
    @java.lang.Override
    public long getPartitionId() {
      return partitionId_;
    }

    public static final int OFFSET_FIELD_NUMBER = 4;
    private long offset_ = 0L;

    /**
     *
     *
     * <pre>
     * Optional. The offset within the partition of the message that failed to
     * be ingested.
     * </pre>
     *
     * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The offset.
     */
    @java.lang.Override
    public long getOffset() {
      return offset_;
    }

    public static final int API_VIOLATION_REASON_FIELD_NUMBER = 5;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasApiViolationReason() {
      return reasonCase_ == 5;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub API limits prevented the desired message from
     * being published.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    public static final int SCHEMA_VIOLATION_REASON_FIELD_NUMBER = 6;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasSchemaViolationReason() {
      return reasonCase_ == 6;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getSchemaViolationReason() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    public static final int MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER = 7;

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    @java.lang.Override
    public boolean hasMessageTransformationFailureReason() {
      return reasonCase_ == 7;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder() {
      if (reasonCase_ == 7) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    private byte memoizedIsInitialized = -1;

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

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, clusterId_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kafkaTopic_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kafkaTopic_);
      }
      if (partitionId_ != 0L) {
        output.writeInt64(3, partitionId_);
      }
      if (offset_ != 0L) {
        output.writeInt64(4, offset_);
      }
      if (reasonCase_ == 5) {
        output.writeMessage(
            5, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 6) {
        output.writeMessage(
            6, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        output.writeMessage(
            7,
            (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(clusterId_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, clusterId_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(kafkaTopic_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kafkaTopic_);
      }
      if (partitionId_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, partitionId_);
      }
      if (offset_ != 0L) {
        size += com.google.protobuf.CodedOutputStream.computeInt64Size(4, offset_);
      }
      if (reasonCase_ == 5) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                5, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      if (reasonCase_ == 6) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                6, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 7) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                7,
                (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                    reason_);
      }
      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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) obj;

      if (!getClusterId().equals(other.getClusterId())) return false;
      if (!getKafkaTopic().equals(other.getKafkaTopic())) return false;
      if (getPartitionId() != other.getPartitionId()) return false;
      if (getOffset() != other.getOffset()) return false;
      if (!getReasonCase().equals(other.getReasonCase())) return false;
      switch (reasonCase_) {
        case 5:
          if (!getApiViolationReason().equals(other.getApiViolationReason())) return false;
          break;
        case 6:
          if (!getSchemaViolationReason().equals(other.getSchemaViolationReason())) return false;
          break;
        case 7:
          if (!getMessageTransformationFailureReason()
              .equals(other.getMessageTransformationFailureReason())) 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();
      hash = (37 * hash) + CLUSTER_ID_FIELD_NUMBER;
      hash = (53 * hash) + getClusterId().hashCode();
      hash = (37 * hash) + KAFKA_TOPIC_FIELD_NUMBER;
      hash = (53 * hash) + getKafkaTopic().hashCode();
      hash = (37 * hash) + PARTITION_ID_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPartitionId());
      hash = (37 * hash) + OFFSET_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getOffset());
      switch (reasonCase_) {
        case 5:
          hash = (37 * hash) + API_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getApiViolationReason().hashCode();
          break;
        case 6:
          hash = (37 * hash) + SCHEMA_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getSchemaViolationReason().hashCode();
          break;
        case 7:
          hash = (37 * hash) + MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getMessageTransformationFailureReason().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason 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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason 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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason 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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason 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>
     * Failure when ingesting from a Confluent Cloud source.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)
        com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_ConfluentCloudFailureReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_ConfluentCloudFailureReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder
                    .class);
      }

      // Construct using
      // com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        clusterId_ = "";
        kafkaTopic_ = "";
        partitionId_ = 0L;
        offset_ = 0L;
        if (apiViolationReasonBuilder_ != null) {
          apiViolationReasonBuilder_.clear();
        }
        if (schemaViolationReasonBuilder_ != null) {
          schemaViolationReasonBuilder_.clear();
        }
        if (messageTransformationFailureReasonBuilder_ != null) {
          messageTransformationFailureReasonBuilder_.clear();
        }
        reasonCase_ = 0;
        reason_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_ConfluentCloudFailureReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason result =
            buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        buildPartialOneofs(result);
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.clusterId_ = clusterId_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.kafkaTopic_ = kafkaTopic_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.partitionId_ = partitionId_;
        }
        if (((from_bitField0_ & 0x00000008) != 0)) {
          result.offset_ = offset_;
        }
      }

      private void buildPartialOneofs(
          com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason result) {
        result.reasonCase_ = reasonCase_;
        result.reason_ = this.reason_;
        if (reasonCase_ == 5 && apiViolationReasonBuilder_ != null) {
          result.reason_ = apiViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 6 && schemaViolationReasonBuilder_ != null) {
          result.reason_ = schemaViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 7 && messageTransformationFailureReasonBuilder_ != null) {
          result.reason_ = messageTransformationFailureReasonBuilder_.build();
        }
      }

      @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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) {
          return mergeFrom(
              (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
                .getDefaultInstance()) return this;
        if (!other.getClusterId().isEmpty()) {
          clusterId_ = other.clusterId_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (!other.getKafkaTopic().isEmpty()) {
          kafkaTopic_ = other.kafkaTopic_;
          bitField0_ |= 0x00000002;
          onChanged();
        }
        if (other.getPartitionId() != 0L) {
          setPartitionId(other.getPartitionId());
        }
        if (other.getOffset() != 0L) {
          setOffset(other.getOffset());
        }
        switch (other.getReasonCase()) {
          case API_VIOLATION_REASON:
            {
              mergeApiViolationReason(other.getApiViolationReason());
              break;
            }
          case SCHEMA_VIOLATION_REASON:
            {
              mergeSchemaViolationReason(other.getSchemaViolationReason());
              break;
            }
          case MESSAGE_TRANSFORMATION_FAILURE_REASON:
            {
              mergeMessageTransformationFailureReason(
                  other.getMessageTransformationFailureReason());
              break;
            }
          case REASON_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:
                {
                  clusterId_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  kafkaTopic_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              case 24:
                {
                  partitionId_ = input.readInt64();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 24
              case 32:
                {
                  offset_ = input.readInt64();
                  bitField0_ |= 0x00000008;
                  break;
                } // case 32
              case 42:
                {
                  input.readMessage(
                      getApiViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 5;
                  break;
                } // case 42
              case 50:
                {
                  input.readMessage(
                      getSchemaViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 6;
                  break;
                } // case 50
              case 58:
                {
                  input.readMessage(
                      getMessageTransformationFailureReasonFieldBuilder().getBuilder(),
                      extensionRegistry);
                  reasonCase_ = 7;
                  break;
                } // case 58
              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 reasonCase_ = 0;
      private java.lang.Object reason_;

      public ReasonCase getReasonCase() {
        return ReasonCase.forNumber(reasonCase_);
      }

      public Builder clearReason() {
        reasonCase_ = 0;
        reason_ = null;
        onChanged();
        return this;
      }

      private int bitField0_;

      private java.lang.Object clusterId_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The cluster ID containing the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The clusterId.
       */
      public java.lang.String getClusterId() {
        java.lang.Object ref = clusterId_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          clusterId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The cluster ID containing the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for clusterId.
       */
      public com.google.protobuf.ByteString getClusterIdBytes() {
        java.lang.Object ref = clusterId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          clusterId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The cluster ID containing the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The clusterId to set.
       * @return This builder for chaining.
       */
      public Builder setClusterId(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        clusterId_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The cluster ID containing the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearClusterId() {
        clusterId_ = getDefaultInstance().getClusterId();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The cluster ID containing the topic being ingested from.
       * </pre>
       *
       * <code>string cluster_id = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for clusterId to set.
       * @return This builder for chaining.
       */
      public Builder setClusterIdBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        clusterId_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private java.lang.Object kafkaTopic_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The kafkaTopic.
       */
      public java.lang.String getKafkaTopic() {
        java.lang.Object ref = kafkaTopic_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          kafkaTopic_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for kafkaTopic.
       */
      public com.google.protobuf.ByteString getKafkaTopicBytes() {
        java.lang.Object ref = kafkaTopic_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          kafkaTopic_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The kafkaTopic to set.
       * @return This builder for chaining.
       */
      public Builder setKafkaTopic(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        kafkaTopic_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearKafkaTopic() {
        kafkaTopic_ = getDefaultInstance().getKafkaTopic();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The name of the Kafka topic being ingested from.
       * </pre>
       *
       * <code>string kafka_topic = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for kafkaTopic to set.
       * @return This builder for chaining.
       */
      public Builder setKafkaTopicBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        kafkaTopic_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      private long partitionId_;

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The partitionId.
       */
      @java.lang.Override
      public long getPartitionId() {
        return partitionId_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The partitionId to set.
       * @return This builder for chaining.
       */
      public Builder setPartitionId(long value) {

        partitionId_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition ID of the message that failed to be ingested.
       * </pre>
       *
       * <code>int64 partition_id = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPartitionId() {
        bitField0_ = (bitField0_ & ~0x00000004);
        partitionId_ = 0L;
        onChanged();
        return this;
      }

      private long offset_;

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The offset.
       */
      @java.lang.Override
      public long getOffset() {
        return offset_;
      }

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The offset to set.
       * @return This builder for chaining.
       */
      public Builder setOffset(long value) {

        offset_ = value;
        bitField0_ |= 0x00000008;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The offset within the partition of the message that failed to
       * be ingested.
       * </pre>
       *
       * <code>int64 offset = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearOffset() {
        bitField0_ = (bitField0_ & ~0x00000008);
        offset_ = 0L;
        onChanged();
        return this;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          apiViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the apiViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasApiViolationReason() {
        return reasonCase_ == 5;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The apiViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        } else {
          if (reasonCase_ == 5) {
            return apiViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder builderForValue) {
        if (apiViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 5) {
            apiViolationReasonBuilder_.mergeFrom(value);
          } else {
            apiViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
          }
          apiViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder
          getApiViolationReasonBuilder() {
        return getApiViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
          getApiViolationReasonOrBuilder() {
        if ((reasonCase_ == 5) && (apiViolationReasonBuilder_ != null)) {
          return apiViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub API limits prevented the desired message from
       * being published.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          getApiViolationReasonFieldBuilder() {
        if (apiViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 5)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
          }
          apiViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 5;
        onChanged();
        return apiViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          schemaViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the schemaViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasSchemaViolationReason() {
        return reasonCase_ == 6;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The schemaViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
          getSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 6) {
            return schemaViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
              builderForValue) {
        if (schemaViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 6) {
            schemaViolationReasonBuilder_.mergeFrom(value);
          } else {
            schemaViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
          }
          schemaViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
          getSchemaViolationReasonBuilder() {
        return getSchemaViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
          getSchemaViolationReasonOrBuilder() {
        if ((reasonCase_ == 6) && (schemaViolationReasonBuilder_ != null)) {
          return schemaViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          getSchemaViolationReasonFieldBuilder() {
        if (schemaViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 6)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                    .getDefaultInstance();
          }
          schemaViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 6;
        onChanged();
        return schemaViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          messageTransformationFailureReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the messageTransformationFailureReason field is set.
       */
      @java.lang.Override
      public boolean hasMessageTransformationFailureReason() {
        return reasonCase_ == 7;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The messageTransformationFailureReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          getMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 7) {
            return messageTransformationFailureReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
              builderForValue) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent
                                .MessageTransformationFailureReason)
                            reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 7) {
            messageTransformationFailureReasonBuilder_.mergeFrom(value);
          } else {
            messageTransformationFailureReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 7;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 7) {
            reasonCase_ = 0;
            reason_ = null;
          }
          messageTransformationFailureReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
          getMessageTransformationFailureReasonBuilder() {
        return getMessageTransformationFailureReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
          getMessageTransformationFailureReasonOrBuilder() {
        if ((reasonCase_ == 7) && (messageTransformationFailureReasonBuilder_ != null)) {
          return messageTransformationFailureReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 7) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 7 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          getMessageTransformationFailureReasonFieldBuilder() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (!(reasonCase_ == 7)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .getDefaultInstance();
          }
          messageTransformationFailureReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .Builder,
                  com.google.pubsub.v1.IngestionFailureEvent
                      .MessageTransformationFailureReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                      reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 7;
        onChanged();
        return messageTransformationFailureReasonBuilder_;
      }

      @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.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE =
          new com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  public interface AwsKinesisFailureReasonOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. The stream ARN of the Kinesis stream being ingested from.
     * </pre>
     *
     * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The streamArn.
     */
    java.lang.String getStreamArn();

    /**
     *
     *
     * <pre>
     * Optional. The stream ARN of the Kinesis stream being ingested from.
     * </pre>
     *
     * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for streamArn.
     */
    com.google.protobuf.ByteString getStreamArnBytes();

    /**
     *
     *
     * <pre>
     * Optional. The partition key of the message that failed to be ingested.
     * </pre>
     *
     * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionKey.
     */
    java.lang.String getPartitionKey();

    /**
     *
     *
     * <pre>
     * Optional. The partition key of the message that failed to be ingested.
     * </pre>
     *
     * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for partitionKey.
     */
    com.google.protobuf.ByteString getPartitionKeyBytes();

    /**
     *
     *
     * <pre>
     * Optional. The sequence number of the message that failed to be ingested.
     * </pre>
     *
     * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The sequenceNumber.
     */
    java.lang.String getSequenceNumber();

    /**
     *
     *
     * <pre>
     * Optional. The sequence number of the message that failed to be ingested.
     * </pre>
     *
     * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for sequenceNumber.
     */
    com.google.protobuf.ByteString getSequenceNumberBytes();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    boolean hasSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason getSchemaViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    boolean hasMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason();

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder();

    /**
     *
     *
     * <pre>
     * Optional. The message failed to be published due to an API violation.
     * This is only set when the size of the data field of the Kinesis record
     * is zero.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    boolean hasApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The message failed to be published due to an API violation.
     * This is only set when the size of the data field of the Kinesis record
     * is zero.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason();

    /**
     *
     *
     * <pre>
     * Optional. The message failed to be published due to an API violation.
     * This is only set when the size of the data field of the Kinesis record
     * is zero.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder();

    com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.ReasonCase getReasonCase();
  }

  /**
   *
   *
   * <pre>
   * Failure when ingesting from an AWS Kinesis source.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason}
   */
  public static final class AwsKinesisFailureReason extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason)
      AwsKinesisFailureReasonOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use AwsKinesisFailureReason.newBuilder() to construct.
    private AwsKinesisFailureReason(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }

    private AwsKinesisFailureReason() {
      streamArn_ = "";
      partitionKey_ = "";
      sequenceNumber_ = "";
    }

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

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsKinesisFailureReason_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsKinesisFailureReason_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.class,
              com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder.class);
    }

    private int reasonCase_ = 0;

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

    public enum ReasonCase
        implements
            com.google.protobuf.Internal.EnumLite,
            com.google.protobuf.AbstractMessage.InternalOneOfEnum {
      SCHEMA_VIOLATION_REASON(4),
      MESSAGE_TRANSFORMATION_FAILURE_REASON(5),
      API_VIOLATION_REASON(6),
      REASON_NOT_SET(0);
      private final int value;

      private ReasonCase(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 ReasonCase valueOf(int value) {
        return forNumber(value);
      }

      public static ReasonCase forNumber(int value) {
        switch (value) {
          case 4:
            return SCHEMA_VIOLATION_REASON;
          case 5:
            return MESSAGE_TRANSFORMATION_FAILURE_REASON;
          case 6:
            return API_VIOLATION_REASON;
          case 0:
            return REASON_NOT_SET;
          default:
            return null;
        }
      }

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

    public ReasonCase getReasonCase() {
      return ReasonCase.forNumber(reasonCase_);
    }

    public static final int STREAM_ARN_FIELD_NUMBER = 1;

    @SuppressWarnings("serial")
    private volatile java.lang.Object streamArn_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The stream ARN of the Kinesis stream being ingested from.
     * </pre>
     *
     * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The streamArn.
     */
    @java.lang.Override
    public java.lang.String getStreamArn() {
      java.lang.Object ref = streamArn_;
      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();
        streamArn_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The stream ARN of the Kinesis stream being ingested from.
     * </pre>
     *
     * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for streamArn.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getStreamArnBytes() {
      java.lang.Object ref = streamArn_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        streamArn_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int PARTITION_KEY_FIELD_NUMBER = 2;

    @SuppressWarnings("serial")
    private volatile java.lang.Object partitionKey_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The partition key of the message that failed to be ingested.
     * </pre>
     *
     * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The partitionKey.
     */
    @java.lang.Override
    public java.lang.String getPartitionKey() {
      java.lang.Object ref = partitionKey_;
      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();
        partitionKey_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The partition key of the message that failed to be ingested.
     * </pre>
     *
     * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for partitionKey.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getPartitionKeyBytes() {
      java.lang.Object ref = partitionKey_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        partitionKey_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SEQUENCE_NUMBER_FIELD_NUMBER = 3;

    @SuppressWarnings("serial")
    private volatile java.lang.Object sequenceNumber_ = "";

    /**
     *
     *
     * <pre>
     * Optional. The sequence number of the message that failed to be ingested.
     * </pre>
     *
     * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The sequenceNumber.
     */
    @java.lang.Override
    public java.lang.String getSequenceNumber() {
      java.lang.Object ref = sequenceNumber_;
      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();
        sequenceNumber_ = s;
        return s;
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. The sequence number of the message that failed to be ingested.
     * </pre>
     *
     * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The bytes for sequenceNumber.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString getSequenceNumberBytes() {
      java.lang.Object ref = sequenceNumber_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        sequenceNumber_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SCHEMA_VIOLATION_REASON_FIELD_NUMBER = 4;

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the schemaViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasSchemaViolationReason() {
      return reasonCase_ == 4;
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The schemaViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
        getSchemaViolationReason() {
      if (reasonCase_ == 4) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The Pub/Sub message failed schema validation.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
        getSchemaViolationReasonOrBuilder() {
      if (reasonCase_ == 4) {
        return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.getDefaultInstance();
    }

    public static final int MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER = 5;

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the messageTransformationFailureReason field is set.
     */
    @java.lang.Override
    public boolean hasMessageTransformationFailureReason() {
      return reasonCase_ == 5;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The messageTransformationFailureReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
        getMessageTransformationFailureReason() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure encountered when applying a message transformation to
     * the Pub/Sub message.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
        getMessageTransformationFailureReasonOrBuilder() {
      if (reasonCase_ == 5) {
        return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
            reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          .getDefaultInstance();
    }

    public static final int API_VIOLATION_REASON_FIELD_NUMBER = 6;

    /**
     *
     *
     * <pre>
     * Optional. The message failed to be published due to an API violation.
     * This is only set when the size of the data field of the Kinesis record
     * is zero.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the apiViolationReason field is set.
     */
    @java.lang.Override
    public boolean hasApiViolationReason() {
      return reasonCase_ == 6;
    }

    /**
     *
     *
     * <pre>
     * Optional. The message failed to be published due to an API violation.
     * This is only set when the size of the data field of the Kinesis record
     * is zero.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The apiViolationReason.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    /**
     *
     *
     * <pre>
     * Optional. The message failed to be published due to an API violation.
     * This is only set when the size of the data field of the Kinesis record
     * is zero.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
        getApiViolationReasonOrBuilder() {
      if (reasonCase_ == 6) {
        return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
      }
      return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
    }

    private byte memoizedIsInitialized = -1;

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

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(streamArn_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, streamArn_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partitionKey_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, partitionKey_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sequenceNumber_)) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sequenceNumber_);
      }
      if (reasonCase_ == 4) {
        output.writeMessage(
            4, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 5) {
        output.writeMessage(
            5,
            (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_);
      }
      if (reasonCase_ == 6) {
        output.writeMessage(
            6, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(streamArn_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, streamArn_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(partitionKey_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, partitionKey_);
      }
      if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sequenceNumber_)) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sequenceNumber_);
      }
      if (reasonCase_ == 4) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                4, (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_);
      }
      if (reasonCase_ == 5) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                5,
                (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                    reason_);
      }
      if (reasonCase_ == 6) {
        size +=
            com.google.protobuf.CodedOutputStream.computeMessageSize(
                6, (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_);
      }
      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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason other =
          (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) obj;

      if (!getStreamArn().equals(other.getStreamArn())) return false;
      if (!getPartitionKey().equals(other.getPartitionKey())) return false;
      if (!getSequenceNumber().equals(other.getSequenceNumber())) return false;
      if (!getReasonCase().equals(other.getReasonCase())) return false;
      switch (reasonCase_) {
        case 4:
          if (!getSchemaViolationReason().equals(other.getSchemaViolationReason())) return false;
          break;
        case 5:
          if (!getMessageTransformationFailureReason()
              .equals(other.getMessageTransformationFailureReason())) return false;
          break;
        case 6:
          if (!getApiViolationReason().equals(other.getApiViolationReason())) 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();
      hash = (37 * hash) + STREAM_ARN_FIELD_NUMBER;
      hash = (53 * hash) + getStreamArn().hashCode();
      hash = (37 * hash) + PARTITION_KEY_FIELD_NUMBER;
      hash = (53 * hash) + getPartitionKey().hashCode();
      hash = (37 * hash) + SEQUENCE_NUMBER_FIELD_NUMBER;
      hash = (53 * hash) + getSequenceNumber().hashCode();
      switch (reasonCase_) {
        case 4:
          hash = (37 * hash) + SCHEMA_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getSchemaViolationReason().hashCode();
          break;
        case 5:
          hash = (37 * hash) + MESSAGE_TRANSFORMATION_FAILURE_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getMessageTransformationFailureReason().hashCode();
          break;
        case 6:
          hash = (37 * hash) + API_VIOLATION_REASON_FIELD_NUMBER;
          hash = (53 * hash) + getApiViolationReason().hashCode();
          break;
        case 0:
        default:
      }
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
        parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
        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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason parseFrom(
        com.google.protobuf.CodedInputStream input) throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason 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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason 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>
     * Failure when ingesting from an AWS Kinesis source.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason)
        com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReasonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsKinesisFailureReason_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsKinesisFailureReason_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.class,
                com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder.class);
      }

      // Construct using
      // com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.newBuilder()
      private Builder() {}

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

      @java.lang.Override
      public Builder clear() {
        super.clear();
        bitField0_ = 0;
        streamArn_ = "";
        partitionKey_ = "";
        sequenceNumber_ = "";
        if (schemaViolationReasonBuilder_ != null) {
          schemaViolationReasonBuilder_.clear();
        }
        if (messageTransformationFailureReasonBuilder_ != null) {
          messageTransformationFailureReasonBuilder_.clear();
        }
        if (apiViolationReasonBuilder_ != null) {
          apiViolationReasonBuilder_.clear();
        }
        reasonCase_ = 0;
        reason_ = null;
        return this;
      }

      @java.lang.Override
      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_IngestionFailureEvent_AwsKinesisFailureReason_descriptor;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
          getDefaultInstanceForType() {
        return com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
            .getDefaultInstance();
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason build() {
        com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason buildPartial() {
        com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason result =
            new com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason(this);
        if (bitField0_ != 0) {
          buildPartial0(result);
        }
        buildPartialOneofs(result);
        onBuilt();
        return result;
      }

      private void buildPartial0(
          com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason result) {
        int from_bitField0_ = bitField0_;
        if (((from_bitField0_ & 0x00000001) != 0)) {
          result.streamArn_ = streamArn_;
        }
        if (((from_bitField0_ & 0x00000002) != 0)) {
          result.partitionKey_ = partitionKey_;
        }
        if (((from_bitField0_ & 0x00000004) != 0)) {
          result.sequenceNumber_ = sequenceNumber_;
        }
      }

      private void buildPartialOneofs(
          com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason result) {
        result.reasonCase_ = reasonCase_;
        result.reason_ = this.reason_;
        if (reasonCase_ == 4 && schemaViolationReasonBuilder_ != null) {
          result.reason_ = schemaViolationReasonBuilder_.build();
        }
        if (reasonCase_ == 5 && messageTransformationFailureReasonBuilder_ != null) {
          result.reason_ = messageTransformationFailureReasonBuilder_.build();
        }
        if (reasonCase_ == 6 && apiViolationReasonBuilder_ != null) {
          result.reason_ = apiViolationReasonBuilder_.build();
        }
      }

      @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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) {
          return mergeFrom(
              (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(
          com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason other) {
        if (other
            == com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
                .getDefaultInstance()) return this;
        if (!other.getStreamArn().isEmpty()) {
          streamArn_ = other.streamArn_;
          bitField0_ |= 0x00000001;
          onChanged();
        }
        if (!other.getPartitionKey().isEmpty()) {
          partitionKey_ = other.partitionKey_;
          bitField0_ |= 0x00000002;
          onChanged();
        }
        if (!other.getSequenceNumber().isEmpty()) {
          sequenceNumber_ = other.sequenceNumber_;
          bitField0_ |= 0x00000004;
          onChanged();
        }
        switch (other.getReasonCase()) {
          case SCHEMA_VIOLATION_REASON:
            {
              mergeSchemaViolationReason(other.getSchemaViolationReason());
              break;
            }
          case MESSAGE_TRANSFORMATION_FAILURE_REASON:
            {
              mergeMessageTransformationFailureReason(
                  other.getMessageTransformationFailureReason());
              break;
            }
          case API_VIOLATION_REASON:
            {
              mergeApiViolationReason(other.getApiViolationReason());
              break;
            }
          case REASON_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:
                {
                  streamArn_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000001;
                  break;
                } // case 10
              case 18:
                {
                  partitionKey_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000002;
                  break;
                } // case 18
              case 26:
                {
                  sequenceNumber_ = input.readStringRequireUtf8();
                  bitField0_ |= 0x00000004;
                  break;
                } // case 26
              case 34:
                {
                  input.readMessage(
                      getSchemaViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 4;
                  break;
                } // case 34
              case 42:
                {
                  input.readMessage(
                      getMessageTransformationFailureReasonFieldBuilder().getBuilder(),
                      extensionRegistry);
                  reasonCase_ = 5;
                  break;
                } // case 42
              case 50:
                {
                  input.readMessage(
                      getApiViolationReasonFieldBuilder().getBuilder(), extensionRegistry);
                  reasonCase_ = 6;
                  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 reasonCase_ = 0;
      private java.lang.Object reason_;

      public ReasonCase getReasonCase() {
        return ReasonCase.forNumber(reasonCase_);
      }

      public Builder clearReason() {
        reasonCase_ = 0;
        reason_ = null;
        onChanged();
        return this;
      }

      private int bitField0_;

      private java.lang.Object streamArn_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The stream ARN of the Kinesis stream being ingested from.
       * </pre>
       *
       * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The streamArn.
       */
      public java.lang.String getStreamArn() {
        java.lang.Object ref = streamArn_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          streamArn_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The stream ARN of the Kinesis stream being ingested from.
       * </pre>
       *
       * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for streamArn.
       */
      public com.google.protobuf.ByteString getStreamArnBytes() {
        java.lang.Object ref = streamArn_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          streamArn_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The stream ARN of the Kinesis stream being ingested from.
       * </pre>
       *
       * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The streamArn to set.
       * @return This builder for chaining.
       */
      public Builder setStreamArn(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        streamArn_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The stream ARN of the Kinesis stream being ingested from.
       * </pre>
       *
       * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearStreamArn() {
        streamArn_ = getDefaultInstance().getStreamArn();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The stream ARN of the Kinesis stream being ingested from.
       * </pre>
       *
       * <code>string stream_arn = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for streamArn to set.
       * @return This builder for chaining.
       */
      public Builder setStreamArnBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        streamArn_ = value;
        bitField0_ |= 0x00000001;
        onChanged();
        return this;
      }

      private java.lang.Object partitionKey_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The partition key of the message that failed to be ingested.
       * </pre>
       *
       * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The partitionKey.
       */
      public java.lang.String getPartitionKey() {
        java.lang.Object ref = partitionKey_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          partitionKey_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition key of the message that failed to be ingested.
       * </pre>
       *
       * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for partitionKey.
       */
      public com.google.protobuf.ByteString getPartitionKeyBytes() {
        java.lang.Object ref = partitionKey_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          partitionKey_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition key of the message that failed to be ingested.
       * </pre>
       *
       * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The partitionKey to set.
       * @return This builder for chaining.
       */
      public Builder setPartitionKey(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        partitionKey_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition key of the message that failed to be ingested.
       * </pre>
       *
       * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearPartitionKey() {
        partitionKey_ = getDefaultInstance().getPartitionKey();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The partition key of the message that failed to be ingested.
       * </pre>
       *
       * <code>string partition_key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for partitionKey to set.
       * @return This builder for chaining.
       */
      public Builder setPartitionKeyBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        partitionKey_ = value;
        bitField0_ |= 0x00000002;
        onChanged();
        return this;
      }

      private java.lang.Object sequenceNumber_ = "";

      /**
       *
       *
       * <pre>
       * Optional. The sequence number of the message that failed to be ingested.
       * </pre>
       *
       * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The sequenceNumber.
       */
      public java.lang.String getSequenceNumber() {
        java.lang.Object ref = sequenceNumber_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          sequenceNumber_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The sequence number of the message that failed to be ingested.
       * </pre>
       *
       * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return The bytes for sequenceNumber.
       */
      public com.google.protobuf.ByteString getSequenceNumberBytes() {
        java.lang.Object ref = sequenceNumber_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b =
              com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
          sequenceNumber_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The sequence number of the message that failed to be ingested.
       * </pre>
       *
       * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The sequenceNumber to set.
       * @return This builder for chaining.
       */
      public Builder setSequenceNumber(java.lang.String value) {
        if (value == null) {
          throw new NullPointerException();
        }
        sequenceNumber_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The sequence number of the message that failed to be ingested.
       * </pre>
       *
       * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @return This builder for chaining.
       */
      public Builder clearSequenceNumber() {
        sequenceNumber_ = getDefaultInstance().getSequenceNumber();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The sequence number of the message that failed to be ingested.
       * </pre>
       *
       * <code>string sequence_number = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
       *
       * @param value The bytes for sequenceNumber to set.
       * @return This builder for chaining.
       */
      public Builder setSequenceNumberBytes(com.google.protobuf.ByteString value) {
        if (value == null) {
          throw new NullPointerException();
        }
        checkByteStringIsUtf8(value);
        sequenceNumber_ = value;
        bitField0_ |= 0x00000004;
        onChanged();
        return this;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          schemaViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the schemaViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasSchemaViolationReason() {
        return reasonCase_ == 4;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The schemaViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
          getSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 4) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 4) {
            return schemaViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 4;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
              builderForValue) {
        if (schemaViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          schemaViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 4;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeSchemaViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason value) {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 4
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 4) {
            schemaViolationReasonBuilder_.mergeFrom(value);
          } else {
            schemaViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 4;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearSchemaViolationReason() {
        if (schemaViolationReasonBuilder_ == null) {
          if (reasonCase_ == 4) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 4) {
            reasonCase_ = 0;
            reason_ = null;
          }
          schemaViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder
          getSchemaViolationReasonBuilder() {
        return getSchemaViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder
          getSchemaViolationReasonOrBuilder() {
        if ((reasonCase_ == 4) && (schemaViolationReasonBuilder_ != null)) {
          return schemaViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 4) {
            return (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The Pub/Sub message failed schema validation.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason schema_violation_reason = 4 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>
          getSchemaViolationReasonFieldBuilder() {
        if (schemaViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 4)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason
                    .getDefaultInstance();
          }
          schemaViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.SchemaViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 4;
        onChanged();
        return schemaViolationReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          messageTransformationFailureReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the messageTransformationFailureReason field is set.
       */
      @java.lang.Override
      public boolean hasMessageTransformationFailureReason() {
        return reasonCase_ == 5;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The messageTransformationFailureReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
          getMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        } else {
          if (reasonCase_ == 5) {
            return messageTransformationFailureReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
              builderForValue) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          messageTransformationFailureReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeMessageTransformationFailureReason(
          com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason value) {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 5
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent
                                .MessageTransformationFailureReason)
                            reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 5) {
            messageTransformationFailureReasonBuilder_.mergeFrom(value);
          } else {
            messageTransformationFailureReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 5;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearMessageTransformationFailureReason() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 5) {
            reasonCase_ = 0;
            reason_ = null;
          }
          messageTransformationFailureReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder
          getMessageTransformationFailureReasonBuilder() {
        return getMessageTransformationFailureReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReasonOrBuilder
          getMessageTransformationFailureReasonOrBuilder() {
        if ((reasonCase_ == 5) && (messageTransformationFailureReasonBuilder_ != null)) {
          return messageTransformationFailureReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 5) {
            return (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
              .getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. Failure encountered when applying a message transformation to
       * the Pub/Sub message.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason message_transformation_failure_reason = 5 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
              com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent
                  .MessageTransformationFailureReasonOrBuilder>
          getMessageTransformationFailureReasonFieldBuilder() {
        if (messageTransformationFailureReasonBuilder_ == null) {
          if (!(reasonCase_ == 5)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                    .getDefaultInstance();
          }
          messageTransformationFailureReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason,
                  com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason
                      .Builder,
                  com.google.pubsub.v1.IngestionFailureEvent
                      .MessageTransformationFailureReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.MessageTransformationFailureReason)
                      reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 5;
        onChanged();
        return messageTransformationFailureReasonBuilder_;
      }

      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          apiViolationReasonBuilder_;

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return Whether the apiViolationReason field is set.
       */
      @java.lang.Override
      public boolean hasApiViolationReason() {
        return reasonCase_ == 6;
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       *
       * @return The apiViolationReason.
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason getApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        } else {
          if (reasonCase_ == 6) {
            return apiViolationReasonBuilder_.getMessage();
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          reason_ = value;
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(value);
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder setApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder builderForValue) {
        if (apiViolationReasonBuilder_ == null) {
          reason_ = builderForValue.build();
          onChanged();
        } else {
          apiViolationReasonBuilder_.setMessage(builderForValue.build());
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder mergeApiViolationReason(
          com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason value) {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6
              && reason_
                  != com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason
                      .getDefaultInstance()) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.newBuilder(
                        (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_)
                    .mergeFrom(value)
                    .buildPartial();
          } else {
            reason_ = value;
          }
          onChanged();
        } else {
          if (reasonCase_ == 6) {
            apiViolationReasonBuilder_.mergeFrom(value);
          } else {
            apiViolationReasonBuilder_.setMessage(value);
          }
        }
        reasonCase_ = 6;
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public Builder clearApiViolationReason() {
        if (apiViolationReasonBuilder_ == null) {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
            onChanged();
          }
        } else {
          if (reasonCase_ == 6) {
            reasonCase_ = 0;
            reason_ = null;
          }
          apiViolationReasonBuilder_.clear();
        }
        return this;
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder
          getApiViolationReasonBuilder() {
        return getApiViolationReasonFieldBuilder().getBuilder();
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      @java.lang.Override
      public com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder
          getApiViolationReasonOrBuilder() {
        if ((reasonCase_ == 6) && (apiViolationReasonBuilder_ != null)) {
          return apiViolationReasonBuilder_.getMessageOrBuilder();
        } else {
          if (reasonCase_ == 6) {
            return (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_;
          }
          return com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
        }
      }

      /**
       *
       *
       * <pre>
       * Optional. The message failed to be published due to an API violation.
       * This is only set when the size of the data field of the Kinesis record
       * is zero.
       * </pre>
       *
       * <code>
       * .google.pubsub.v1.IngestionFailureEvent.ApiViolationReason api_violation_reason = 6 [(.google.api.field_behavior) = OPTIONAL];
       * </code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
              com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>
          getApiViolationReasonFieldBuilder() {
        if (apiViolationReasonBuilder_ == null) {
          if (!(reasonCase_ == 6)) {
            reason_ =
                com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.getDefaultInstance();
          }
          apiViolationReasonBuilder_ =
              new com.google.protobuf.SingleFieldBuilderV3<
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason.Builder,
                  com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReasonOrBuilder>(
                  (com.google.pubsub.v1.IngestionFailureEvent.ApiViolationReason) reason_,
                  getParentForChildren(),
                  isClean());
          reason_ = null;
        }
        reasonCase_ = 6;
        onChanged();
        return apiViolationReasonBuilder_;
      }

      @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.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason)
    }

    // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason)
    private static final com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
        DEFAULT_INSTANCE;

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason();
    }

    public static com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
        getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
        getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }
  }

  private int failureCase_ = 0;

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

  public enum FailureCase
      implements
          com.google.protobuf.Internal.EnumLite,
          com.google.protobuf.AbstractMessage.InternalOneOfEnum {
    CLOUD_STORAGE_FAILURE(3),
    AWS_MSK_FAILURE(4),
    AZURE_EVENT_HUBS_FAILURE(5),
    CONFLUENT_CLOUD_FAILURE(6),
    AWS_KINESIS_FAILURE(7),
    FAILURE_NOT_SET(0);
    private final int value;

    private FailureCase(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 FailureCase valueOf(int value) {
      return forNumber(value);
    }

    public static FailureCase forNumber(int value) {
      switch (value) {
        case 3:
          return CLOUD_STORAGE_FAILURE;
        case 4:
          return AWS_MSK_FAILURE;
        case 5:
          return AZURE_EVENT_HUBS_FAILURE;
        case 6:
          return CONFLUENT_CLOUD_FAILURE;
        case 7:
          return AWS_KINESIS_FAILURE;
        case 0:
          return FAILURE_NOT_SET;
        default:
          return null;
      }
    }

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

  public FailureCase getFailureCase() {
    return FailureCase.forNumber(failureCase_);
  }

  public static final int TOPIC_FIELD_NUMBER = 1;

  @SuppressWarnings("serial")
  private volatile java.lang.Object topic_ = "";

  /**
   *
   *
   * <pre>
   * Required. Name of the import topic. Format is:
   * projects/{project_name}/topics/{topic_name}.
   * </pre>
   *
   * <code>
   * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The topic.
   */
  @java.lang.Override
  public java.lang.String getTopic() {
    java.lang.Object ref = topic_;
    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();
      topic_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Required. Name of the import topic. Format is:
   * projects/{project_name}/topics/{topic_name}.
   * </pre>
   *
   * <code>
   * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   * </code>
   *
   * @return The bytes for topic.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getTopicBytes() {
    java.lang.Object ref = topic_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      topic_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int ERROR_MESSAGE_FIELD_NUMBER = 2;

  @SuppressWarnings("serial")
  private volatile java.lang.Object errorMessage_ = "";

  /**
   *
   *
   * <pre>
   * Required. Error details explaining why ingestion to Pub/Sub has failed.
   * </pre>
   *
   * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The errorMessage.
   */
  @java.lang.Override
  public java.lang.String getErrorMessage() {
    java.lang.Object ref = errorMessage_;
    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();
      errorMessage_ = s;
      return s;
    }
  }

  /**
   *
   *
   * <pre>
   * Required. Error details explaining why ingestion to Pub/Sub has failed.
   * </pre>
   *
   * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
   *
   * @return The bytes for errorMessage.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString getErrorMessageBytes() {
    java.lang.Object ref = errorMessage_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b =
          com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
      errorMessage_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CLOUD_STORAGE_FAILURE_FIELD_NUMBER = 3;

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Cloud Storage.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the cloudStorageFailure field is set.
   */
  @java.lang.Override
  public boolean hasCloudStorageFailure() {
    return failureCase_ == 3;
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Cloud Storage.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The cloudStorageFailure.
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure getCloudStorageFailure() {
    if (failureCase_ == 3) {
      return (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Cloud Storage.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailureOrBuilder
      getCloudStorageFailureOrBuilder() {
    if (failureCase_ == 3) {
      return (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
  }

  public static final int AWS_MSK_FAILURE_FIELD_NUMBER = 4;

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Amazon MSK.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the awsMskFailure field is set.
   */
  @java.lang.Override
  public boolean hasAwsMskFailure() {
    return failureCase_ == 4;
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Amazon MSK.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The awsMskFailure.
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason getAwsMskFailure() {
    if (failureCase_ == 4) {
      return (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Amazon MSK.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReasonOrBuilder
      getAwsMskFailureOrBuilder() {
    if (failureCase_ == 4) {
      return (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
  }

  public static final int AZURE_EVENT_HUBS_FAILURE_FIELD_NUMBER = 5;

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Azure Event Hubs.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the azureEventHubsFailure field is set.
   */
  @java.lang.Override
  public boolean hasAzureEventHubsFailure() {
    return failureCase_ == 5;
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Azure Event Hubs.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The azureEventHubsFailure.
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
      getAzureEventHubsFailure() {
    if (failureCase_ == 5) {
      return (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        .getDefaultInstance();
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Azure Event Hubs.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReasonOrBuilder
      getAzureEventHubsFailureOrBuilder() {
    if (failureCase_ == 5) {
      return (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        .getDefaultInstance();
  }

  public static final int CONFLUENT_CLOUD_FAILURE_FIELD_NUMBER = 6;

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Confluent Cloud.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the confluentCloudFailure field is set.
   */
  @java.lang.Override
  public boolean hasConfluentCloudFailure() {
    return failureCase_ == 6;
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Confluent Cloud.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The confluentCloudFailure.
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
      getConfluentCloudFailure() {
    if (failureCase_ == 6) {
      return (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        .getDefaultInstance();
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from Confluent Cloud.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReasonOrBuilder
      getConfluentCloudFailureOrBuilder() {
    if (failureCase_ == 6) {
      return (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        .getDefaultInstance();
  }

  public static final int AWS_KINESIS_FAILURE_FIELD_NUMBER = 7;

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from AWS Kinesis.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return Whether the awsKinesisFailure field is set.
   */
  @java.lang.Override
  public boolean hasAwsKinesisFailure() {
    return failureCase_ == 7;
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from AWS Kinesis.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   *
   * @return The awsKinesisFailure.
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason getAwsKinesisFailure() {
    if (failureCase_ == 7) {
      return (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.getDefaultInstance();
  }

  /**
   *
   *
   * <pre>
   * Optional. Failure when ingesting from AWS Kinesis.
   * </pre>
   *
   * <code>
   * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
   * </code>
   */
  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReasonOrBuilder
      getAwsKinesisFailureOrBuilder() {
    if (failureCase_ == 7) {
      return (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_;
    }
    return com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.getDefaultInstance();
  }

  private byte memoizedIsInitialized = -1;

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

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, topic_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_);
    }
    if (failureCase_ == 3) {
      output.writeMessage(
          3, (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_);
    }
    if (failureCase_ == 4) {
      output.writeMessage(
          4, (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_);
    }
    if (failureCase_ == 5) {
      output.writeMessage(
          5, (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_);
    }
    if (failureCase_ == 6) {
      output.writeMessage(
          6, (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_);
    }
    if (failureCase_ == 7) {
      output.writeMessage(
          7, (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_);
    }
    getUnknownFields().writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(topic_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, topic_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(errorMessage_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_);
    }
    if (failureCase_ == 3) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              3, (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_);
    }
    if (failureCase_ == 4) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              4, (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_);
    }
    if (failureCase_ == 5) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              5, (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_);
    }
    if (failureCase_ == 6) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              6, (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_);
    }
    if (failureCase_ == 7) {
      size +=
          com.google.protobuf.CodedOutputStream.computeMessageSize(
              7, (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_);
    }
    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.pubsub.v1.IngestionFailureEvent)) {
      return super.equals(obj);
    }
    com.google.pubsub.v1.IngestionFailureEvent other =
        (com.google.pubsub.v1.IngestionFailureEvent) obj;

    if (!getTopic().equals(other.getTopic())) return false;
    if (!getErrorMessage().equals(other.getErrorMessage())) return false;
    if (!getFailureCase().equals(other.getFailureCase())) return false;
    switch (failureCase_) {
      case 3:
        if (!getCloudStorageFailure().equals(other.getCloudStorageFailure())) return false;
        break;
      case 4:
        if (!getAwsMskFailure().equals(other.getAwsMskFailure())) return false;
        break;
      case 5:
        if (!getAzureEventHubsFailure().equals(other.getAzureEventHubsFailure())) return false;
        break;
      case 6:
        if (!getConfluentCloudFailure().equals(other.getConfluentCloudFailure())) return false;
        break;
      case 7:
        if (!getAwsKinesisFailure().equals(other.getAwsKinesisFailure())) 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();
    hash = (37 * hash) + TOPIC_FIELD_NUMBER;
    hash = (53 * hash) + getTopic().hashCode();
    hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER;
    hash = (53 * hash) + getErrorMessage().hashCode();
    switch (failureCase_) {
      case 3:
        hash = (37 * hash) + CLOUD_STORAGE_FAILURE_FIELD_NUMBER;
        hash = (53 * hash) + getCloudStorageFailure().hashCode();
        break;
      case 4:
        hash = (37 * hash) + AWS_MSK_FAILURE_FIELD_NUMBER;
        hash = (53 * hash) + getAwsMskFailure().hashCode();
        break;
      case 5:
        hash = (37 * hash) + AZURE_EVENT_HUBS_FAILURE_FIELD_NUMBER;
        hash = (53 * hash) + getAzureEventHubsFailure().hashCode();
        break;
      case 6:
        hash = (37 * hash) + CONFLUENT_CLOUD_FAILURE_FIELD_NUMBER;
        hash = (53 * hash) + getConfluentCloudFailure().hashCode();
        break;
      case 7:
        hash = (37 * hash) + AWS_KINESIS_FAILURE_FIELD_NUMBER;
        hash = (53 * hash) + getAwsKinesisFailure().hashCode();
        break;
      case 0:
      default:
    }
    hash = (29 * hash) + getUnknownFields().hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static com.google.pubsub.v1.IngestionFailureEvent parseFrom(java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent parseFrom(
      java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent 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.pubsub.v1.IngestionFailureEvent parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent parseFrom(
      byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent 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.pubsub.v1.IngestionFailureEvent parseDelimitedFrom(
      java.io.InputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent 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.pubsub.v1.IngestionFailureEvent parseFrom(
      com.google.protobuf.CodedInputStream input) throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
  }

  public static com.google.pubsub.v1.IngestionFailureEvent 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.pubsub.v1.IngestionFailureEvent 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>
   * Payload of the Platform Log entry sent when a failure is encountered while
   * ingesting.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.IngestionFailureEvent}
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:google.pubsub.v1.IngestionFailureEvent)
      com.google.pubsub.v1.IngestionFailureEventOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.IngestionFailureEvent.class,
              com.google.pubsub.v1.IngestionFailureEvent.Builder.class);
    }

    // Construct using com.google.pubsub.v1.IngestionFailureEvent.newBuilder()
    private Builder() {}

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

    @java.lang.Override
    public Builder clear() {
      super.clear();
      bitField0_ = 0;
      topic_ = "";
      errorMessage_ = "";
      if (cloudStorageFailureBuilder_ != null) {
        cloudStorageFailureBuilder_.clear();
      }
      if (awsMskFailureBuilder_ != null) {
        awsMskFailureBuilder_.clear();
      }
      if (azureEventHubsFailureBuilder_ != null) {
        azureEventHubsFailureBuilder_.clear();
      }
      if (confluentCloudFailureBuilder_ != null) {
        confluentCloudFailureBuilder_.clear();
      }
      if (awsKinesisFailureBuilder_ != null) {
        awsKinesisFailureBuilder_.clear();
      }
      failureCase_ = 0;
      failure_ = null;
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_IngestionFailureEvent_descriptor;
    }

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent getDefaultInstanceForType() {
      return com.google.pubsub.v1.IngestionFailureEvent.getDefaultInstance();
    }

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent build() {
      com.google.pubsub.v1.IngestionFailureEvent result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent buildPartial() {
      com.google.pubsub.v1.IngestionFailureEvent result =
          new com.google.pubsub.v1.IngestionFailureEvent(this);
      if (bitField0_ != 0) {
        buildPartial0(result);
      }
      buildPartialOneofs(result);
      onBuilt();
      return result;
    }

    private void buildPartial0(com.google.pubsub.v1.IngestionFailureEvent result) {
      int from_bitField0_ = bitField0_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        result.topic_ = topic_;
      }
      if (((from_bitField0_ & 0x00000002) != 0)) {
        result.errorMessage_ = errorMessage_;
      }
    }

    private void buildPartialOneofs(com.google.pubsub.v1.IngestionFailureEvent result) {
      result.failureCase_ = failureCase_;
      result.failure_ = this.failure_;
      if (failureCase_ == 3 && cloudStorageFailureBuilder_ != null) {
        result.failure_ = cloudStorageFailureBuilder_.build();
      }
      if (failureCase_ == 4 && awsMskFailureBuilder_ != null) {
        result.failure_ = awsMskFailureBuilder_.build();
      }
      if (failureCase_ == 5 && azureEventHubsFailureBuilder_ != null) {
        result.failure_ = azureEventHubsFailureBuilder_.build();
      }
      if (failureCase_ == 6 && confluentCloudFailureBuilder_ != null) {
        result.failure_ = confluentCloudFailureBuilder_.build();
      }
      if (failureCase_ == 7 && awsKinesisFailureBuilder_ != null) {
        result.failure_ = awsKinesisFailureBuilder_.build();
      }
    }

    @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.pubsub.v1.IngestionFailureEvent) {
        return mergeFrom((com.google.pubsub.v1.IngestionFailureEvent) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.google.pubsub.v1.IngestionFailureEvent other) {
      if (other == com.google.pubsub.v1.IngestionFailureEvent.getDefaultInstance()) return this;
      if (!other.getTopic().isEmpty()) {
        topic_ = other.topic_;
        bitField0_ |= 0x00000001;
        onChanged();
      }
      if (!other.getErrorMessage().isEmpty()) {
        errorMessage_ = other.errorMessage_;
        bitField0_ |= 0x00000002;
        onChanged();
      }
      switch (other.getFailureCase()) {
        case CLOUD_STORAGE_FAILURE:
          {
            mergeCloudStorageFailure(other.getCloudStorageFailure());
            break;
          }
        case AWS_MSK_FAILURE:
          {
            mergeAwsMskFailure(other.getAwsMskFailure());
            break;
          }
        case AZURE_EVENT_HUBS_FAILURE:
          {
            mergeAzureEventHubsFailure(other.getAzureEventHubsFailure());
            break;
          }
        case CONFLUENT_CLOUD_FAILURE:
          {
            mergeConfluentCloudFailure(other.getConfluentCloudFailure());
            break;
          }
        case AWS_KINESIS_FAILURE:
          {
            mergeAwsKinesisFailure(other.getAwsKinesisFailure());
            break;
          }
        case FAILURE_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:
              {
                topic_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000001;
                break;
              } // case 10
            case 18:
              {
                errorMessage_ = input.readStringRequireUtf8();
                bitField0_ |= 0x00000002;
                break;
              } // case 18
            case 26:
              {
                input.readMessage(
                    getCloudStorageFailureFieldBuilder().getBuilder(), extensionRegistry);
                failureCase_ = 3;
                break;
              } // case 26
            case 34:
              {
                input.readMessage(getAwsMskFailureFieldBuilder().getBuilder(), extensionRegistry);
                failureCase_ = 4;
                break;
              } // case 34
            case 42:
              {
                input.readMessage(
                    getAzureEventHubsFailureFieldBuilder().getBuilder(), extensionRegistry);
                failureCase_ = 5;
                break;
              } // case 42
            case 50:
              {
                input.readMessage(
                    getConfluentCloudFailureFieldBuilder().getBuilder(), extensionRegistry);
                failureCase_ = 6;
                break;
              } // case 50
            case 58:
              {
                input.readMessage(
                    getAwsKinesisFailureFieldBuilder().getBuilder(), extensionRegistry);
                failureCase_ = 7;
                break;
              } // case 58
            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 failureCase_ = 0;
    private java.lang.Object failure_;

    public FailureCase getFailureCase() {
      return FailureCase.forNumber(failureCase_);
    }

    public Builder clearFailure() {
      failureCase_ = 0;
      failure_ = null;
      onChanged();
      return this;
    }

    private int bitField0_;

    private java.lang.Object topic_ = "";

    /**
     *
     *
     * <pre>
     * Required. Name of the import topic. Format is:
     * projects/{project_name}/topics/{topic_name}.
     * </pre>
     *
     * <code>
     * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The topic.
     */
    public java.lang.String getTopic() {
      java.lang.Object ref = topic_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        topic_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. Name of the import topic. Format is:
     * projects/{project_name}/topics/{topic_name}.
     * </pre>
     *
     * <code>
     * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return The bytes for topic.
     */
    public com.google.protobuf.ByteString getTopicBytes() {
      java.lang.Object ref = topic_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        topic_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. Name of the import topic. Format is:
     * projects/{project_name}/topics/{topic_name}.
     * </pre>
     *
     * <code>
     * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The topic to set.
     * @return This builder for chaining.
     */
    public Builder setTopic(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      topic_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. Name of the import topic. Format is:
     * projects/{project_name}/topics/{topic_name}.
     * </pre>
     *
     * <code>
     * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @return This builder for chaining.
     */
    public Builder clearTopic() {
      topic_ = getDefaultInstance().getTopic();
      bitField0_ = (bitField0_ & ~0x00000001);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. Name of the import topic. Format is:
     * projects/{project_name}/topics/{topic_name}.
     * </pre>
     *
     * <code>
     * string topic = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
     * </code>
     *
     * @param value The bytes for topic to set.
     * @return This builder for chaining.
     */
    public Builder setTopicBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      topic_ = value;
      bitField0_ |= 0x00000001;
      onChanged();
      return this;
    }

    private java.lang.Object errorMessage_ = "";

    /**
     *
     *
     * <pre>
     * Required. Error details explaining why ingestion to Pub/Sub has failed.
     * </pre>
     *
     * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The errorMessage.
     */
    public java.lang.String getErrorMessage() {
      java.lang.Object ref = errorMessage_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        errorMessage_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. Error details explaining why ingestion to Pub/Sub has failed.
     * </pre>
     *
     * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return The bytes for errorMessage.
     */
    public com.google.protobuf.ByteString getErrorMessageBytes() {
      java.lang.Object ref = errorMessage_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        errorMessage_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    /**
     *
     *
     * <pre>
     * Required. Error details explaining why ingestion to Pub/Sub has failed.
     * </pre>
     *
     * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The errorMessage to set.
     * @return This builder for chaining.
     */
    public Builder setErrorMessage(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      errorMessage_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. Error details explaining why ingestion to Pub/Sub has failed.
     * </pre>
     *
     * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return This builder for chaining.
     */
    public Builder clearErrorMessage() {
      errorMessage_ = getDefaultInstance().getErrorMessage();
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }

    /**
     *
     *
     * <pre>
     * Required. Error details explaining why ingestion to Pub/Sub has failed.
     * </pre>
     *
     * <code>string error_message = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param value The bytes for errorMessage to set.
     * @return This builder for chaining.
     */
    public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      checkByteStringIsUtf8(value);
      errorMessage_ = value;
      bitField0_ |= 0x00000002;
      onChanged();
      return this;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure,
            com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailureOrBuilder>
        cloudStorageFailureBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the cloudStorageFailure field is set.
     */
    @java.lang.Override
    public boolean hasCloudStorageFailure() {
      return failureCase_ == 3;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The cloudStorageFailure.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure getCloudStorageFailure() {
      if (cloudStorageFailureBuilder_ == null) {
        if (failureCase_ == 3) {
          return (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
      } else {
        if (failureCase_ == 3) {
          return cloudStorageFailureBuilder_.getMessage();
        }
        return com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setCloudStorageFailure(
        com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure value) {
      if (cloudStorageFailureBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        failure_ = value;
        onChanged();
      } else {
        cloudStorageFailureBuilder_.setMessage(value);
      }
      failureCase_ = 3;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setCloudStorageFailure(
        com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder builderForValue) {
      if (cloudStorageFailureBuilder_ == null) {
        failure_ = builderForValue.build();
        onChanged();
      } else {
        cloudStorageFailureBuilder_.setMessage(builderForValue.build());
      }
      failureCase_ = 3;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeCloudStorageFailure(
        com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure value) {
      if (cloudStorageFailureBuilder_ == null) {
        if (failureCase_ == 3
            && failure_
                != com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure
                    .getDefaultInstance()) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.newBuilder(
                      (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          failure_ = value;
        }
        onChanged();
      } else {
        if (failureCase_ == 3) {
          cloudStorageFailureBuilder_.mergeFrom(value);
        } else {
          cloudStorageFailureBuilder_.setMessage(value);
        }
      }
      failureCase_ = 3;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearCloudStorageFailure() {
      if (cloudStorageFailureBuilder_ == null) {
        if (failureCase_ == 3) {
          failureCase_ = 0;
          failure_ = null;
          onChanged();
        }
      } else {
        if (failureCase_ == 3) {
          failureCase_ = 0;
          failure_ = null;
        }
        cloudStorageFailureBuilder_.clear();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder
        getCloudStorageFailureBuilder() {
      return getCloudStorageFailureFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailureOrBuilder
        getCloudStorageFailureOrBuilder() {
      if ((failureCase_ == 3) && (cloudStorageFailureBuilder_ != null)) {
        return cloudStorageFailureBuilder_.getMessageOrBuilder();
      } else {
        if (failureCase_ == 3) {
          return (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Cloud Storage.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure cloud_storage_failure = 3 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure,
            com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailureOrBuilder>
        getCloudStorageFailureFieldBuilder() {
      if (cloudStorageFailureBuilder_ == null) {
        if (!(failureCase_ == 3)) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.getDefaultInstance();
        }
        cloudStorageFailureBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure,
                com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure.Builder,
                com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailureOrBuilder>(
                (com.google.pubsub.v1.IngestionFailureEvent.CloudStorageFailure) failure_,
                getParentForChildren(),
                isClean());
        failure_ = null;
      }
      failureCase_ = 3;
      onChanged();
      return cloudStorageFailureBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReasonOrBuilder>
        awsMskFailureBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the awsMskFailure field is set.
     */
    @java.lang.Override
    public boolean hasAwsMskFailure() {
      return failureCase_ == 4;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The awsMskFailure.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason getAwsMskFailure() {
      if (awsMskFailureBuilder_ == null) {
        if (failureCase_ == 4) {
          return (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
      } else {
        if (failureCase_ == 4) {
          return awsMskFailureBuilder_.getMessage();
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setAwsMskFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason value) {
      if (awsMskFailureBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        failure_ = value;
        onChanged();
      } else {
        awsMskFailureBuilder_.setMessage(value);
      }
      failureCase_ = 4;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setAwsMskFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder builderForValue) {
      if (awsMskFailureBuilder_ == null) {
        failure_ = builderForValue.build();
        onChanged();
      } else {
        awsMskFailureBuilder_.setMessage(builderForValue.build());
      }
      failureCase_ = 4;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeAwsMskFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason value) {
      if (awsMskFailureBuilder_ == null) {
        if (failureCase_ == 4
            && failure_
                != com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason
                    .getDefaultInstance()) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.newBuilder(
                      (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          failure_ = value;
        }
        onChanged();
      } else {
        if (failureCase_ == 4) {
          awsMskFailureBuilder_.mergeFrom(value);
        } else {
          awsMskFailureBuilder_.setMessage(value);
        }
      }
      failureCase_ = 4;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearAwsMskFailure() {
      if (awsMskFailureBuilder_ == null) {
        if (failureCase_ == 4) {
          failureCase_ = 0;
          failure_ = null;
          onChanged();
        }
      } else {
        if (failureCase_ == 4) {
          failureCase_ = 0;
          failure_ = null;
        }
        awsMskFailureBuilder_.clear();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder
        getAwsMskFailureBuilder() {
      return getAwsMskFailureFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReasonOrBuilder
        getAwsMskFailureOrBuilder() {
      if ((failureCase_ == 4) && (awsMskFailureBuilder_ != null)) {
        return awsMskFailureBuilder_.getMessageOrBuilder();
      } else {
        if (failureCase_ == 4) {
          return (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Amazon MSK.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason aws_msk_failure = 4 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReasonOrBuilder>
        getAwsMskFailureFieldBuilder() {
      if (awsMskFailureBuilder_ == null) {
        if (!(failureCase_ == 4)) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.getDefaultInstance();
        }
        awsMskFailureBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason,
                com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason.Builder,
                com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReasonOrBuilder>(
                (com.google.pubsub.v1.IngestionFailureEvent.AwsMskFailureReason) failure_,
                getParentForChildren(),
                isClean());
        failure_ = null;
      }
      failureCase_ = 4;
      onChanged();
      return awsMskFailureBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReasonOrBuilder>
        azureEventHubsFailureBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the azureEventHubsFailure field is set.
     */
    @java.lang.Override
    public boolean hasAzureEventHubsFailure() {
      return failureCase_ == 5;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The azureEventHubsFailure.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
        getAzureEventHubsFailure() {
      if (azureEventHubsFailureBuilder_ == null) {
        if (failureCase_ == 5) {
          return (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
            .getDefaultInstance();
      } else {
        if (failureCase_ == 5) {
          return azureEventHubsFailureBuilder_.getMessage();
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
            .getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setAzureEventHubsFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason value) {
      if (azureEventHubsFailureBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        failure_ = value;
        onChanged();
      } else {
        azureEventHubsFailureBuilder_.setMessage(value);
      }
      failureCase_ = 5;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setAzureEventHubsFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder
            builderForValue) {
      if (azureEventHubsFailureBuilder_ == null) {
        failure_ = builderForValue.build();
        onChanged();
      } else {
        azureEventHubsFailureBuilder_.setMessage(builderForValue.build());
      }
      failureCase_ = 5;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeAzureEventHubsFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason value) {
      if (azureEventHubsFailureBuilder_ == null) {
        if (failureCase_ == 5
            && failure_
                != com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
                    .getDefaultInstance()) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.newBuilder(
                      (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason)
                          failure_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          failure_ = value;
        }
        onChanged();
      } else {
        if (failureCase_ == 5) {
          azureEventHubsFailureBuilder_.mergeFrom(value);
        } else {
          azureEventHubsFailureBuilder_.setMessage(value);
        }
      }
      failureCase_ = 5;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearAzureEventHubsFailure() {
      if (azureEventHubsFailureBuilder_ == null) {
        if (failureCase_ == 5) {
          failureCase_ = 0;
          failure_ = null;
          onChanged();
        }
      } else {
        if (failureCase_ == 5) {
          failureCase_ = 0;
          failure_ = null;
        }
        azureEventHubsFailureBuilder_.clear();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder
        getAzureEventHubsFailureBuilder() {
      return getAzureEventHubsFailureFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReasonOrBuilder
        getAzureEventHubsFailureOrBuilder() {
      if ((failureCase_ == 5) && (azureEventHubsFailureBuilder_ != null)) {
        return azureEventHubsFailureBuilder_.getMessageOrBuilder();
      } else {
        if (failureCase_ == 5) {
          return (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
            .getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Azure Event Hubs.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason azure_event_hubs_failure = 5 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReasonOrBuilder>
        getAzureEventHubsFailureFieldBuilder() {
      if (azureEventHubsFailureBuilder_ == null) {
        if (!(failureCase_ == 5)) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason
                  .getDefaultInstance();
        }
        azureEventHubsFailureBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason,
                com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason.Builder,
                com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReasonOrBuilder>(
                (com.google.pubsub.v1.IngestionFailureEvent.AzureEventHubsFailureReason) failure_,
                getParentForChildren(),
                isClean());
        failure_ = null;
      }
      failureCase_ = 5;
      onChanged();
      return azureEventHubsFailureBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReasonOrBuilder>
        confluentCloudFailureBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the confluentCloudFailure field is set.
     */
    @java.lang.Override
    public boolean hasConfluentCloudFailure() {
      return failureCase_ == 6;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The confluentCloudFailure.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
        getConfluentCloudFailure() {
      if (confluentCloudFailureBuilder_ == null) {
        if (failureCase_ == 6) {
          return (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
            .getDefaultInstance();
      } else {
        if (failureCase_ == 6) {
          return confluentCloudFailureBuilder_.getMessage();
        }
        return com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
            .getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setConfluentCloudFailure(
        com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason value) {
      if (confluentCloudFailureBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        failure_ = value;
        onChanged();
      } else {
        confluentCloudFailureBuilder_.setMessage(value);
      }
      failureCase_ = 6;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setConfluentCloudFailure(
        com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder
            builderForValue) {
      if (confluentCloudFailureBuilder_ == null) {
        failure_ = builderForValue.build();
        onChanged();
      } else {
        confluentCloudFailureBuilder_.setMessage(builderForValue.build());
      }
      failureCase_ = 6;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeConfluentCloudFailure(
        com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason value) {
      if (confluentCloudFailureBuilder_ == null) {
        if (failureCase_ == 6
            && failure_
                != com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
                    .getDefaultInstance()) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.newBuilder(
                      (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason)
                          failure_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          failure_ = value;
        }
        onChanged();
      } else {
        if (failureCase_ == 6) {
          confluentCloudFailureBuilder_.mergeFrom(value);
        } else {
          confluentCloudFailureBuilder_.setMessage(value);
        }
      }
      failureCase_ = 6;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearConfluentCloudFailure() {
      if (confluentCloudFailureBuilder_ == null) {
        if (failureCase_ == 6) {
          failureCase_ = 0;
          failure_ = null;
          onChanged();
        }
      } else {
        if (failureCase_ == 6) {
          failureCase_ = 0;
          failure_ = null;
        }
        confluentCloudFailureBuilder_.clear();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder
        getConfluentCloudFailureBuilder() {
      return getConfluentCloudFailureFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReasonOrBuilder
        getConfluentCloudFailureOrBuilder() {
      if ((failureCase_ == 6) && (confluentCloudFailureBuilder_ != null)) {
        return confluentCloudFailureBuilder_.getMessageOrBuilder();
      } else {
        if (failureCase_ == 6) {
          return (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
            .getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from Confluent Cloud.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason confluent_cloud_failure = 6 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReasonOrBuilder>
        getConfluentCloudFailureFieldBuilder() {
      if (confluentCloudFailureBuilder_ == null) {
        if (!(failureCase_ == 6)) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason
                  .getDefaultInstance();
        }
        confluentCloudFailureBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason,
                com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason.Builder,
                com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReasonOrBuilder>(
                (com.google.pubsub.v1.IngestionFailureEvent.ConfluentCloudFailureReason) failure_,
                getParentForChildren(),
                isClean());
        failure_ = null;
      }
      failureCase_ = 6;
      onChanged();
      return confluentCloudFailureBuilder_;
    }

    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReasonOrBuilder>
        awsKinesisFailureBuilder_;

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return Whether the awsKinesisFailure field is set.
     */
    @java.lang.Override
    public boolean hasAwsKinesisFailure() {
      return failureCase_ == 7;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     *
     * @return The awsKinesisFailure.
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
        getAwsKinesisFailure() {
      if (awsKinesisFailureBuilder_ == null) {
        if (failureCase_ == 7) {
          return (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
            .getDefaultInstance();
      } else {
        if (failureCase_ == 7) {
          return awsKinesisFailureBuilder_.getMessage();
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
            .getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setAwsKinesisFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason value) {
      if (awsKinesisFailureBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        failure_ = value;
        onChanged();
      } else {
        awsKinesisFailureBuilder_.setMessage(value);
      }
      failureCase_ = 7;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder setAwsKinesisFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder
            builderForValue) {
      if (awsKinesisFailureBuilder_ == null) {
        failure_ = builderForValue.build();
        onChanged();
      } else {
        awsKinesisFailureBuilder_.setMessage(builderForValue.build());
      }
      failureCase_ = 7;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder mergeAwsKinesisFailure(
        com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason value) {
      if (awsKinesisFailureBuilder_ == null) {
        if (failureCase_ == 7
            && failure_
                != com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
                    .getDefaultInstance()) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.newBuilder(
                      (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          failure_ = value;
        }
        onChanged();
      } else {
        if (failureCase_ == 7) {
          awsKinesisFailureBuilder_.mergeFrom(value);
        } else {
          awsKinesisFailureBuilder_.setMessage(value);
        }
      }
      failureCase_ = 7;
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public Builder clearAwsKinesisFailure() {
      if (awsKinesisFailureBuilder_ == null) {
        if (failureCase_ == 7) {
          failureCase_ = 0;
          failure_ = null;
          onChanged();
        }
      } else {
        if (failureCase_ == 7) {
          failureCase_ = 0;
          failure_ = null;
        }
        awsKinesisFailureBuilder_.clear();
      }
      return this;
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder
        getAwsKinesisFailureBuilder() {
      return getAwsKinesisFailureFieldBuilder().getBuilder();
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    @java.lang.Override
    public com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReasonOrBuilder
        getAwsKinesisFailureOrBuilder() {
      if ((failureCase_ == 7) && (awsKinesisFailureBuilder_ != null)) {
        return awsKinesisFailureBuilder_.getMessageOrBuilder();
      } else {
        if (failureCase_ == 7) {
          return (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_;
        }
        return com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
            .getDefaultInstance();
      }
    }

    /**
     *
     *
     * <pre>
     * Optional. Failure when ingesting from AWS Kinesis.
     * </pre>
     *
     * <code>
     * .google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason aws_kinesis_failure = 7 [(.google.api.field_behavior) = OPTIONAL];
     * </code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
            com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason,
            com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder,
            com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReasonOrBuilder>
        getAwsKinesisFailureFieldBuilder() {
      if (awsKinesisFailureBuilder_ == null) {
        if (!(failureCase_ == 7)) {
          failure_ =
              com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason
                  .getDefaultInstance();
        }
        awsKinesisFailureBuilder_ =
            new com.google.protobuf.SingleFieldBuilderV3<
                com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason,
                com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason.Builder,
                com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReasonOrBuilder>(
                (com.google.pubsub.v1.IngestionFailureEvent.AwsKinesisFailureReason) failure_,
                getParentForChildren(),
                isClean());
        failure_ = null;
      }
      failureCase_ = 7;
      onChanged();
      return awsKinesisFailureBuilder_;
    }

    @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.pubsub.v1.IngestionFailureEvent)
  }

  // @@protoc_insertion_point(class_scope:google.pubsub.v1.IngestionFailureEvent)
  private static final com.google.pubsub.v1.IngestionFailureEvent DEFAULT_INSTANCE;

  static {
    DEFAULT_INSTANCE = new com.google.pubsub.v1.IngestionFailureEvent();
  }

  public static com.google.pubsub.v1.IngestionFailureEvent getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

  @java.lang.Override
  public com.google.pubsub.v1.IngestionFailureEvent getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }
}
