// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/api/monitoring.proto

package com.google.api;

/**
 * <pre>
 * Monitoring configuration of the service.
 * The example below shows how to configure monitored resources and metrics
 * for monitoring. In the example, a monitored resource and two metrics are
 * defined. The `library.googleapis.com/book/returned_count` metric is sent
 * to both producer and consumer projects, whereas the
 * `library.googleapis.com/book/num_overdue` metric is only sent to the
 * consumer project.
 *     monitored_resources:
 *     - type: library.googleapis.com/Branch
 *       display_name: "Library Branch"
 *       description: "A branch of a library."
 *       launch_stage: GA
 *       labels:
 *       - key: resource_container
 *         description: "The Cloud container (ie. project id) for the Branch."
 *       - key: location
 *         description: "The location of the library branch."
 *       - key: branch_id
 *         description: "The id of the branch."
 *     metrics:
 *     - name: library.googleapis.com/book/returned_count
 *       display_name: "Books Returned"
 *       description: "The count of books that have been returned."
 *       launch_stage: GA
 *       metric_kind: DELTA
 *       value_type: INT64
 *       unit: "1"
 *       labels:
 *       - key: customer_id
 *         description: "The id of the customer."
 *     - name: library.googleapis.com/book/num_overdue
 *       display_name: "Books Overdue"
 *       description: "The current number of overdue books."
 *       launch_stage: GA
 *       metric_kind: GAUGE
 *       value_type: INT64
 *       unit: "1"
 *       labels:
 *       - key: customer_id
 *         description: "The id of the customer."
 *     monitoring:
 *       producer_destinations:
 *       - monitored_resource: library.googleapis.com/Branch
 *         metrics:
 *         - library.googleapis.com/book/returned_count
 *       consumer_destinations:
 *       - monitored_resource: library.googleapis.com/Branch
 *         metrics:
 *         - library.googleapis.com/book/returned_count
 *         - library.googleapis.com/book/num_overdue
 * </pre>
 *
 * Protobuf type {@code google.api.Monitoring}
 */
public  final class Monitoring extends
    com.google.protobuf.GeneratedMessageLite<
        Monitoring, Monitoring.Builder> implements
    // @@protoc_insertion_point(message_implements:google.api.Monitoring)
    MonitoringOrBuilder {
  private Monitoring() {
    producerDestinations_ = emptyProtobufList();
    consumerDestinations_ = emptyProtobufList();
  }
  public interface MonitoringDestinationOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.api.Monitoring.MonitoringDestination)
      com.google.protobuf.MessageLiteOrBuilder {

    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     * @return The monitoredResource.
     */
    java.lang.String getMonitoredResource();
    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     * @return The bytes for monitoredResource.
     */
    com.google.protobuf.ByteString
        getMonitoredResourceBytes();

    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @return A list containing the metrics.
     */
    java.util.List<java.lang.String>
        getMetricsList();
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @return The count of metrics.
     */
    int getMetricsCount();
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param index The index of the element to return.
     * @return The metrics at the given index.
     */
    java.lang.String getMetrics(int index);
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param index The index of the element to return.
     * @return The metrics at the given index.
     */
    com.google.protobuf.ByteString
        getMetricsBytes(int index);
  }
  /**
   * <pre>
   * Configuration of a specific monitoring destination (the producer project
   * or the consumer project).
   * </pre>
   *
   * Protobuf type {@code google.api.Monitoring.MonitoringDestination}
   */
  public  static final class MonitoringDestination extends
      com.google.protobuf.GeneratedMessageLite<
          MonitoringDestination, MonitoringDestination.Builder> implements
      // @@protoc_insertion_point(message_implements:google.api.Monitoring.MonitoringDestination)
      MonitoringDestinationOrBuilder {
    private MonitoringDestination() {
      monitoredResource_ = "";
      metrics_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
    }
    public static final int MONITORED_RESOURCE_FIELD_NUMBER = 1;
    private java.lang.String monitoredResource_;
    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     * @return The monitoredResource.
     */
    @java.lang.Override
    public java.lang.String getMonitoredResource() {
      return monitoredResource_;
    }
    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     * @return The bytes for monitoredResource.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getMonitoredResourceBytes() {
      return com.google.protobuf.ByteString.copyFromUtf8(monitoredResource_);
    }
    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     * @param value The monitoredResource to set.
     */
    private void setMonitoredResource(
        java.lang.String value) {
      value.getClass();
  
      monitoredResource_ = value;
    }
    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     */
    private void clearMonitoredResource() {
      
      monitoredResource_ = getDefaultInstance().getMonitoredResource();
    }
    /**
     * <pre>
     * The monitored resource type. The type must be defined in
     * [Service.monitored_resources][google.api.Service.monitored_resources] section.
     * </pre>
     *
     * <code>string monitored_resource = 1;</code>
     * @param value The bytes for monitoredResource to set.
     */
    private void setMonitoredResourceBytes(
        com.google.protobuf.ByteString value) {
      checkByteStringIsUtf8(value);
      monitoredResource_ = value.toStringUtf8();
      
    }

    public static final int METRICS_FIELD_NUMBER = 2;
    private com.google.protobuf.Internal.ProtobufList<java.lang.String> metrics_;
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @return A list containing the metrics.
     */
    @java.lang.Override
    public java.util.List<java.lang.String> getMetricsList() {
      return metrics_;
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @return The count of metrics.
     */
    @java.lang.Override
    public int getMetricsCount() {
      return metrics_.size();
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param index The index of the element to return.
     * @return The metrics at the given index.
     */
    @java.lang.Override
    public java.lang.String getMetrics(int index) {
      return metrics_.get(index);
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param index The index of the value to return.
     * @return The bytes of the metrics at the given index.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getMetricsBytes(int index) {
      return com.google.protobuf.ByteString.copyFromUtf8(
          metrics_.get(index));
    }
    private void ensureMetricsIsMutable() {
      com.google.protobuf.Internal.ProtobufList<java.lang.String> tmp =
          metrics_;  if (!tmp.isModifiable()) {
        metrics_ =
            com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
       }
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param index The index to set the value at.
     * @param value The metrics to set.
     */
    private void setMetrics(
        int index, java.lang.String value) {
      value.getClass();
  ensureMetricsIsMutable();
      metrics_.set(index, value);
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param value The metrics to add.
     */
    private void addMetrics(
        java.lang.String value) {
      value.getClass();
  ensureMetricsIsMutable();
      metrics_.add(value);
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param values The metrics to add.
     */
    private void addAllMetrics(
        java.lang.Iterable<java.lang.String> values) {
      ensureMetricsIsMutable();
      com.google.protobuf.AbstractMessageLite.addAll(
          values, metrics_);
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     */
    private void clearMetrics() {
      metrics_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
    }
    /**
     * <pre>
     * Types of the metrics to report to this monitoring destination.
     * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
     * </pre>
     *
     * <code>repeated string metrics = 2;</code>
     * @param value The bytes of the metrics to add.
     */
    private void addMetricsBytes(
        com.google.protobuf.ByteString value) {
      checkByteStringIsUtf8(value);
      ensureMetricsIsMutable();
      metrics_.add(value.toStringUtf8());
    }

    public static com.google.api.Monitoring.MonitoringDestination parseFrom(
        java.nio.ByteBuffer data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, data);
    }
    public static com.google.api.Monitoring.MonitoringDestination 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.api.Monitoring.MonitoringDestination parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, data);
    }
    public static com.google.api.Monitoring.MonitoringDestination 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.api.Monitoring.MonitoringDestination parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, data);
    }
    public static com.google.api.Monitoring.MonitoringDestination 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.api.Monitoring.MonitoringDestination parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, input);
    }
    public static com.google.api.Monitoring.MonitoringDestination 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.api.Monitoring.MonitoringDestination parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return parseDelimitedFrom(DEFAULT_INSTANCE, input);
    }
    public static com.google.api.Monitoring.MonitoringDestination parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
    }
    public static com.google.api.Monitoring.MonitoringDestination parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageLite.parseFrom(
          DEFAULT_INSTANCE, input);
    }
    public static com.google.api.Monitoring.MonitoringDestination 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.api.Monitoring.MonitoringDestination prototype) {
      return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
    }

    /**
     * <pre>
     * Configuration of a specific monitoring destination (the producer project
     * or the consumer project).
     * </pre>
     *
     * Protobuf type {@code google.api.Monitoring.MonitoringDestination}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageLite.Builder<
          com.google.api.Monitoring.MonitoringDestination, Builder> implements
        // @@protoc_insertion_point(builder_implements:google.api.Monitoring.MonitoringDestination)
        com.google.api.Monitoring.MonitoringDestinationOrBuilder {
      // Construct using com.google.api.Monitoring.MonitoringDestination.newBuilder()
      private Builder() {
        super(DEFAULT_INSTANCE);
      }


      /**
       * <pre>
       * The monitored resource type. The type must be defined in
       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
       * </pre>
       *
       * <code>string monitored_resource = 1;</code>
       * @return The monitoredResource.
       */
      @java.lang.Override
      public java.lang.String getMonitoredResource() {
        return instance.getMonitoredResource();
      }
      /**
       * <pre>
       * The monitored resource type. The type must be defined in
       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
       * </pre>
       *
       * <code>string monitored_resource = 1;</code>
       * @return The bytes for monitoredResource.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString
          getMonitoredResourceBytes() {
        return instance.getMonitoredResourceBytes();
      }
      /**
       * <pre>
       * The monitored resource type. The type must be defined in
       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
       * </pre>
       *
       * <code>string monitored_resource = 1;</code>
       * @param value The monitoredResource to set.
       * @return This builder for chaining.
       */
      public Builder setMonitoredResource(
          java.lang.String value) {
        copyOnWrite();
        instance.setMonitoredResource(value);
        return this;
      }
      /**
       * <pre>
       * The monitored resource type. The type must be defined in
       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
       * </pre>
       *
       * <code>string monitored_resource = 1;</code>
       * @return This builder for chaining.
       */
      public Builder clearMonitoredResource() {
        copyOnWrite();
        instance.clearMonitoredResource();
        return this;
      }
      /**
       * <pre>
       * The monitored resource type. The type must be defined in
       * [Service.monitored_resources][google.api.Service.monitored_resources] section.
       * </pre>
       *
       * <code>string monitored_resource = 1;</code>
       * @param value The bytes for monitoredResource to set.
       * @return This builder for chaining.
       */
      public Builder setMonitoredResourceBytes(
          com.google.protobuf.ByteString value) {
        copyOnWrite();
        instance.setMonitoredResourceBytes(value);
        return this;
      }

      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @return A list containing the metrics.
       */
      @java.lang.Override
      public java.util.List<java.lang.String>
          getMetricsList() {
        return java.util.Collections.unmodifiableList(
            instance.getMetricsList());
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @return The count of metrics.
       */
      @java.lang.Override
      public int getMetricsCount() {
        return instance.getMetricsCount();
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @param index The index of the element to return.
       * @return The metrics at the given index.
       */
      @java.lang.Override
      public java.lang.String getMetrics(int index) {
        return instance.getMetrics(index);
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @param index The index of the value to return.
       * @return The bytes of the metrics at the given index.
       */
      @java.lang.Override
      public com.google.protobuf.ByteString
          getMetricsBytes(int index) {
        return instance.getMetricsBytes(index);
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @param index The index to set the value at.
       * @param value The metrics to set.
       * @return This builder for chaining.
       */
      public Builder setMetrics(
          int index, java.lang.String value) {
        copyOnWrite();
        instance.setMetrics(index, value);
        return this;
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @param value The metrics to add.
       * @return This builder for chaining.
       */
      public Builder addMetrics(
          java.lang.String value) {
        copyOnWrite();
        instance.addMetrics(value);
        return this;
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @param values The metrics to add.
       * @return This builder for chaining.
       */
      public Builder addAllMetrics(
          java.lang.Iterable<java.lang.String> values) {
        copyOnWrite();
        instance.addAllMetrics(values);
        return this;
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @return This builder for chaining.
       */
      public Builder clearMetrics() {
        copyOnWrite();
        instance.clearMetrics();
        return this;
      }
      /**
       * <pre>
       * Types of the metrics to report to this monitoring destination.
       * Each type must be defined in [Service.metrics][google.api.Service.metrics] section.
       * </pre>
       *
       * <code>repeated string metrics = 2;</code>
       * @param value The bytes of the metrics to add.
       * @return This builder for chaining.
       */
      public Builder addMetricsBytes(
          com.google.protobuf.ByteString value) {
        copyOnWrite();
        instance.addMetricsBytes(value);
        return this;
      }

      // @@protoc_insertion_point(builder_scope:google.api.Monitoring.MonitoringDestination)
    }
    @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.api.Monitoring.MonitoringDestination();
        }
        case NEW_BUILDER: {
          return new Builder();
        }
        case BUILD_MESSAGE_INFO: {
            java.lang.Object[] objects = new java.lang.Object[] {
              "monitoredResource_",
              "metrics_",
            };
            java.lang.String info =
                "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0001\u0000\u0001\u0208\u0002\u021a" +
                "";
            return newMessageInfo(DEFAULT_INSTANCE, info, objects);
        }
        // fall through
        case GET_DEFAULT_INSTANCE: {
          return DEFAULT_INSTANCE;
        }
        case GET_PARSER: {
          com.google.protobuf.Parser<com.google.api.Monitoring.MonitoringDestination> parser = PARSER;
          if (parser == null) {
            synchronized (com.google.api.Monitoring.MonitoringDestination.class) {
              parser = PARSER;
              if (parser == null) {
                parser =
                    new DefaultInstanceBasedParser<com.google.api.Monitoring.MonitoringDestination>(
                        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.api.Monitoring.MonitoringDestination)
    private static final com.google.api.Monitoring.MonitoringDestination DEFAULT_INSTANCE;
    static {
      MonitoringDestination defaultInstance = new MonitoringDestination();
      // New instances are implicitly immutable so no need to make
      // immutable.
      DEFAULT_INSTANCE = defaultInstance;
      com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
        MonitoringDestination.class, defaultInstance);
    }

    public static com.google.api.Monitoring.MonitoringDestination getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

  public static final int PRODUCER_DESTINATIONS_FIELD_NUMBER = 1;
  private com.google.protobuf.Internal.ProtobufList<com.google.api.Monitoring.MonitoringDestination> producerDestinations_;
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.api.Monitoring.MonitoringDestination> getProducerDestinationsList() {
    return producerDestinations_;
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  public java.util.List<? extends com.google.api.Monitoring.MonitoringDestinationOrBuilder> 
      getProducerDestinationsOrBuilderList() {
    return producerDestinations_;
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  @java.lang.Override
  public int getProducerDestinationsCount() {
    return producerDestinations_.size();
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  @java.lang.Override
  public com.google.api.Monitoring.MonitoringDestination getProducerDestinations(int index) {
    return producerDestinations_.get(index);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  public com.google.api.Monitoring.MonitoringDestinationOrBuilder getProducerDestinationsOrBuilder(
      int index) {
    return producerDestinations_.get(index);
  }
  private void ensureProducerDestinationsIsMutable() {
    com.google.protobuf.Internal.ProtobufList<com.google.api.Monitoring.MonitoringDestination> tmp = producerDestinations_;
    if (!tmp.isModifiable()) {
      producerDestinations_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }

  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  private void setProducerDestinations(
      int index, com.google.api.Monitoring.MonitoringDestination value) {
    value.getClass();
  ensureProducerDestinationsIsMutable();
    producerDestinations_.set(index, value);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  private void addProducerDestinations(com.google.api.Monitoring.MonitoringDestination value) {
    value.getClass();
  ensureProducerDestinationsIsMutable();
    producerDestinations_.add(value);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  private void addProducerDestinations(
      int index, com.google.api.Monitoring.MonitoringDestination value) {
    value.getClass();
  ensureProducerDestinationsIsMutable();
    producerDestinations_.add(index, value);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  private void addAllProducerDestinations(
      java.lang.Iterable<? extends com.google.api.Monitoring.MonitoringDestination> values) {
    ensureProducerDestinationsIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, producerDestinations_);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  private void clearProducerDestinations() {
    producerDestinations_ = emptyProtobufList();
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the producer project.
   * There can be multiple producer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
   */
  private void removeProducerDestinations(int index) {
    ensureProducerDestinationsIsMutable();
    producerDestinations_.remove(index);
  }

  public static final int CONSUMER_DESTINATIONS_FIELD_NUMBER = 2;
  private com.google.protobuf.Internal.ProtobufList<com.google.api.Monitoring.MonitoringDestination> consumerDestinations_;
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.api.Monitoring.MonitoringDestination> getConsumerDestinationsList() {
    return consumerDestinations_;
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  public java.util.List<? extends com.google.api.Monitoring.MonitoringDestinationOrBuilder> 
      getConsumerDestinationsOrBuilderList() {
    return consumerDestinations_;
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  @java.lang.Override
  public int getConsumerDestinationsCount() {
    return consumerDestinations_.size();
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  @java.lang.Override
  public com.google.api.Monitoring.MonitoringDestination getConsumerDestinations(int index) {
    return consumerDestinations_.get(index);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  public com.google.api.Monitoring.MonitoringDestinationOrBuilder getConsumerDestinationsOrBuilder(
      int index) {
    return consumerDestinations_.get(index);
  }
  private void ensureConsumerDestinationsIsMutable() {
    com.google.protobuf.Internal.ProtobufList<com.google.api.Monitoring.MonitoringDestination> tmp = consumerDestinations_;
    if (!tmp.isModifiable()) {
      consumerDestinations_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }

  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  private void setConsumerDestinations(
      int index, com.google.api.Monitoring.MonitoringDestination value) {
    value.getClass();
  ensureConsumerDestinationsIsMutable();
    consumerDestinations_.set(index, value);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  private void addConsumerDestinations(com.google.api.Monitoring.MonitoringDestination value) {
    value.getClass();
  ensureConsumerDestinationsIsMutable();
    consumerDestinations_.add(value);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  private void addConsumerDestinations(
      int index, com.google.api.Monitoring.MonitoringDestination value) {
    value.getClass();
  ensureConsumerDestinationsIsMutable();
    consumerDestinations_.add(index, value);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  private void addAllConsumerDestinations(
      java.lang.Iterable<? extends com.google.api.Monitoring.MonitoringDestination> values) {
    ensureConsumerDestinationsIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, consumerDestinations_);
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  private void clearConsumerDestinations() {
    consumerDestinations_ = emptyProtobufList();
  }
  /**
   * <pre>
   * Monitoring configurations for sending metrics to the consumer project.
   * There can be multiple consumer destinations. A monitored resource type may
   * appear in multiple monitoring destinations if different aggregations are
   * needed for different sets of metrics associated with that monitored
   * resource type. A monitored resource and metric pair may only be used once
   * in the Monitoring configuration.
   * </pre>
   *
   * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
   */
  private void removeConsumerDestinations(int index) {
    ensureConsumerDestinationsIsMutable();
    consumerDestinations_.remove(index);
  }

  public static com.google.api.Monitoring parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.api.Monitoring 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.api.Monitoring parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.api.Monitoring 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.api.Monitoring parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, data);
  }
  public static com.google.api.Monitoring 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.api.Monitoring parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.api.Monitoring 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.api.Monitoring parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input);
  }
  public static com.google.api.Monitoring parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return parseDelimitedFrom(DEFAULT_INSTANCE, input, extensionRegistry);
  }
  public static com.google.api.Monitoring parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageLite.parseFrom(
        DEFAULT_INSTANCE, input);
  }
  public static com.google.api.Monitoring 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.api.Monitoring prototype) {
    return (Builder) DEFAULT_INSTANCE.createBuilder(prototype);
  }

  /**
   * <pre>
   * Monitoring configuration of the service.
   * The example below shows how to configure monitored resources and metrics
   * for monitoring. In the example, a monitored resource and two metrics are
   * defined. The `library.googleapis.com/book/returned_count` metric is sent
   * to both producer and consumer projects, whereas the
   * `library.googleapis.com/book/num_overdue` metric is only sent to the
   * consumer project.
   *     monitored_resources:
   *     - type: library.googleapis.com/Branch
   *       display_name: "Library Branch"
   *       description: "A branch of a library."
   *       launch_stage: GA
   *       labels:
   *       - key: resource_container
   *         description: "The Cloud container (ie. project id) for the Branch."
   *       - key: location
   *         description: "The location of the library branch."
   *       - key: branch_id
   *         description: "The id of the branch."
   *     metrics:
   *     - name: library.googleapis.com/book/returned_count
   *       display_name: "Books Returned"
   *       description: "The count of books that have been returned."
   *       launch_stage: GA
   *       metric_kind: DELTA
   *       value_type: INT64
   *       unit: "1"
   *       labels:
   *       - key: customer_id
   *         description: "The id of the customer."
   *     - name: library.googleapis.com/book/num_overdue
   *       display_name: "Books Overdue"
   *       description: "The current number of overdue books."
   *       launch_stage: GA
   *       metric_kind: GAUGE
   *       value_type: INT64
   *       unit: "1"
   *       labels:
   *       - key: customer_id
   *         description: "The id of the customer."
   *     monitoring:
   *       producer_destinations:
   *       - monitored_resource: library.googleapis.com/Branch
   *         metrics:
   *         - library.googleapis.com/book/returned_count
   *       consumer_destinations:
   *       - monitored_resource: library.googleapis.com/Branch
   *         metrics:
   *         - library.googleapis.com/book/returned_count
   *         - library.googleapis.com/book/num_overdue
   * </pre>
   *
   * Protobuf type {@code google.api.Monitoring}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.api.Monitoring, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.api.Monitoring)
      com.google.api.MonitoringOrBuilder {
    // Construct using com.google.api.Monitoring.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }


    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.api.Monitoring.MonitoringDestination> getProducerDestinationsList() {
      return java.util.Collections.unmodifiableList(
          instance.getProducerDestinationsList());
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    @java.lang.Override
    public int getProducerDestinationsCount() {
      return instance.getProducerDestinationsCount();
    }/**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    @java.lang.Override
    public com.google.api.Monitoring.MonitoringDestination getProducerDestinations(int index) {
      return instance.getProducerDestinations(index);
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder setProducerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination value) {
      copyOnWrite();
      instance.setProducerDestinations(index, value);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder setProducerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination.Builder builderForValue) {
      copyOnWrite();
      instance.setProducerDestinations(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder addProducerDestinations(com.google.api.Monitoring.MonitoringDestination value) {
      copyOnWrite();
      instance.addProducerDestinations(value);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder addProducerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination value) {
      copyOnWrite();
      instance.addProducerDestinations(index, value);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder addProducerDestinations(
        com.google.api.Monitoring.MonitoringDestination.Builder builderForValue) {
      copyOnWrite();
      instance.addProducerDestinations(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder addProducerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination.Builder builderForValue) {
      copyOnWrite();
      instance.addProducerDestinations(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder addAllProducerDestinations(
        java.lang.Iterable<? extends com.google.api.Monitoring.MonitoringDestination> values) {
      copyOnWrite();
      instance.addAllProducerDestinations(values);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder clearProducerDestinations() {
      copyOnWrite();
      instance.clearProducerDestinations();
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the producer project.
     * There can be multiple producer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;</code>
     */
    public Builder removeProducerDestinations(int index) {
      copyOnWrite();
      instance.removeProducerDestinations(index);
      return this;
    }

    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.api.Monitoring.MonitoringDestination> getConsumerDestinationsList() {
      return java.util.Collections.unmodifiableList(
          instance.getConsumerDestinationsList());
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    @java.lang.Override
    public int getConsumerDestinationsCount() {
      return instance.getConsumerDestinationsCount();
    }/**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    @java.lang.Override
    public com.google.api.Monitoring.MonitoringDestination getConsumerDestinations(int index) {
      return instance.getConsumerDestinations(index);
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder setConsumerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination value) {
      copyOnWrite();
      instance.setConsumerDestinations(index, value);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder setConsumerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination.Builder builderForValue) {
      copyOnWrite();
      instance.setConsumerDestinations(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder addConsumerDestinations(com.google.api.Monitoring.MonitoringDestination value) {
      copyOnWrite();
      instance.addConsumerDestinations(value);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder addConsumerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination value) {
      copyOnWrite();
      instance.addConsumerDestinations(index, value);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder addConsumerDestinations(
        com.google.api.Monitoring.MonitoringDestination.Builder builderForValue) {
      copyOnWrite();
      instance.addConsumerDestinations(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder addConsumerDestinations(
        int index, com.google.api.Monitoring.MonitoringDestination.Builder builderForValue) {
      copyOnWrite();
      instance.addConsumerDestinations(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder addAllConsumerDestinations(
        java.lang.Iterable<? extends com.google.api.Monitoring.MonitoringDestination> values) {
      copyOnWrite();
      instance.addAllConsumerDestinations(values);
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder clearConsumerDestinations() {
      copyOnWrite();
      instance.clearConsumerDestinations();
      return this;
    }
    /**
     * <pre>
     * Monitoring configurations for sending metrics to the consumer project.
     * There can be multiple consumer destinations. A monitored resource type may
     * appear in multiple monitoring destinations if different aggregations are
     * needed for different sets of metrics associated with that monitored
     * resource type. A monitored resource and metric pair may only be used once
     * in the Monitoring configuration.
     * </pre>
     *
     * <code>repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;</code>
     */
    public Builder removeConsumerDestinations(int index) {
      copyOnWrite();
      instance.removeConsumerDestinations(index);
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.api.Monitoring)
  }
  @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.api.Monitoring();
      }
      case NEW_BUILDER: {
        return new Builder();
      }
      case BUILD_MESSAGE_INFO: {
          java.lang.Object[] objects = new java.lang.Object[] {
            "producerDestinations_",
            com.google.api.Monitoring.MonitoringDestination.class,
            "consumerDestinations_",
            com.google.api.Monitoring.MonitoringDestination.class,
          };
          java.lang.String info =
              "\u0000\u0002\u0000\u0000\u0001\u0002\u0002\u0000\u0002\u0000\u0001\u001b\u0002\u001b" +
              "";
          return newMessageInfo(DEFAULT_INSTANCE, info, objects);
      }
      // fall through
      case GET_DEFAULT_INSTANCE: {
        return DEFAULT_INSTANCE;
      }
      case GET_PARSER: {
        com.google.protobuf.Parser<com.google.api.Monitoring> parser = PARSER;
        if (parser == null) {
          synchronized (com.google.api.Monitoring.class) {
            parser = PARSER;
            if (parser == null) {
              parser =
                  new DefaultInstanceBasedParser<com.google.api.Monitoring>(
                      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.api.Monitoring)
  private static final com.google.api.Monitoring DEFAULT_INSTANCE;
  static {
    Monitoring defaultInstance = new Monitoring();
    // New instances are implicitly immutable so no need to make
    // immutable.
    DEFAULT_INSTANCE = defaultInstance;
    com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
      Monitoring.class, defaultInstance);
  }

  public static com.google.api.Monitoring getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

