// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/logging/v2/logging_config.proto

package com.google.logging.v2;

/**
 * <pre>
 * Describes a sink used to export log entries to one of the following
 * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a
 * Cloud Pub/Sub topic. A logs filter controls which log entries are exported.
 * The sink must be created within a project, organization, billing account, or
 * folder.
 * </pre>
 *
 * Protobuf type {@code google.logging.v2.LogSink}
 */
public  final class LogSink extends
    com.google.protobuf.GeneratedMessageLite<
        LogSink, LogSink.Builder> implements
    // @@protoc_insertion_point(message_implements:google.logging.v2.LogSink)
    LogSinkOrBuilder {
  private LogSink() {
    name_ = "";
    destination_ = "";
    filter_ = "";
    description_ = "";
    exclusions_ = emptyProtobufList();
    writerIdentity_ = "";
  }
  /**
   * <pre>
   * Deprecated. This is unused.
   * </pre>
   *
   * Protobuf enum {@code google.logging.v2.LogSink.VersionFormat}
   */
  public enum VersionFormat
      implements com.google.protobuf.Internal.EnumLite {
    /**
     * <pre>
     * An unspecified format version that will default to V2.
     * </pre>
     *
     * <code>VERSION_FORMAT_UNSPECIFIED = 0;</code>
     */
    VERSION_FORMAT_UNSPECIFIED(0),
    /**
     * <pre>
     * `LogEntry` version 2 format.
     * </pre>
     *
     * <code>V2 = 1;</code>
     */
    V2(1),
    /**
     * <pre>
     * `LogEntry` version 1 format.
     * </pre>
     *
     * <code>V1 = 2;</code>
     */
    V1(2),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * An unspecified format version that will default to V2.
     * </pre>
     *
     * <code>VERSION_FORMAT_UNSPECIFIED = 0;</code>
     */
    public static final int VERSION_FORMAT_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * `LogEntry` version 2 format.
     * </pre>
     *
     * <code>V2 = 1;</code>
     */
    public static final int V2_VALUE = 1;
    /**
     * <pre>
     * `LogEntry` version 1 format.
     * </pre>
     *
     * <code>V1 = 2;</code>
     */
    public static final int V1_VALUE = 2;


    @java.lang.Override
    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 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 VersionFormat valueOf(int value) {
      return forNumber(value);
    }

    public static VersionFormat forNumber(int value) {
      switch (value) {
        case 0: return VERSION_FORMAT_UNSPECIFIED;
        case 1: return V2;
        case 2: return V1;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<VersionFormat>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        VersionFormat> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<VersionFormat>() {
            @java.lang.Override
            public VersionFormat findValueByNumber(int number) {
              return VersionFormat.forNumber(number);
            }
          };

    public static com.google.protobuf.Internal.EnumVerifier 
        internalGetVerifier() {
      return VersionFormatVerifier.INSTANCE;
    }

    private static final class VersionFormatVerifier implements 
         com.google.protobuf.Internal.EnumVerifier { 
            static final com.google.protobuf.Internal.EnumVerifier           INSTANCE = new VersionFormatVerifier();
            @java.lang.Override
            public boolean isInRange(int number) {
              return VersionFormat.forNumber(number) != null;
            }
          };

    private final int value;

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

    // @@protoc_insertion_point(enum_scope:google.logging.v2.LogSink.VersionFormat)
  }

  private int optionsCase_ = 0;
  private java.lang.Object options_;
  public enum OptionsCase {
    BIGQUERY_OPTIONS(12),
    OPTIONS_NOT_SET(0);
    private final int value;
    private OptionsCase(int value) {
      this.value = value;
    }
    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static OptionsCase valueOf(int value) {
      return forNumber(value);
    }

    public static OptionsCase forNumber(int value) {
      switch (value) {
        case 12: return BIGQUERY_OPTIONS;
        case 0: return OPTIONS_NOT_SET;
        default: return null;
      }
    }
    public int getNumber() {
      return this.value;
    }
  };

  @java.lang.Override
  public OptionsCase
  getOptionsCase() {
    return OptionsCase.forNumber(
        optionsCase_);
  }

  private void clearOptions() {
    optionsCase_ = 0;
    options_ = null;
  }

  public static final int NAME_FIELD_NUMBER = 1;
  private java.lang.String name_;
  /**
   * <pre>
   * Required. The client-assigned sink identifier, unique within the project. Example:
   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
   * characters and can include only the following characters: upper and
   * lower-case alphanumeric characters, underscores, hyphens, and periods.
   * First character has to be alphanumeric.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    return name_;
  }
  /**
   * <pre>
   * Required. The client-assigned sink identifier, unique within the project. Example:
   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
   * characters and can include only the following characters: upper and
   * lower-case alphanumeric characters, underscores, hyphens, and periods.
   * First character has to be alphanumeric.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getNameBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(name_);
  }
  /**
   * <pre>
   * Required. The client-assigned sink identifier, unique within the project. Example:
   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
   * characters and can include only the following characters: upper and
   * lower-case alphanumeric characters, underscores, hyphens, and periods.
   * First character has to be alphanumeric.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   * @param value The name to set.
   */
  private void setName(
      java.lang.String value) {
    value.getClass();
  
    name_ = value;
  }
  /**
   * <pre>
   * Required. The client-assigned sink identifier, unique within the project. Example:
   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
   * characters and can include only the following characters: upper and
   * lower-case alphanumeric characters, underscores, hyphens, and periods.
   * First character has to be alphanumeric.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   */
  private void clearName() {
    
    name_ = getDefaultInstance().getName();
  }
  /**
   * <pre>
   * Required. The client-assigned sink identifier, unique within the project. Example:
   * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
   * characters and can include only the following characters: upper and
   * lower-case alphanumeric characters, underscores, hyphens, and periods.
   * First character has to be alphanumeric.
   * </pre>
   *
   * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
   * @param value The bytes for name to set.
   */
  private void setNameBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    name_ = value.toStringUtf8();
    
  }

  public static final int DESTINATION_FIELD_NUMBER = 3;
  private java.lang.String destination_;
  /**
   * <pre>
   * Required. The export destination:
   *     "storage.googleapis.com/[GCS_BUCKET]"
   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
   * The sink's `writer_identity`, set when the sink is created, must
   * have permission to write to the destination or else the log
   * entries are not exported. For more information, see
   * [Exporting Logs with
   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
   * </pre>
   *
   * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
   * @return The destination.
   */
  @java.lang.Override
  public java.lang.String getDestination() {
    return destination_;
  }
  /**
   * <pre>
   * Required. The export destination:
   *     "storage.googleapis.com/[GCS_BUCKET]"
   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
   * The sink's `writer_identity`, set when the sink is created, must
   * have permission to write to the destination or else the log
   * entries are not exported. For more information, see
   * [Exporting Logs with
   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
   * </pre>
   *
   * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
   * @return The bytes for destination.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getDestinationBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(destination_);
  }
  /**
   * <pre>
   * Required. The export destination:
   *     "storage.googleapis.com/[GCS_BUCKET]"
   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
   * The sink's `writer_identity`, set when the sink is created, must
   * have permission to write to the destination or else the log
   * entries are not exported. For more information, see
   * [Exporting Logs with
   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
   * </pre>
   *
   * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
   * @param value The destination to set.
   */
  private void setDestination(
      java.lang.String value) {
    value.getClass();
  
    destination_ = value;
  }
  /**
   * <pre>
   * Required. The export destination:
   *     "storage.googleapis.com/[GCS_BUCKET]"
   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
   * The sink's `writer_identity`, set when the sink is created, must
   * have permission to write to the destination or else the log
   * entries are not exported. For more information, see
   * [Exporting Logs with
   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
   * </pre>
   *
   * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
   */
  private void clearDestination() {
    
    destination_ = getDefaultInstance().getDestination();
  }
  /**
   * <pre>
   * Required. The export destination:
   *     "storage.googleapis.com/[GCS_BUCKET]"
   *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
   *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
   * The sink's `writer_identity`, set when the sink is created, must
   * have permission to write to the destination or else the log
   * entries are not exported. For more information, see
   * [Exporting Logs with
   * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
   * </pre>
   *
   * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
   * @param value The bytes for destination to set.
   */
  private void setDestinationBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    destination_ = value.toStringUtf8();
    
  }

  public static final int FILTER_FIELD_NUMBER = 5;
  private java.lang.String filter_;
  /**
   * <pre>
   * Optional. An [advanced logs
   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
   * only exported log entries are those that are in the resource owning the
   * sink and that match the filter. For example:
   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
   * </pre>
   *
   * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @return The filter.
   */
  @java.lang.Override
  public java.lang.String getFilter() {
    return filter_;
  }
  /**
   * <pre>
   * Optional. An [advanced logs
   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
   * only exported log entries are those that are in the resource owning the
   * sink and that match the filter. For example:
   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
   * </pre>
   *
   * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @return The bytes for filter.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getFilterBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(filter_);
  }
  /**
   * <pre>
   * Optional. An [advanced logs
   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
   * only exported log entries are those that are in the resource owning the
   * sink and that match the filter. For example:
   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
   * </pre>
   *
   * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @param value The filter to set.
   */
  private void setFilter(
      java.lang.String value) {
    value.getClass();
  
    filter_ = value;
  }
  /**
   * <pre>
   * Optional. An [advanced logs
   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
   * only exported log entries are those that are in the resource owning the
   * sink and that match the filter. For example:
   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
   * </pre>
   *
   * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void clearFilter() {
    
    filter_ = getDefaultInstance().getFilter();
  }
  /**
   * <pre>
   * Optional. An [advanced logs
   * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
   * only exported log entries are those that are in the resource owning the
   * sink and that match the filter. For example:
   *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
   * </pre>
   *
   * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @param value The bytes for filter to set.
   */
  private void setFilterBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    filter_ = value.toStringUtf8();
    
  }

  public static final int DESCRIPTION_FIELD_NUMBER = 18;
  private java.lang.String description_;
  /**
   * <pre>
   * Optional. A description of this sink.
   * The maximum length of the description is 8000 characters.
   * </pre>
   *
   * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @return The description.
   */
  @java.lang.Override
  public java.lang.String getDescription() {
    return description_;
  }
  /**
   * <pre>
   * Optional. A description of this sink.
   * The maximum length of the description is 8000 characters.
   * </pre>
   *
   * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @return The bytes for description.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getDescriptionBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(description_);
  }
  /**
   * <pre>
   * Optional. A description of this sink.
   * The maximum length of the description is 8000 characters.
   * </pre>
   *
   * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @param value The description to set.
   */
  private void setDescription(
      java.lang.String value) {
    value.getClass();
  
    description_ = value;
  }
  /**
   * <pre>
   * Optional. A description of this sink.
   * The maximum length of the description is 8000 characters.
   * </pre>
   *
   * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void clearDescription() {
    
    description_ = getDefaultInstance().getDescription();
  }
  /**
   * <pre>
   * Optional. A description of this sink.
   * The maximum length of the description is 8000 characters.
   * </pre>
   *
   * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @param value The bytes for description to set.
   */
  private void setDescriptionBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    description_ = value.toStringUtf8();
    
  }

  public static final int DISABLED_FIELD_NUMBER = 19;
  private boolean disabled_;
  /**
   * <pre>
   * Optional. If set to True, then this sink is disabled and it does not
   * export any log entries.
   * </pre>
   *
   * <code>bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @return The disabled.
   */
  @java.lang.Override
  public boolean getDisabled() {
    return disabled_;
  }
  /**
   * <pre>
   * Optional. If set to True, then this sink is disabled and it does not
   * export any log entries.
   * </pre>
   *
   * <code>bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @param value The disabled to set.
   */
  private void setDisabled(boolean value) {
    
    disabled_ = value;
  }
  /**
   * <pre>
   * Optional. If set to True, then this sink is disabled and it does not
   * export any log entries.
   * </pre>
   *
   * <code>bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void clearDisabled() {
    
    disabled_ = false;
  }

  public static final int EXCLUSIONS_FIELD_NUMBER = 16;
  private com.google.protobuf.Internal.ProtobufList<com.google.logging.v2.LogExclusion> exclusions_;
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public java.util.List<com.google.logging.v2.LogExclusion> getExclusionsList() {
    return exclusions_;
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  public java.util.List<? extends com.google.logging.v2.LogExclusionOrBuilder> 
      getExclusionsOrBuilderList() {
    return exclusions_;
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public int getExclusionsCount() {
    return exclusions_.size();
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public com.google.logging.v2.LogExclusion getExclusions(int index) {
    return exclusions_.get(index);
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  public com.google.logging.v2.LogExclusionOrBuilder getExclusionsOrBuilder(
      int index) {
    return exclusions_.get(index);
  }
  private void ensureExclusionsIsMutable() {
    com.google.protobuf.Internal.ProtobufList<com.google.logging.v2.LogExclusion> tmp = exclusions_;
    if (!tmp.isModifiable()) {
      exclusions_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }

  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void setExclusions(
      int index, com.google.logging.v2.LogExclusion value) {
    value.getClass();
  ensureExclusionsIsMutable();
    exclusions_.set(index, value);
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void addExclusions(com.google.logging.v2.LogExclusion value) {
    value.getClass();
  ensureExclusionsIsMutable();
    exclusions_.add(value);
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void addExclusions(
      int index, com.google.logging.v2.LogExclusion value) {
    value.getClass();
  ensureExclusionsIsMutable();
    exclusions_.add(index, value);
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void addAllExclusions(
      java.lang.Iterable<? extends com.google.logging.v2.LogExclusion> values) {
    ensureExclusionsIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, exclusions_);
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void clearExclusions() {
    exclusions_ = emptyProtobufList();
  }
  /**
   * <pre>
   * Optional. Log entries that match any of the exclusion filters will not be exported.
   * If a log entry is matched by both `filter` and one of `exclusion_filters`
   * it will not be exported.
   * </pre>
   *
   * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void removeExclusions(int index) {
    ensureExclusionsIsMutable();
    exclusions_.remove(index);
  }

  public static final int OUTPUT_VERSION_FORMAT_FIELD_NUMBER = 6;
  private int outputVersionFormat_;
  /**
   * <pre>
   * Deprecated. This field is unused.
   * </pre>
   *
   * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
   * @return The enum numeric value on the wire for outputVersionFormat.
   */
  @java.lang.Override
  @java.lang.Deprecated public int getOutputVersionFormatValue() {
    return outputVersionFormat_;
  }
  /**
   * <pre>
   * Deprecated. This field is unused.
   * </pre>
   *
   * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
   * @return The outputVersionFormat.
   */
  @java.lang.Override
  @java.lang.Deprecated public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() {
    com.google.logging.v2.LogSink.VersionFormat result = com.google.logging.v2.LogSink.VersionFormat.forNumber(outputVersionFormat_);
    return result == null ? com.google.logging.v2.LogSink.VersionFormat.UNRECOGNIZED : result;
  }
  /**
   * <pre>
   * Deprecated. This field is unused.
   * </pre>
   *
   * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
   * @param value The enum numeric value on the wire for outputVersionFormat to set.
   */
  private void setOutputVersionFormatValue(int value) {
      outputVersionFormat_ = value;
  }
  /**
   * <pre>
   * Deprecated. This field is unused.
   * </pre>
   *
   * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
   * @param value The outputVersionFormat to set.
   */
  private void setOutputVersionFormat(com.google.logging.v2.LogSink.VersionFormat value) {
    outputVersionFormat_ = value.getNumber();
    
  }
  /**
   * <pre>
   * Deprecated. This field is unused.
   * </pre>
   *
   * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
   */
  private void clearOutputVersionFormat() {
    
    outputVersionFormat_ = 0;
  }

  public static final int WRITER_IDENTITY_FIELD_NUMBER = 8;
  private java.lang.String writerIdentity_;
  /**
   * <pre>
   * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
   * writes the exported log entries to the sink's destination. This field is
   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
   * value of `unique_writer_identity` in those methods.
   * Until you grant this identity write-access to the destination, log entry
   * exports from this sink will fail. For more information,
   * see [Granting Access for a
   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
   * Consult the destination service's documentation to determine the
   * appropriate IAM roles to assign to the identity.
   * </pre>
   *
   * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   * @return The writerIdentity.
   */
  @java.lang.Override
  public java.lang.String getWriterIdentity() {
    return writerIdentity_;
  }
  /**
   * <pre>
   * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
   * writes the exported log entries to the sink's destination. This field is
   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
   * value of `unique_writer_identity` in those methods.
   * Until you grant this identity write-access to the destination, log entry
   * exports from this sink will fail. For more information,
   * see [Granting Access for a
   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
   * Consult the destination service's documentation to determine the
   * appropriate IAM roles to assign to the identity.
   * </pre>
   *
   * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   * @return The bytes for writerIdentity.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getWriterIdentityBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(writerIdentity_);
  }
  /**
   * <pre>
   * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
   * writes the exported log entries to the sink's destination. This field is
   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
   * value of `unique_writer_identity` in those methods.
   * Until you grant this identity write-access to the destination, log entry
   * exports from this sink will fail. For more information,
   * see [Granting Access for a
   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
   * Consult the destination service's documentation to determine the
   * appropriate IAM roles to assign to the identity.
   * </pre>
   *
   * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   * @param value The writerIdentity to set.
   */
  private void setWriterIdentity(
      java.lang.String value) {
    value.getClass();
  
    writerIdentity_ = value;
  }
  /**
   * <pre>
   * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
   * writes the exported log entries to the sink's destination. This field is
   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
   * value of `unique_writer_identity` in those methods.
   * Until you grant this identity write-access to the destination, log entry
   * exports from this sink will fail. For more information,
   * see [Granting Access for a
   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
   * Consult the destination service's documentation to determine the
   * appropriate IAM roles to assign to the identity.
   * </pre>
   *
   * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  private void clearWriterIdentity() {
    
    writerIdentity_ = getDefaultInstance().getWriterIdentity();
  }
  /**
   * <pre>
   * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
   * writes the exported log entries to the sink's destination. This field is
   * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
   * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
   * value of `unique_writer_identity` in those methods.
   * Until you grant this identity write-access to the destination, log entry
   * exports from this sink will fail. For more information,
   * see [Granting Access for a
   * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
   * Consult the destination service's documentation to determine the
   * appropriate IAM roles to assign to the identity.
   * </pre>
   *
   * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   * @param value The bytes for writerIdentity to set.
   */
  private void setWriterIdentityBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    writerIdentity_ = value.toStringUtf8();
    
  }

  public static final int INCLUDE_CHILDREN_FIELD_NUMBER = 9;
  private boolean includeChildren_;
  /**
   * <pre>
   * Optional. This field applies only to sinks owned by organizations and
   * folders. If the field is false, the default, only the logs owned by the
   * sink's parent resource are available for export. If the field is true, then
   * logs from all the projects, folders, and billing accounts contained in the
   * sink's parent resource are also available for export. Whether a particular
   * log entry from the children is exported depends on the sink's filter
   * expression. For example, if this field is true, then the filter
   * `resource.type=gce_instance` would export all Compute Engine VM instance
   * log entries from all projects in the sink's parent. To only export entries
   * from certain child projects, filter on the project part of the log name:
   *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
   *     resource.type=gce_instance
   * </pre>
   *
   * <code>bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @return The includeChildren.
   */
  @java.lang.Override
  public boolean getIncludeChildren() {
    return includeChildren_;
  }
  /**
   * <pre>
   * Optional. This field applies only to sinks owned by organizations and
   * folders. If the field is false, the default, only the logs owned by the
   * sink's parent resource are available for export. If the field is true, then
   * logs from all the projects, folders, and billing accounts contained in the
   * sink's parent resource are also available for export. Whether a particular
   * log entry from the children is exported depends on the sink's filter
   * expression. For example, if this field is true, then the filter
   * `resource.type=gce_instance` would export all Compute Engine VM instance
   * log entries from all projects in the sink's parent. To only export entries
   * from certain child projects, filter on the project part of the log name:
   *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
   *     resource.type=gce_instance
   * </pre>
   *
   * <code>bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
   * @param value The includeChildren to set.
   */
  private void setIncludeChildren(boolean value) {
    
    includeChildren_ = value;
  }
  /**
   * <pre>
   * Optional. This field applies only to sinks owned by organizations and
   * folders. If the field is false, the default, only the logs owned by the
   * sink's parent resource are available for export. If the field is true, then
   * logs from all the projects, folders, and billing accounts contained in the
   * sink's parent resource are also available for export. Whether a particular
   * log entry from the children is exported depends on the sink's filter
   * expression. For example, if this field is true, then the filter
   * `resource.type=gce_instance` would export all Compute Engine VM instance
   * log entries from all projects in the sink's parent. To only export entries
   * from certain child projects, filter on the project part of the log name:
   *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
   *     resource.type=gce_instance
   * </pre>
   *
   * <code>bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void clearIncludeChildren() {
    
    includeChildren_ = false;
  }

  public static final int BIGQUERY_OPTIONS_FIELD_NUMBER = 12;
  /**
   * <pre>
   * Optional. Options that affect sinks exporting data to BigQuery.
   * </pre>
   *
   * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public boolean hasBigqueryOptions() {
    return optionsCase_ == 12;
  }
  /**
   * <pre>
   * Optional. Options that affect sinks exporting data to BigQuery.
   * </pre>
   *
   * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  @java.lang.Override
  public com.google.logging.v2.BigQueryOptions getBigqueryOptions() {
    if (optionsCase_ == 12) {
       return (com.google.logging.v2.BigQueryOptions) options_;
    }
    return com.google.logging.v2.BigQueryOptions.getDefaultInstance();
  }
  /**
   * <pre>
   * Optional. Options that affect sinks exporting data to BigQuery.
   * </pre>
   *
   * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void setBigqueryOptions(com.google.logging.v2.BigQueryOptions value) {
    value.getClass();
  options_ = value;
    optionsCase_ = 12;
  }
  /**
   * <pre>
   * Optional. Options that affect sinks exporting data to BigQuery.
   * </pre>
   *
   * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void mergeBigqueryOptions(com.google.logging.v2.BigQueryOptions value) {
    value.getClass();
  if (optionsCase_ == 12 &&
        options_ != com.google.logging.v2.BigQueryOptions.getDefaultInstance()) {
      options_ = com.google.logging.v2.BigQueryOptions.newBuilder((com.google.logging.v2.BigQueryOptions) options_)
          .mergeFrom(value).buildPartial();
    } else {
      options_ = value;
    }
    optionsCase_ = 12;
  }
  /**
   * <pre>
   * Optional. Options that affect sinks exporting data to BigQuery.
   * </pre>
   *
   * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
   */
  private void clearBigqueryOptions() {
    if (optionsCase_ == 12) {
      optionsCase_ = 0;
      options_ = null;
    }
  }

  public static final int CREATE_TIME_FIELD_NUMBER = 13;
  private com.google.protobuf.Timestamp createTime_;
  /**
   * <pre>
   * Output only. The creation timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  @java.lang.Override
  public boolean hasCreateTime() {
    return createTime_ != null;
  }
  /**
   * <pre>
   * Output only. The creation timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getCreateTime() {
    return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
  }
  /**
   * <pre>
   * Output only. The creation timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  private void setCreateTime(com.google.protobuf.Timestamp value) {
    value.getClass();
  createTime_ = value;
    
    }
  /**
   * <pre>
   * Output only. The creation timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  @java.lang.SuppressWarnings({"ReferenceEquality"})
  private void mergeCreateTime(com.google.protobuf.Timestamp value) {
    value.getClass();
  if (createTime_ != null &&
        createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
      createTime_ =
        com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial();
    } else {
      createTime_ = value;
    }
    
  }
  /**
   * <pre>
   * Output only. The creation timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  private void clearCreateTime() {  createTime_ = null;
    
  }

  public static final int UPDATE_TIME_FIELD_NUMBER = 14;
  private com.google.protobuf.Timestamp updateTime_;
  /**
   * <pre>
   * Output only. The last update timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  @java.lang.Override
  public boolean hasUpdateTime() {
    return updateTime_ != null;
  }
  /**
   * <pre>
   * Output only. The last update timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  @java.lang.Override
  public com.google.protobuf.Timestamp getUpdateTime() {
    return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_;
  }
  /**
   * <pre>
   * Output only. The last update timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  private void setUpdateTime(com.google.protobuf.Timestamp value) {
    value.getClass();
  updateTime_ = value;
    
    }
  /**
   * <pre>
   * Output only. The last update timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  @java.lang.SuppressWarnings({"ReferenceEquality"})
  private void mergeUpdateTime(com.google.protobuf.Timestamp value) {
    value.getClass();
  if (updateTime_ != null &&
        updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
      updateTime_ =
        com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial();
    } else {
      updateTime_ = value;
    }
    
  }
  /**
   * <pre>
   * Output only. The last update timestamp of the sink.
   * This field may not be present for older sinks.
   * </pre>
   *
   * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
   */
  private void clearUpdateTime() {  updateTime_ = null;
    
  }

  public static com.google.logging.v2.LogSink parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.logging.v2.LogSink parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data, extensionRegistry);
  }
  public static com.google.logging.v2.LogSink parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.logging.v2.LogSink parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input);
  }
  public static com.google.logging.v2.LogSink parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.logging.v2.LogSink parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input, extensionRegistry);
  }

  public static Builder newBuilder() {
    return (Builder) DEFAULT_INSTANCE.createBuilder();
  }
  public static Builder newBuilder(com.google.logging.v2.LogSink prototype) {
    return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
  }

  /**
   * <pre>
   * Describes a sink used to export log entries to one of the following
   * destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a
   * Cloud Pub/Sub topic. A logs filter controls which log entries are exported.
   * The sink must be created within a project, organization, billing account, or
   * folder.
   * </pre>
   *
   * Protobuf type {@code google.logging.v2.LogSink}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.logging.v2.LogSink, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.logging.v2.LogSink)
      com.google.logging.v2.LogSinkOrBuilder {
    // Construct using com.google.logging.v2.LogSink.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }

    @java.lang.Override
    public OptionsCase
        getOptionsCase() {
      return instance.getOptionsCase();
    }

    public Builder clearOptions() {
      copyOnWrite();
      instance.clearOptions();
      return this;
    }


    /**
     * <pre>
     * Required. The client-assigned sink identifier, unique within the project. Example:
     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
     * characters and can include only the following characters: upper and
     * lower-case alphanumeric characters, underscores, hyphens, and periods.
     * First character has to be alphanumeric.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return The name.
     */
    @java.lang.Override
    public java.lang.String getName() {
      return instance.getName();
    }
    /**
     * <pre>
     * Required. The client-assigned sink identifier, unique within the project. Example:
     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
     * characters and can include only the following characters: upper and
     * lower-case alphanumeric characters, underscores, hyphens, and periods.
     * First character has to be alphanumeric.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return The bytes for name.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getNameBytes() {
      return instance.getNameBytes();
    }
    /**
     * <pre>
     * Required. The client-assigned sink identifier, unique within the project. Example:
     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
     * characters and can include only the following characters: upper and
     * lower-case alphanumeric characters, underscores, hyphens, and periods.
     * First character has to be alphanumeric.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(
        java.lang.String value) {
      copyOnWrite();
      instance.setName(value);
      return this;
    }
    /**
     * <pre>
     * Required. The client-assigned sink identifier, unique within the project. Example:
     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
     * characters and can include only the following characters: upper and
     * lower-case alphanumeric characters, underscores, hyphens, and periods.
     * First character has to be alphanumeric.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return This builder for chaining.
     */
    public Builder clearName() {
      copyOnWrite();
      instance.clearName();
      return this;
    }
    /**
     * <pre>
     * Required. The client-assigned sink identifier, unique within the project. Example:
     * `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited to 100
     * characters and can include only the following characters: upper and
     * lower-case alphanumeric characters, underscores, hyphens, and periods.
     * First character has to be alphanumeric.
     * </pre>
     *
     * <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setNameBytes(value);
      return this;
    }

    /**
     * <pre>
     * Required. The export destination:
     *     "storage.googleapis.com/[GCS_BUCKET]"
     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
     * The sink's `writer_identity`, set when the sink is created, must
     * have permission to write to the destination or else the log
     * entries are not exported. For more information, see
     * [Exporting Logs with
     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
     * </pre>
     *
     * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
     * @return The destination.
     */
    @java.lang.Override
    public java.lang.String getDestination() {
      return instance.getDestination();
    }
    /**
     * <pre>
     * Required. The export destination:
     *     "storage.googleapis.com/[GCS_BUCKET]"
     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
     * The sink's `writer_identity`, set when the sink is created, must
     * have permission to write to the destination or else the log
     * entries are not exported. For more information, see
     * [Exporting Logs with
     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
     * </pre>
     *
     * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
     * @return The bytes for destination.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDestinationBytes() {
      return instance.getDestinationBytes();
    }
    /**
     * <pre>
     * Required. The export destination:
     *     "storage.googleapis.com/[GCS_BUCKET]"
     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
     * The sink's `writer_identity`, set when the sink is created, must
     * have permission to write to the destination or else the log
     * entries are not exported. For more information, see
     * [Exporting Logs with
     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
     * </pre>
     *
     * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
     * @param value The destination to set.
     * @return This builder for chaining.
     */
    public Builder setDestination(
        java.lang.String value) {
      copyOnWrite();
      instance.setDestination(value);
      return this;
    }
    /**
     * <pre>
     * Required. The export destination:
     *     "storage.googleapis.com/[GCS_BUCKET]"
     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
     * The sink's `writer_identity`, set when the sink is created, must
     * have permission to write to the destination or else the log
     * entries are not exported. For more information, see
     * [Exporting Logs with
     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
     * </pre>
     *
     * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
     * @return This builder for chaining.
     */
    public Builder clearDestination() {
      copyOnWrite();
      instance.clearDestination();
      return this;
    }
    /**
     * <pre>
     * Required. The export destination:
     *     "storage.googleapis.com/[GCS_BUCKET]"
     *     "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
     *     "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
     * The sink's `writer_identity`, set when the sink is created, must
     * have permission to write to the destination or else the log
     * entries are not exported. For more information, see
     * [Exporting Logs with
     * Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
     * </pre>
     *
     * <code>string destination = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
     * @param value The bytes for destination to set.
     * @return This builder for chaining.
     */
    public Builder setDestinationBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setDestinationBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. An [advanced logs
     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
     * only exported log entries are those that are in the resource owning the
     * sink and that match the filter. For example:
     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
     * </pre>
     *
     * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return The filter.
     */
    @java.lang.Override
    public java.lang.String getFilter() {
      return instance.getFilter();
    }
    /**
     * <pre>
     * Optional. An [advanced logs
     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
     * only exported log entries are those that are in the resource owning the
     * sink and that match the filter. For example:
     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
     * </pre>
     *
     * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return The bytes for filter.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getFilterBytes() {
      return instance.getFilterBytes();
    }
    /**
     * <pre>
     * Optional. An [advanced logs
     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
     * only exported log entries are those that are in the resource owning the
     * sink and that match the filter. For example:
     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
     * </pre>
     *
     * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param value The filter to set.
     * @return This builder for chaining.
     */
    public Builder setFilter(
        java.lang.String value) {
      copyOnWrite();
      instance.setFilter(value);
      return this;
    }
    /**
     * <pre>
     * Optional. An [advanced logs
     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
     * only exported log entries are those that are in the resource owning the
     * sink and that match the filter. For example:
     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
     * </pre>
     *
     * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return This builder for chaining.
     */
    public Builder clearFilter() {
      copyOnWrite();
      instance.clearFilter();
      return this;
    }
    /**
     * <pre>
     * Optional. An [advanced logs
     * filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
     * only exported log entries are those that are in the resource owning the
     * sink and that match the filter. For example:
     *     logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity&gt;=ERROR
     * </pre>
     *
     * <code>string filter = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param value The bytes for filter to set.
     * @return This builder for chaining.
     */
    public Builder setFilterBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setFilterBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. A description of this sink.
     * The maximum length of the description is 8000 characters.
     * </pre>
     *
     * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return The description.
     */
    @java.lang.Override
    public java.lang.String getDescription() {
      return instance.getDescription();
    }
    /**
     * <pre>
     * Optional. A description of this sink.
     * The maximum length of the description is 8000 characters.
     * </pre>
     *
     * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return The bytes for description.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDescriptionBytes() {
      return instance.getDescriptionBytes();
    }
    /**
     * <pre>
     * Optional. A description of this sink.
     * The maximum length of the description is 8000 characters.
     * </pre>
     *
     * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param value The description to set.
     * @return This builder for chaining.
     */
    public Builder setDescription(
        java.lang.String value) {
      copyOnWrite();
      instance.setDescription(value);
      return this;
    }
    /**
     * <pre>
     * Optional. A description of this sink.
     * The maximum length of the description is 8000 characters.
     * </pre>
     *
     * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return This builder for chaining.
     */
    public Builder clearDescription() {
      copyOnWrite();
      instance.clearDescription();
      return this;
    }
    /**
     * <pre>
     * Optional. A description of this sink.
     * The maximum length of the description is 8000 characters.
     * </pre>
     *
     * <code>string description = 18 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param value The bytes for description to set.
     * @return This builder for chaining.
     */
    public Builder setDescriptionBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setDescriptionBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. If set to True, then this sink is disabled and it does not
     * export any log entries.
     * </pre>
     *
     * <code>bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return The disabled.
     */
    @java.lang.Override
    public boolean getDisabled() {
      return instance.getDisabled();
    }
    /**
     * <pre>
     * Optional. If set to True, then this sink is disabled and it does not
     * export any log entries.
     * </pre>
     *
     * <code>bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param value The disabled to set.
     * @return This builder for chaining.
     */
    public Builder setDisabled(boolean value) {
      copyOnWrite();
      instance.setDisabled(value);
      return this;
    }
    /**
     * <pre>
     * Optional. If set to True, then this sink is disabled and it does not
     * export any log entries.
     * </pre>
     *
     * <code>bool disabled = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return This builder for chaining.
     */
    public Builder clearDisabled() {
      copyOnWrite();
      instance.clearDisabled();
      return this;
    }

    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public java.util.List<com.google.logging.v2.LogExclusion> getExclusionsList() {
      return java.util.Collections.unmodifiableList(
          instance.getExclusionsList());
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public int getExclusionsCount() {
      return instance.getExclusionsCount();
    }/**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public com.google.logging.v2.LogExclusion getExclusions(int index) {
      return instance.getExclusions(index);
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder setExclusions(
        int index, com.google.logging.v2.LogExclusion value) {
      copyOnWrite();
      instance.setExclusions(index, value);
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder setExclusions(
        int index, com.google.logging.v2.LogExclusion.Builder builderForValue) {
      copyOnWrite();
      instance.setExclusions(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder addExclusions(com.google.logging.v2.LogExclusion value) {
      copyOnWrite();
      instance.addExclusions(value);
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder addExclusions(
        int index, com.google.logging.v2.LogExclusion value) {
      copyOnWrite();
      instance.addExclusions(index, value);
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder addExclusions(
        com.google.logging.v2.LogExclusion.Builder builderForValue) {
      copyOnWrite();
      instance.addExclusions(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder addExclusions(
        int index, com.google.logging.v2.LogExclusion.Builder builderForValue) {
      copyOnWrite();
      instance.addExclusions(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder addAllExclusions(
        java.lang.Iterable<? extends com.google.logging.v2.LogExclusion> values) {
      copyOnWrite();
      instance.addAllExclusions(values);
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder clearExclusions() {
      copyOnWrite();
      instance.clearExclusions();
      return this;
    }
    /**
     * <pre>
     * Optional. Log entries that match any of the exclusion filters will not be exported.
     * If a log entry is matched by both `filter` and one of `exclusion_filters`
     * it will not be exported.
     * </pre>
     *
     * <code>repeated .google.logging.v2.LogExclusion exclusions = 16 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder removeExclusions(int index) {
      copyOnWrite();
      instance.removeExclusions(index);
      return this;
    }

    /**
     * <pre>
     * Deprecated. This field is unused.
     * </pre>
     *
     * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
     * @return The enum numeric value on the wire for outputVersionFormat.
     */
    @java.lang.Override
    @java.lang.Deprecated public int getOutputVersionFormatValue() {
      return instance.getOutputVersionFormatValue();
    }
    /**
     * <pre>
     * Deprecated. This field is unused.
     * </pre>
     *
     * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
     * @param value The outputVersionFormat to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated public Builder setOutputVersionFormatValue(int value) {
      copyOnWrite();
      instance.setOutputVersionFormatValue(value);
      return this;
    }
    /**
     * <pre>
     * Deprecated. This field is unused.
     * </pre>
     *
     * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
     * @return The outputVersionFormat.
     */
    @java.lang.Override
    @java.lang.Deprecated public com.google.logging.v2.LogSink.VersionFormat getOutputVersionFormat() {
      return instance.getOutputVersionFormat();
    }
    /**
     * <pre>
     * Deprecated. This field is unused.
     * </pre>
     *
     * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
     * @param value The enum numeric value on the wire for outputVersionFormat to set.
     * @return This builder for chaining.
     */
    @java.lang.Deprecated public Builder setOutputVersionFormat(com.google.logging.v2.LogSink.VersionFormat value) {
      copyOnWrite();
      instance.setOutputVersionFormat(value);
      return this;
    }
    /**
     * <pre>
     * Deprecated. This field is unused.
     * </pre>
     *
     * <code>.google.logging.v2.LogSink.VersionFormat output_version_format = 6 [deprecated = true];</code>
     * @return This builder for chaining.
     */
    @java.lang.Deprecated public Builder clearOutputVersionFormat() {
      copyOnWrite();
      instance.clearOutputVersionFormat();
      return this;
    }

    /**
     * <pre>
     * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
     * writes the exported log entries to the sink's destination. This field is
     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
     * value of `unique_writer_identity` in those methods.
     * Until you grant this identity write-access to the destination, log entry
     * exports from this sink will fail. For more information,
     * see [Granting Access for a
     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
     * Consult the destination service's documentation to determine the
     * appropriate IAM roles to assign to the identity.
     * </pre>
     *
     * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return The writerIdentity.
     */
    @java.lang.Override
    public java.lang.String getWriterIdentity() {
      return instance.getWriterIdentity();
    }
    /**
     * <pre>
     * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
     * writes the exported log entries to the sink's destination. This field is
     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
     * value of `unique_writer_identity` in those methods.
     * Until you grant this identity write-access to the destination, log entry
     * exports from this sink will fail. For more information,
     * see [Granting Access for a
     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
     * Consult the destination service's documentation to determine the
     * appropriate IAM roles to assign to the identity.
     * </pre>
     *
     * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return The bytes for writerIdentity.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getWriterIdentityBytes() {
      return instance.getWriterIdentityBytes();
    }
    /**
     * <pre>
     * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
     * writes the exported log entries to the sink's destination. This field is
     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
     * value of `unique_writer_identity` in those methods.
     * Until you grant this identity write-access to the destination, log entry
     * exports from this sink will fail. For more information,
     * see [Granting Access for a
     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
     * Consult the destination service's documentation to determine the
     * appropriate IAM roles to assign to the identity.
     * </pre>
     *
     * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param value The writerIdentity to set.
     * @return This builder for chaining.
     */
    public Builder setWriterIdentity(
        java.lang.String value) {
      copyOnWrite();
      instance.setWriterIdentity(value);
      return this;
    }
    /**
     * <pre>
     * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
     * writes the exported log entries to the sink's destination. This field is
     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
     * value of `unique_writer_identity` in those methods.
     * Until you grant this identity write-access to the destination, log entry
     * exports from this sink will fail. For more information,
     * see [Granting Access for a
     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
     * Consult the destination service's documentation to determine the
     * appropriate IAM roles to assign to the identity.
     * </pre>
     *
     * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return This builder for chaining.
     */
    public Builder clearWriterIdentity() {
      copyOnWrite();
      instance.clearWriterIdentity();
      return this;
    }
    /**
     * <pre>
     * Output only. An IAM identity&amp;mdash;a service account or group&amp;mdash;under which Logging
     * writes the exported log entries to the sink's destination. This field is
     * set by [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
     * [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
     * value of `unique_writer_identity` in those methods.
     * Until you grant this identity write-access to the destination, log entry
     * exports from this sink will fail. For more information,
     * see [Granting Access for a
     * Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
     * Consult the destination service's documentation to determine the
     * appropriate IAM roles to assign to the identity.
     * </pre>
     *
     * <code>string writer_identity = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param value The bytes for writerIdentity to set.
     * @return This builder for chaining.
     */
    public Builder setWriterIdentityBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setWriterIdentityBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. This field applies only to sinks owned by organizations and
     * folders. If the field is false, the default, only the logs owned by the
     * sink's parent resource are available for export. If the field is true, then
     * logs from all the projects, folders, and billing accounts contained in the
     * sink's parent resource are also available for export. Whether a particular
     * log entry from the children is exported depends on the sink's filter
     * expression. For example, if this field is true, then the filter
     * `resource.type=gce_instance` would export all Compute Engine VM instance
     * log entries from all projects in the sink's parent. To only export entries
     * from certain child projects, filter on the project part of the log name:
     *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
     *     resource.type=gce_instance
     * </pre>
     *
     * <code>bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return The includeChildren.
     */
    @java.lang.Override
    public boolean getIncludeChildren() {
      return instance.getIncludeChildren();
    }
    /**
     * <pre>
     * Optional. This field applies only to sinks owned by organizations and
     * folders. If the field is false, the default, only the logs owned by the
     * sink's parent resource are available for export. If the field is true, then
     * logs from all the projects, folders, and billing accounts contained in the
     * sink's parent resource are also available for export. Whether a particular
     * log entry from the children is exported depends on the sink's filter
     * expression. For example, if this field is true, then the filter
     * `resource.type=gce_instance` would export all Compute Engine VM instance
     * log entries from all projects in the sink's parent. To only export entries
     * from certain child projects, filter on the project part of the log name:
     *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
     *     resource.type=gce_instance
     * </pre>
     *
     * <code>bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param value The includeChildren to set.
     * @return This builder for chaining.
     */
    public Builder setIncludeChildren(boolean value) {
      copyOnWrite();
      instance.setIncludeChildren(value);
      return this;
    }
    /**
     * <pre>
     * Optional. This field applies only to sinks owned by organizations and
     * folders. If the field is false, the default, only the logs owned by the
     * sink's parent resource are available for export. If the field is true, then
     * logs from all the projects, folders, and billing accounts contained in the
     * sink's parent resource are also available for export. Whether a particular
     * log entry from the children is exported depends on the sink's filter
     * expression. For example, if this field is true, then the filter
     * `resource.type=gce_instance` would export all Compute Engine VM instance
     * log entries from all projects in the sink's parent. To only export entries
     * from certain child projects, filter on the project part of the log name:
     *     logName:("projects/test-project1/" OR "projects/test-project2/") AND
     *     resource.type=gce_instance
     * </pre>
     *
     * <code>bool include_children = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return This builder for chaining.
     */
    public Builder clearIncludeChildren() {
      copyOnWrite();
      instance.clearIncludeChildren();
      return this;
    }

    /**
     * <pre>
     * Optional. Options that affect sinks exporting data to BigQuery.
     * </pre>
     *
     * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public boolean hasBigqueryOptions() {
      return instance.hasBigqueryOptions();
    }
    /**
     * <pre>
     * Optional. Options that affect sinks exporting data to BigQuery.
     * </pre>
     *
     * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    @java.lang.Override
    public com.google.logging.v2.BigQueryOptions getBigqueryOptions() {
      return instance.getBigqueryOptions();
    }
    /**
     * <pre>
     * Optional. Options that affect sinks exporting data to BigQuery.
     * </pre>
     *
     * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder setBigqueryOptions(com.google.logging.v2.BigQueryOptions value) {
      copyOnWrite();
      instance.setBigqueryOptions(value);
      return this;
    }
    /**
     * <pre>
     * Optional. Options that affect sinks exporting data to BigQuery.
     * </pre>
     *
     * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder setBigqueryOptions(
        com.google.logging.v2.BigQueryOptions.Builder builderForValue) {
      copyOnWrite();
      instance.setBigqueryOptions(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Optional. Options that affect sinks exporting data to BigQuery.
     * </pre>
     *
     * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder mergeBigqueryOptions(com.google.logging.v2.BigQueryOptions value) {
      copyOnWrite();
      instance.mergeBigqueryOptions(value);
      return this;
    }
    /**
     * <pre>
     * Optional. Options that affect sinks exporting data to BigQuery.
     * </pre>
     *
     * <code>.google.logging.v2.BigQueryOptions bigquery_options = 12 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    public Builder clearBigqueryOptions() {
      copyOnWrite();
      instance.clearBigqueryOptions();
      return this;
    }

    /**
     * <pre>
     * Output only. The creation timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    @java.lang.Override
    public boolean hasCreateTime() {
      return instance.hasCreateTime();
    }
    /**
     * <pre>
     * Output only. The creation timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getCreateTime() {
      return instance.getCreateTime();
    }
    /**
     * <pre>
     * Output only. The creation timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder setCreateTime(com.google.protobuf.Timestamp value) {
      copyOnWrite();
      instance.setCreateTime(value);
      return this;
      }
    /**
     * <pre>
     * Output only. The creation timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder setCreateTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      copyOnWrite();
      instance.setCreateTime(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Output only. The creation timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
      copyOnWrite();
      instance.mergeCreateTime(value);
      return this;
    }
    /**
     * <pre>
     * Output only. The creation timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp create_time = 13 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder clearCreateTime() {  copyOnWrite();
      instance.clearCreateTime();
      return this;
    }

    /**
     * <pre>
     * Output only. The last update timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    @java.lang.Override
    public boolean hasUpdateTime() {
      return instance.hasUpdateTime();
    }
    /**
     * <pre>
     * Output only. The last update timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    @java.lang.Override
    public com.google.protobuf.Timestamp getUpdateTime() {
      return instance.getUpdateTime();
    }
    /**
     * <pre>
     * Output only. The last update timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder setUpdateTime(com.google.protobuf.Timestamp value) {
      copyOnWrite();
      instance.setUpdateTime(value);
      return this;
      }
    /**
     * <pre>
     * Output only. The last update timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder setUpdateTime(
        com.google.protobuf.Timestamp.Builder builderForValue) {
      copyOnWrite();
      instance.setUpdateTime(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Output only. The last update timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) {
      copyOnWrite();
      instance.mergeUpdateTime(value);
      return this;
    }
    /**
     * <pre>
     * Output only. The last update timestamp of the sink.
     * This field may not be present for older sinks.
     * </pre>
     *
     * <code>.google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    public Builder clearUpdateTime() {  copyOnWrite();
      instance.clearUpdateTime();
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.logging.v2.LogSink)
  }
  @java.lang.Override
  @java.lang.SuppressWarnings({"unchecked", "fallthrough"})
  protected final java.lang.Object dynamicMethod(
      com.google.protobuf.GeneratedMessageLite.MethodToInvoke method,
      java.lang.Object arg0, java.lang.Object arg1) {
    switch (method) {
      case NEW_MUTABLE_INSTANCE: {
        return new com.google.logging.v2.LogSink();
      }
      case NEW_BUILDER: {
        return new Builder();
      }
      case BUILD_MESSAGE_INFO: {
          java.lang.Object[] objects = new java.lang.Object[] {
            "options_",
            "optionsCase_",
            "name_",
            "destination_",
            "filter_",
            "outputVersionFormat_",
            "writerIdentity_",
            "includeChildren_",
            com.google.logging.v2.BigQueryOptions.class,
            "createTime_",
            "updateTime_",
            "exclusions_",
            com.google.logging.v2.LogExclusion.class,
            "description_",
            "disabled_",
          };
          java.lang.String info =
              "\u0000\f\u0001\u0000\u0001\u0013\f\u0000\u0001\u0000\u0001\u0208\u0003\u0208\u0005" +
              "\u0208\u0006\f\b\u0208\t\u0007\f<\u0000\r\t\u000e\t\u0010\u001b\u0012\u0208\u0013" +
              "\u0007";
          return newMessageInfo(DEFAULT_INSTANCE, info, objects);
      }
      // fall through
      case GET_DEFAULT_INSTANCE: {
        return DEFAULT_INSTANCE;
      }
      case GET_PARSER: {
        com.google.protobuf.Parser<com.google.logging.v2.LogSink> parser = PARSER;
        if (parser == null) {
          synchronized (com.google.logging.v2.LogSink.class) {
            parser = PARSER;
            if (parser == null) {
              parser =
                  new DefaultInstanceBasedParser<com.google.logging.v2.LogSink>(
                      DEFAULT_INSTANCE);
              PARSER = parser;
            }
          }
        }
        return parser;
    }
    case GET_MEMOIZED_IS_INITIALIZED: {
      return (byte) 1;
    }
    case SET_MEMOIZED_IS_INITIALIZED: {
      return null;
    }
    }
    throw new UnsupportedOperationException();
  }


  // @@protoc_insertion_point(class_scope:google.logging.v2.LogSink)
  private static final com.google.logging.v2.LogSink DEFAULT_INSTANCE;
  static {
    LogSink defaultInstance = new LogSink();
    // New instances are implicitly immutable so no need to make
    // immutable.
    DEFAULT_INSTANCE = defaultInstance;
    com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
      LogSink.class, defaultInstance);
  }

  public static com.google.logging.v2.LogSink getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static volatile com.google.protobuf.Parser<LogSink> PARSER;

  public static com.google.protobuf.Parser<LogSink> parser() {
    return DEFAULT_INSTANCE.getParserForType();
  }
}

