/*
 * 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>
 * Configuration for a Cloud Storage subscription.
 * </pre>
 *
 * Protobuf type {@code google.pubsub.v1.CloudStorageConfig}
 */
public final class CloudStorageConfig extends com.google.protobuf.GeneratedMessageV3
    implements
    // @@protoc_insertion_point(message_implements:google.pubsub.v1.CloudStorageConfig)
    CloudStorageConfigOrBuilder {
  private static final long serialVersionUID = 0L;

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

  private CloudStorageConfig() {
    bucket_ = "";
    filenamePrefix_ = "";
    filenameSuffix_ = "";
    filenameDatetimeFormat_ = "";
    state_ = 0;
    serviceAccountEmail_ = "";
  }

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

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

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

  /**
   *
   *
   * <pre>
   * Possible states for a Cloud Storage subscription.
   * </pre>
   *
   * Protobuf enum {@code google.pubsub.v1.CloudStorageConfig.State}
   */
  public enum State implements com.google.protobuf.ProtocolMessageEnum {
    /**
     *
     *
     * <pre>
     * Default value. This value is unused.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    STATE_UNSPECIFIED(0),
    /**
     *
     *
     * <pre>
     * The subscription can actively send messages to Cloud Storage.
     * </pre>
     *
     * <code>ACTIVE = 1;</code>
     */
    ACTIVE(1),
    /**
     *
     *
     * <pre>
     * Cannot write to the Cloud Storage bucket because of permission denied
     * errors.
     * </pre>
     *
     * <code>PERMISSION_DENIED = 2;</code>
     */
    PERMISSION_DENIED(2),
    /**
     *
     *
     * <pre>
     * Cannot write to the Cloud Storage bucket because it does not exist.
     * </pre>
     *
     * <code>NOT_FOUND = 3;</code>
     */
    NOT_FOUND(3),
    /**
     *
     *
     * <pre>
     * Cannot write to the destination because enforce_in_transit is set to true
     * and the destination locations are not in the allowed regions.
     * </pre>
     *
     * <code>IN_TRANSIT_LOCATION_RESTRICTION = 4;</code>
     */
    IN_TRANSIT_LOCATION_RESTRICTION(4),
    /**
     *
     *
     * <pre>
     * Cannot write to the Cloud Storage bucket due to an incompatibility
     * between the topic schema and subscription settings.
     * </pre>
     *
     * <code>SCHEMA_MISMATCH = 5;</code>
     */
    SCHEMA_MISMATCH(5),
    UNRECOGNIZED(-1),
    ;

    /**
     *
     *
     * <pre>
     * Default value. This value is unused.
     * </pre>
     *
     * <code>STATE_UNSPECIFIED = 0;</code>
     */
    public static final int STATE_UNSPECIFIED_VALUE = 0;

    /**
     *
     *
     * <pre>
     * The subscription can actively send messages to Cloud Storage.
     * </pre>
     *
     * <code>ACTIVE = 1;</code>
     */
    public static final int ACTIVE_VALUE = 1;

    /**
     *
     *
     * <pre>
     * Cannot write to the Cloud Storage bucket because of permission denied
     * errors.
     * </pre>
     *
     * <code>PERMISSION_DENIED = 2;</code>
     */
    public static final int PERMISSION_DENIED_VALUE = 2;

    /**
     *
     *
     * <pre>
     * Cannot write to the Cloud Storage bucket because it does not exist.
     * </pre>
     *
     * <code>NOT_FOUND = 3;</code>
     */
    public static final int NOT_FOUND_VALUE = 3;

    /**
     *
     *
     * <pre>
     * Cannot write to the destination because enforce_in_transit is set to true
     * and the destination locations are not in the allowed regions.
     * </pre>
     *
     * <code>IN_TRANSIT_LOCATION_RESTRICTION = 4;</code>
     */
    public static final int IN_TRANSIT_LOCATION_RESTRICTION_VALUE = 4;

    /**
     *
     *
     * <pre>
     * Cannot write to the Cloud Storage bucket due to an incompatibility
     * between the topic schema and subscription settings.
     * </pre>
     *
     * <code>SCHEMA_MISMATCH = 5;</code>
     */
    public static final int SCHEMA_MISMATCH_VALUE = 5;

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

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

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static State forNumber(int value) {
      switch (value) {
        case 0:
          return STATE_UNSPECIFIED;
        case 1:
          return ACTIVE;
        case 2:
          return PERMISSION_DENIED;
        case 3:
          return NOT_FOUND;
        case 4:
          return IN_TRANSIT_LOCATION_RESTRICTION;
        case 5:
          return SCHEMA_MISMATCH;
        default:
          return null;
      }
    }

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

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

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

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

    public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
      return com.google.pubsub.v1.CloudStorageConfig.getDescriptor().getEnumTypes().get(0);
    }

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

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

    private final int value;

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

    // @@protoc_insertion_point(enum_scope:google.pubsub.v1.CloudStorageConfig.State)
  }

  public interface TextConfigOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CloudStorageConfig.TextConfig)
      com.google.protobuf.MessageOrBuilder {}

  /**
   *
   *
   * <pre>
   * Configuration for writing message data in text format.
   * Message payloads will be written to files as raw text, separated by a
   * newline.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.TextConfig}
   */
  public static final class TextConfig extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.CloudStorageConfig.TextConfig)
      TextConfigOrBuilder {
    private static final long serialVersionUID = 0L;

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

    private TextConfig() {}

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

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

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.google.pubsub.v1.PubsubProto
          .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.google.pubsub.v1.CloudStorageConfig.TextConfig.class,
              com.google.pubsub.v1.CloudStorageConfig.TextConfig.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.CloudStorageConfig.TextConfig)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.CloudStorageConfig.TextConfig other =
          (com.google.pubsub.v1.CloudStorageConfig.TextConfig) 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.CloudStorageConfig.TextConfig parseFrom(
        java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

    public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

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

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

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

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

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

    public static com.google.pubsub.v1.CloudStorageConfig.TextConfig 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.CloudStorageConfig.TextConfig 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>
     * Configuration for writing message data in text format.
     * Message payloads will be written to files as raw text, separated by a
     * newline.
     * </pre>
     *
     * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.TextConfig}
     */
    public static final class Builder
        extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
        implements
        // @@protoc_insertion_point(builder_implements:google.pubsub.v1.CloudStorageConfig.TextConfig)
        com.google.pubsub.v1.CloudStorageConfig.TextConfigOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return com.google.pubsub.v1.PubsubProto
            .internal_static_google_pubsub_v1_CloudStorageConfig_TextConfig_descriptor;
      }

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

      // Construct using com.google.pubsub.v1.CloudStorageConfig.TextConfig.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_CloudStorageConfig_TextConfig_descriptor;
      }

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

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

      @java.lang.Override
      public com.google.pubsub.v1.CloudStorageConfig.TextConfig buildPartial() {
        com.google.pubsub.v1.CloudStorageConfig.TextConfig result =
            new com.google.pubsub.v1.CloudStorageConfig.TextConfig(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.CloudStorageConfig.TextConfig) {
          return mergeFrom((com.google.pubsub.v1.CloudStorageConfig.TextConfig) other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(com.google.pubsub.v1.CloudStorageConfig.TextConfig other) {
        if (other == com.google.pubsub.v1.CloudStorageConfig.TextConfig.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.CloudStorageConfig.TextConfig)
    }

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

    static {
      DEFAULT_INSTANCE = new com.google.pubsub.v1.CloudStorageConfig.TextConfig();
    }

    public static com.google.pubsub.v1.CloudStorageConfig.TextConfig getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

  public interface AvroConfigOrBuilder
      extends
      // @@protoc_insertion_point(interface_extends:google.pubsub.v1.CloudStorageConfig.AvroConfig)
      com.google.protobuf.MessageOrBuilder {

    /**
     *
     *
     * <pre>
     * Optional. When true, write the subscription name, message_id,
     * publish_time, attributes, and ordering_key as additional fields in the
     * output. The subscription name, message_id, and publish_time fields are
     * put in their own fields while all other message properties other than
     * data (for example, an ordering_key, if present) are added as entries in
     * the attributes map.
     * </pre>
     *
     * <code>bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The writeMetadata.
     */
    boolean getWriteMetadata();

    /**
     *
     *
     * <pre>
     * Optional. When true, the output Cloud Storage file will be serialized
     * using the topic schema, if it exists.
     * </pre>
     *
     * <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The useTopicSchema.
     */
    boolean getUseTopicSchema();
  }

  /**
   *
   *
   * <pre>
   * Configuration for writing message data in Avro format.
   * Message payloads and metadata will be written to files as an Avro binary.
   * </pre>
   *
   * Protobuf type {@code google.pubsub.v1.CloudStorageConfig.AvroConfig}
   */
  public static final class AvroConfig extends com.google.protobuf.GeneratedMessageV3
      implements
      // @@protoc_insertion_point(message_implements:google.pubsub.v1.CloudStorageConfig.AvroConfig)
      AvroConfigOrBuilder {
    private static final long serialVersionUID = 0L;

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

    private AvroConfig() {}

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

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

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

    public static final int WRITE_METADATA_FIELD_NUMBER = 1;
    private boolean writeMetadata_ = false;

    /**
     *
     *
     * <pre>
     * Optional. When true, write the subscription name, message_id,
     * publish_time, attributes, and ordering_key as additional fields in the
     * output. The subscription name, message_id, and publish_time fields are
     * put in their own fields while all other message properties other than
     * data (for example, an ordering_key, if present) are added as entries in
     * the attributes map.
     * </pre>
     *
     * <code>bool write_metadata = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The writeMetadata.
     */
    @java.lang.Override
    public boolean getWriteMetadata() {
      return writeMetadata_;
    }

    public static final int USE_TOPIC_SCHEMA_FIELD_NUMBER = 2;
    private boolean useTopicSchema_ = false;

    /**
     *
     *
     * <pre>
     * Optional. When true, the output Cloud Storage file will be serialized
     * using the topic schema, if it exists.
     * </pre>
     *
     * <code>bool use_topic_schema = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     *
     * @return The useTopicSchema.
     */
    @java.lang.Override
    public boolean getUseTopicSchema() {
      return useTopicSchema_;
    }

    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 (writeMetadata_ != false) {
        output.writeBool(1, writeMetadata_);
      }
      if (useTopicSchema_ != false) {
        output.writeBool(2, useTopicSchema_);
      }
      getUnknownFields().writeTo(output);
    }

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

      size = 0;
      if (writeMetadata_ != false) {
        size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, writeMetadata_);
      }
      if (useTopicSchema_ != false) {
        size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, useTopicSchema_);
      }
      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.CloudStorageConfig.AvroConfig)) {
        return super.equals(obj);
      }
      com.google.pubsub.v1.CloudStorageConfig.AvroConfig other =
          (com.google.pubsub.v1.CloudStorageConfig.AvroConfig) obj;

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

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + WRITE_METADATA_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getWriteMetadata());
      hash = (37 * hash) + USE_TOPIC_SCHEMA_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getUseTopicSchema());
      hash = (29 * hash) + getUnknownFields().hashCode();
      memoizedHashCode = hash;
      return hash;
    }

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

    public static com.google.pubsub.v1.CloudStorageConfig.AvroConfig 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.CloudStorageConfig.AvroConfig parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }

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

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

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

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

