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

package com.google.api;

/**
 * <pre>
 * Defines a metric type and its schema. Once a metric descriptor is created,
 * deleting or altering it stops data collection and makes the metric type's
 * existing data unusable.
 * </pre>
 *
 * Protobuf type {@code google.api.MetricDescriptor}
 */
public  final class MetricDescriptor extends
    com.google.protobuf.GeneratedMessageLite<
        MetricDescriptor, MetricDescriptor.Builder> implements
    // @@protoc_insertion_point(message_implements:google.api.MetricDescriptor)
    MetricDescriptorOrBuilder {
  private MetricDescriptor() {
    name_ = "";
    type_ = "";
    labels_ = emptyProtobufList();
    unit_ = "";
    description_ = "";
    displayName_ = "";
    monitoredResourceTypes_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
  }
  /**
   * <pre>
   * The kind of measurement. It describes how the data is reported.
   * For information on setting the start time and end time based on
   * the MetricKind, see [TimeInterval][google.monitoring.v3.TimeInterval].
   * </pre>
   *
   * Protobuf enum {@code google.api.MetricDescriptor.MetricKind}
   */
  public enum MetricKind
      implements com.google.protobuf.Internal.EnumLite {
    /**
     * <pre>
     * Do not use this default value.
     * </pre>
     *
     * <code>METRIC_KIND_UNSPECIFIED = 0;</code>
     */
    METRIC_KIND_UNSPECIFIED(0),
    /**
     * <pre>
     * An instantaneous measurement of a value.
     * </pre>
     *
     * <code>GAUGE = 1;</code>
     */
    GAUGE(1),
    /**
     * <pre>
     * The change in a value during a time interval.
     * </pre>
     *
     * <code>DELTA = 2;</code>
     */
    DELTA(2),
    /**
     * <pre>
     * A value accumulated over a time interval.  Cumulative
     * measurements in a time series should have the same start time
     * and increasing end times, until an event resets the cumulative
     * value to zero and sets a new start time for the following
     * points.
     * </pre>
     *
     * <code>CUMULATIVE = 3;</code>
     */
    CUMULATIVE(3),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Do not use this default value.
     * </pre>
     *
     * <code>METRIC_KIND_UNSPECIFIED = 0;</code>
     */
    public static final int METRIC_KIND_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * An instantaneous measurement of a value.
     * </pre>
     *
     * <code>GAUGE = 1;</code>
     */
    public static final int GAUGE_VALUE = 1;
    /**
     * <pre>
     * The change in a value during a time interval.
     * </pre>
     *
     * <code>DELTA = 2;</code>
     */
    public static final int DELTA_VALUE = 2;
    /**
     * <pre>
     * A value accumulated over a time interval.  Cumulative
     * measurements in a time series should have the same start time
     * and increasing end times, until an event resets the cumulative
     * value to zero and sets a new start time for the following
     * points.
     * </pre>
     *
     * <code>CUMULATIVE = 3;</code>
     */
    public static final int CUMULATIVE_VALUE = 3;


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

    public static MetricKind forNumber(int value) {
      switch (value) {
        case 0: return METRIC_KIND_UNSPECIFIED;
        case 1: return GAUGE;
        case 2: return DELTA;
        case 3: return CUMULATIVE;
        default: return null;
      }
    }

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

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

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

    private final int value;

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

    // @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.MetricKind)
  }

  /**
   * <pre>
   * The value type of a metric.
   * </pre>
   *
   * Protobuf enum {@code google.api.MetricDescriptor.ValueType}
   */
  public enum ValueType
      implements com.google.protobuf.Internal.EnumLite {
    /**
     * <pre>
     * Do not use this default value.
     * </pre>
     *
     * <code>VALUE_TYPE_UNSPECIFIED = 0;</code>
     */
    VALUE_TYPE_UNSPECIFIED(0),
    /**
     * <pre>
     * The value is a boolean.
     * This value type can be used only if the metric kind is `GAUGE`.
     * </pre>
     *
     * <code>BOOL = 1;</code>
     */
    BOOL(1),
    /**
     * <pre>
     * The value is a signed 64-bit integer.
     * </pre>
     *
     * <code>INT64 = 2;</code>
     */
    INT64(2),
    /**
     * <pre>
     * The value is a double precision floating point number.
     * </pre>
     *
     * <code>DOUBLE = 3;</code>
     */
    DOUBLE(3),
    /**
     * <pre>
     * The value is a text string.
     * This value type can be used only if the metric kind is `GAUGE`.
     * </pre>
     *
     * <code>STRING = 4;</code>
     */
    STRING(4),
    /**
     * <pre>
     * The value is a [`Distribution`][google.api.Distribution].
     * </pre>
     *
     * <code>DISTRIBUTION = 5;</code>
     */
    DISTRIBUTION(5),
    /**
     * <pre>
     * The value is money.
     * </pre>
     *
     * <code>MONEY = 6;</code>
     */
    MONEY(6),
    UNRECOGNIZED(-1),
    ;

    /**
     * <pre>
     * Do not use this default value.
     * </pre>
     *
     * <code>VALUE_TYPE_UNSPECIFIED = 0;</code>
     */
    public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0;
    /**
     * <pre>
     * The value is a boolean.
     * This value type can be used only if the metric kind is `GAUGE`.
     * </pre>
     *
     * <code>BOOL = 1;</code>
     */
    public static final int BOOL_VALUE = 1;
    /**
     * <pre>
     * The value is a signed 64-bit integer.
     * </pre>
     *
     * <code>INT64 = 2;</code>
     */
    public static final int INT64_VALUE = 2;
    /**
     * <pre>
     * The value is a double precision floating point number.
     * </pre>
     *
     * <code>DOUBLE = 3;</code>
     */
    public static final int DOUBLE_VALUE = 3;
    /**
     * <pre>
     * The value is a text string.
     * This value type can be used only if the metric kind is `GAUGE`.
     * </pre>
     *
     * <code>STRING = 4;</code>
     */
    public static final int STRING_VALUE = 4;
    /**
     * <pre>
     * The value is a [`Distribution`][google.api.Distribution].
     * </pre>
     *
     * <code>DISTRIBUTION = 5;</code>
     */
    public static final int DISTRIBUTION_VALUE = 5;
    /**
     * <pre>
     * The value is money.
     * </pre>
     *
     * <code>MONEY = 6;</code>
     */
    public static final int MONEY_VALUE = 6;


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

    public static ValueType forNumber(int value) {
      switch (value) {
        case 0: return VALUE_TYPE_UNSPECIFIED;
        case 1: return BOOL;
        case 2: return INT64;
        case 3: return DOUBLE;
        case 4: return STRING;
        case 5: return DISTRIBUTION;
        case 6: return MONEY;
        default: return null;
      }
    }

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

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

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

    private final int value;

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

    // @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.ValueType)
  }

  public interface MetricDescriptorMetadataOrBuilder extends
      // @@protoc_insertion_point(interface_extends:google.api.MetricDescriptor.MetricDescriptorMetadata)
      com.google.protobuf.MessageLiteOrBuilder {

    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     * @return The enum numeric value on the wire for launchStage.
     */
    @java.lang.Deprecated int getLaunchStageValue();
    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     * @return The launchStage.
     */
    @java.lang.Deprecated com.google.api.LaunchStage getLaunchStage();

    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     * @return Whether the samplePeriod field is set.
     */
    boolean hasSamplePeriod();
    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     * @return The samplePeriod.
     */
    com.google.protobuf.Duration getSamplePeriod();

    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     * @return Whether the ingestDelay field is set.
     */
    boolean hasIngestDelay();
    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     * @return The ingestDelay.
     */
    com.google.protobuf.Duration getIngestDelay();
  }
  /**
   * <pre>
   * Additional annotations that can be used to guide the usage of a metric.
   * </pre>
   *
   * Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata}
   */
  public  static final class MetricDescriptorMetadata extends
      com.google.protobuf.GeneratedMessageLite<
          MetricDescriptorMetadata, MetricDescriptorMetadata.Builder> implements
      // @@protoc_insertion_point(message_implements:google.api.MetricDescriptor.MetricDescriptorMetadata)
      MetricDescriptorMetadataOrBuilder {
    private MetricDescriptorMetadata() {
    }
    public static final int LAUNCH_STAGE_FIELD_NUMBER = 1;
    private int launchStage_;
    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     * @return The enum numeric value on the wire for launchStage.
     */
    @java.lang.Override
    @java.lang.Deprecated public int getLaunchStageValue() {
      return launchStage_;
    }
    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     * @return The launchStage.
     */
    @java.lang.Override
    @java.lang.Deprecated public com.google.api.LaunchStage getLaunchStage() {
      com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_);
      return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     * @param value The enum numeric value on the wire for launchStage to set.
     */
    private void setLaunchStageValue(int value) {
        launchStage_ = value;
    }
    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     * @param value The launchStage to set.
     */
    private void setLaunchStage(com.google.api.LaunchStage value) {
      launchStage_ = value.getNumber();
      
    }
    /**
     * <pre>
     * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
     */
    private void clearLaunchStage() {
      
      launchStage_ = 0;
    }

    public static final int SAMPLE_PERIOD_FIELD_NUMBER = 2;
    private com.google.protobuf.Duration samplePeriod_;
    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     */
    @java.lang.Override
    public boolean hasSamplePeriod() {
      return samplePeriod_ != null;
    }
    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     */
    @java.lang.Override
    public com.google.protobuf.Duration getSamplePeriod() {
      return samplePeriod_ == null ? com.google.protobuf.Duration.getDefaultInstance() : samplePeriod_;
    }
    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     */
    private void setSamplePeriod(com.google.protobuf.Duration value) {
      value.getClass();
  samplePeriod_ = value;
      
      }
    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     */
    @java.lang.SuppressWarnings({"ReferenceEquality"})
    private void mergeSamplePeriod(com.google.protobuf.Duration value) {
      value.getClass();
  if (samplePeriod_ != null &&
          samplePeriod_ != com.google.protobuf.Duration.getDefaultInstance()) {
        samplePeriod_ =
          com.google.protobuf.Duration.newBuilder(samplePeriod_).mergeFrom(value).buildPartial();
      } else {
        samplePeriod_ = value;
      }
      
    }
    /**
     * <pre>
     * The sampling period of metric data points. For metrics which are written
     * periodically, consecutive data points are stored at this time interval,
     * excluding data loss due to errors. Metrics with a higher granularity have
     * a smaller sampling period.
     * </pre>
     *
     * <code>.google.protobuf.Duration sample_period = 2;</code>
     */
    private void clearSamplePeriod() {  samplePeriod_ = null;
      
    }

    public static final int INGEST_DELAY_FIELD_NUMBER = 3;
    private com.google.protobuf.Duration ingestDelay_;
    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     */
    @java.lang.Override
    public boolean hasIngestDelay() {
      return ingestDelay_ != null;
    }
    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     */
    @java.lang.Override
    public com.google.protobuf.Duration getIngestDelay() {
      return ingestDelay_ == null ? com.google.protobuf.Duration.getDefaultInstance() : ingestDelay_;
    }
    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     */
    private void setIngestDelay(com.google.protobuf.Duration value) {
      value.getClass();
  ingestDelay_ = value;
      
      }
    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     */
    @java.lang.SuppressWarnings({"ReferenceEquality"})
    private void mergeIngestDelay(com.google.protobuf.Duration value) {
      value.getClass();
  if (ingestDelay_ != null &&
          ingestDelay_ != com.google.protobuf.Duration.getDefaultInstance()) {
        ingestDelay_ =
          com.google.protobuf.Duration.newBuilder(ingestDelay_).mergeFrom(value).buildPartial();
      } else {
        ingestDelay_ = value;
      }
      
    }
    /**
     * <pre>
     * The delay of data points caused by ingestion. Data points older than this
     * age are guaranteed to be ingested and available to be read, excluding
     * data loss due to errors.
     * </pre>
     *
     * <code>.google.protobuf.Duration ingest_delay = 3;</code>
     */
    private void clearIngestDelay() {  ingestDelay_ = null;
      
    }

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

    /**
     * <pre>
     * Additional annotations that can be used to guide the usage of a metric.
     * </pre>
     *
     * Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageLite.Builder<
          com.google.api.MetricDescriptor.MetricDescriptorMetadata, Builder> implements
        // @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor.MetricDescriptorMetadata)
        com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder {
      // Construct using com.google.api.MetricDescriptor.MetricDescriptorMetadata.newBuilder()
      private Builder() {
        super(DEFAULT_INSTANCE);
      }


      /**
       * <pre>
       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
       * </pre>
       *
       * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
       * @return The enum numeric value on the wire for launchStage.
       */
      @java.lang.Override
      @java.lang.Deprecated public int getLaunchStageValue() {
        return instance.getLaunchStageValue();
      }
      /**
       * <pre>
       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
       * </pre>
       *
       * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
       * @param value The launchStage to set.
       * @return This builder for chaining.
       */
      @java.lang.Deprecated public Builder setLaunchStageValue(int value) {
        copyOnWrite();
        instance.setLaunchStageValue(value);
        return this;
      }
      /**
       * <pre>
       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
       * </pre>
       *
       * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
       * @return The launchStage.
       */
      @java.lang.Override
      @java.lang.Deprecated public com.google.api.LaunchStage getLaunchStage() {
        return instance.getLaunchStage();
      }
      /**
       * <pre>
       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
       * </pre>
       *
       * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
       * @param value The enum numeric value on the wire for launchStage to set.
       * @return This builder for chaining.
       */
      @java.lang.Deprecated public Builder setLaunchStage(com.google.api.LaunchStage value) {
        copyOnWrite();
        instance.setLaunchStage(value);
        return this;
      }
      /**
       * <pre>
       * Deprecated. Must use the [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage] instead.
       * </pre>
       *
       * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
       * @return This builder for chaining.
       */
      @java.lang.Deprecated public Builder clearLaunchStage() {
        copyOnWrite();
        instance.clearLaunchStage();
        return this;
      }

      /**
       * <pre>
       * The sampling period of metric data points. For metrics which are written
       * periodically, consecutive data points are stored at this time interval,
       * excluding data loss due to errors. Metrics with a higher granularity have
       * a smaller sampling period.
       * </pre>
       *
       * <code>.google.protobuf.Duration sample_period = 2;</code>
       */
      @java.lang.Override
      public boolean hasSamplePeriod() {
        return instance.hasSamplePeriod();
      }
      /**
       * <pre>
       * The sampling period of metric data points. For metrics which are written
       * periodically, consecutive data points are stored at this time interval,
       * excluding data loss due to errors. Metrics with a higher granularity have
       * a smaller sampling period.
       * </pre>
       *
       * <code>.google.protobuf.Duration sample_period = 2;</code>
       */
      @java.lang.Override
      public com.google.protobuf.Duration getSamplePeriod() {
        return instance.getSamplePeriod();
      }
      /**
       * <pre>
       * The sampling period of metric data points. For metrics which are written
       * periodically, consecutive data points are stored at this time interval,
       * excluding data loss due to errors. Metrics with a higher granularity have
       * a smaller sampling period.
       * </pre>
       *
       * <code>.google.protobuf.Duration sample_period = 2;</code>
       */
      public Builder setSamplePeriod(com.google.protobuf.Duration value) {
        copyOnWrite();
        instance.setSamplePeriod(value);
        return this;
        }
      /**
       * <pre>
       * The sampling period of metric data points. For metrics which are written
       * periodically, consecutive data points are stored at this time interval,
       * excluding data loss due to errors. Metrics with a higher granularity have
       * a smaller sampling period.
       * </pre>
       *
       * <code>.google.protobuf.Duration sample_period = 2;</code>
       */
      public Builder setSamplePeriod(
          com.google.protobuf.Duration.Builder builderForValue) {
        copyOnWrite();
        instance.setSamplePeriod(builderForValue.build());
        return this;
      }
      /**
       * <pre>
       * The sampling period of metric data points. For metrics which are written
       * periodically, consecutive data points are stored at this time interval,
       * excluding data loss due to errors. Metrics with a higher granularity have
       * a smaller sampling period.
       * </pre>
       *
       * <code>.google.protobuf.Duration sample_period = 2;</code>
       */
      public Builder mergeSamplePeriod(com.google.protobuf.Duration value) {
        copyOnWrite();
        instance.mergeSamplePeriod(value);
        return this;
      }
      /**
       * <pre>
       * The sampling period of metric data points. For metrics which are written
       * periodically, consecutive data points are stored at this time interval,
       * excluding data loss due to errors. Metrics with a higher granularity have
       * a smaller sampling period.
       * </pre>
       *
       * <code>.google.protobuf.Duration sample_period = 2;</code>
       */
      public Builder clearSamplePeriod() {  copyOnWrite();
        instance.clearSamplePeriod();
        return this;
      }

      /**
       * <pre>
       * The delay of data points caused by ingestion. Data points older than this
       * age are guaranteed to be ingested and available to be read, excluding
       * data loss due to errors.
       * </pre>
       *
       * <code>.google.protobuf.Duration ingest_delay = 3;</code>
       */
      @java.lang.Override
      public boolean hasIngestDelay() {
        return instance.hasIngestDelay();
      }
      /**
       * <pre>
       * The delay of data points caused by ingestion. Data points older than this
       * age are guaranteed to be ingested and available to be read, excluding
       * data loss due to errors.
       * </pre>
       *
       * <code>.google.protobuf.Duration ingest_delay = 3;</code>
       */
      @java.lang.Override
      public com.google.protobuf.Duration getIngestDelay() {
        return instance.getIngestDelay();
      }
      /**
       * <pre>
       * The delay of data points caused by ingestion. Data points older than this
       * age are guaranteed to be ingested and available to be read, excluding
       * data loss due to errors.
       * </pre>
       *
       * <code>.google.protobuf.Duration ingest_delay = 3;</code>
       */
      public Builder setIngestDelay(com.google.protobuf.Duration value) {
        copyOnWrite();
        instance.setIngestDelay(value);
        return this;
        }
      /**
       * <pre>
       * The delay of data points caused by ingestion. Data points older than this
       * age are guaranteed to be ingested and available to be read, excluding
       * data loss due to errors.
       * </pre>
       *
       * <code>.google.protobuf.Duration ingest_delay = 3;</code>
       */
      public Builder setIngestDelay(
          com.google.protobuf.Duration.Builder builderForValue) {
        copyOnWrite();
        instance.setIngestDelay(builderForValue.build());
        return this;
      }
      /**
       * <pre>
       * The delay of data points caused by ingestion. Data points older than this
       * age are guaranteed to be ingested and available to be read, excluding
       * data loss due to errors.
       * </pre>
       *
       * <code>.google.protobuf.Duration ingest_delay = 3;</code>
       */
      public Builder mergeIngestDelay(com.google.protobuf.Duration value) {
        copyOnWrite();
        instance.mergeIngestDelay(value);
        return this;
      }
      /**
       * <pre>
       * The delay of data points caused by ingestion. Data points older than this
       * age are guaranteed to be ingested and available to be read, excluding
       * data loss due to errors.
       * </pre>
       *
       * <code>.google.protobuf.Duration ingest_delay = 3;</code>
       */
      public Builder clearIngestDelay() {  copyOnWrite();
        instance.clearIngestDelay();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor.MetricDescriptorMetadata)
    }
    @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.MetricDescriptor.MetricDescriptorMetadata();
        }
        case NEW_BUILDER: {
          return new Builder();
        }
        case BUILD_MESSAGE_INFO: {
            java.lang.Object[] objects = new java.lang.Object[] {
              "launchStage_",
              "samplePeriod_",
              "ingestDelay_",
            };
            java.lang.String info =
                "\u0000\u0003\u0000\u0000\u0001\u0003\u0003\u0000\u0000\u0000\u0001\f\u0002\t\u0003" +
                "\t";
            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.MetricDescriptor.MetricDescriptorMetadata> parser = PARSER;
          if (parser == null) {
            synchronized (com.google.api.MetricDescriptor.MetricDescriptorMetadata.class) {
              parser = PARSER;
              if (parser == null) {
                parser =
                    new DefaultInstanceBasedParser<com.google.api.MetricDescriptor.MetricDescriptorMetadata>(
                        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.MetricDescriptor.MetricDescriptorMetadata)
    private static final com.google.api.MetricDescriptor.MetricDescriptorMetadata DEFAULT_INSTANCE;
    static {
      MetricDescriptorMetadata defaultInstance = new MetricDescriptorMetadata();
      // New instances are implicitly immutable so no need to make
      // immutable.
      DEFAULT_INSTANCE = defaultInstance;
      com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
        MetricDescriptorMetadata.class, defaultInstance);
    }

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

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

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

  public static final int NAME_FIELD_NUMBER = 1;
  private java.lang.String name_;
  /**
   * <pre>
   * The resource name of the metric descriptor.
   * </pre>
   *
   * <code>string name = 1;</code>
   * @return The name.
   */
  @java.lang.Override
  public java.lang.String getName() {
    return name_;
  }
  /**
   * <pre>
   * The resource name of the metric descriptor.
   * </pre>
   *
   * <code>string name = 1;</code>
   * @return The bytes for name.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getNameBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(name_);
  }
  /**
   * <pre>
   * The resource name of the metric descriptor.
   * </pre>
   *
   * <code>string name = 1;</code>
   * @param value The name to set.
   */
  private void setName(
      java.lang.String value) {
    value.getClass();
  
    name_ = value;
  }
  /**
   * <pre>
   * The resource name of the metric descriptor.
   * </pre>
   *
   * <code>string name = 1;</code>
   */
  private void clearName() {
    
    name_ = getDefaultInstance().getName();
  }
  /**
   * <pre>
   * The resource name of the metric descriptor.
   * </pre>
   *
   * <code>string name = 1;</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 TYPE_FIELD_NUMBER = 8;
  private java.lang.String type_;
  /**
   * <pre>
   * The metric type, including its DNS name prefix. The type is not
   * URL-encoded. All user-defined metric types have the DNS name
   * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
   * use a natural hierarchical grouping. For example:
   *     "custom.googleapis.com/invoice/paid/amount"
   *     "external.googleapis.com/prometheus/up"
   *     "appengine.googleapis.com/http/server/response_latencies"
   * </pre>
   *
   * <code>string type = 8;</code>
   * @return The type.
   */
  @java.lang.Override
  public java.lang.String getType() {
    return type_;
  }
  /**
   * <pre>
   * The metric type, including its DNS name prefix. The type is not
   * URL-encoded. All user-defined metric types have the DNS name
   * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
   * use a natural hierarchical grouping. For example:
   *     "custom.googleapis.com/invoice/paid/amount"
   *     "external.googleapis.com/prometheus/up"
   *     "appengine.googleapis.com/http/server/response_latencies"
   * </pre>
   *
   * <code>string type = 8;</code>
   * @return The bytes for type.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getTypeBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(type_);
  }
  /**
   * <pre>
   * The metric type, including its DNS name prefix. The type is not
   * URL-encoded. All user-defined metric types have the DNS name
   * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
   * use a natural hierarchical grouping. For example:
   *     "custom.googleapis.com/invoice/paid/amount"
   *     "external.googleapis.com/prometheus/up"
   *     "appengine.googleapis.com/http/server/response_latencies"
   * </pre>
   *
   * <code>string type = 8;</code>
   * @param value The type to set.
   */
  private void setType(
      java.lang.String value) {
    value.getClass();
  
    type_ = value;
  }
  /**
   * <pre>
   * The metric type, including its DNS name prefix. The type is not
   * URL-encoded. All user-defined metric types have the DNS name
   * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
   * use a natural hierarchical grouping. For example:
   *     "custom.googleapis.com/invoice/paid/amount"
   *     "external.googleapis.com/prometheus/up"
   *     "appengine.googleapis.com/http/server/response_latencies"
   * </pre>
   *
   * <code>string type = 8;</code>
   */
  private void clearType() {
    
    type_ = getDefaultInstance().getType();
  }
  /**
   * <pre>
   * The metric type, including its DNS name prefix. The type is not
   * URL-encoded. All user-defined metric types have the DNS name
   * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
   * use a natural hierarchical grouping. For example:
   *     "custom.googleapis.com/invoice/paid/amount"
   *     "external.googleapis.com/prometheus/up"
   *     "appengine.googleapis.com/http/server/response_latencies"
   * </pre>
   *
   * <code>string type = 8;</code>
   * @param value The bytes for type to set.
   */
  private void setTypeBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    type_ = value.toStringUtf8();
    
  }

  public static final int LABELS_FIELD_NUMBER = 2;
  private com.google.protobuf.Internal.ProtobufList<com.google.api.LabelDescriptor> labels_;
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  @java.lang.Override
  public java.util.List<com.google.api.LabelDescriptor> getLabelsList() {
    return labels_;
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  public java.util.List<? extends com.google.api.LabelDescriptorOrBuilder> 
      getLabelsOrBuilderList() {
    return labels_;
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  @java.lang.Override
  public int getLabelsCount() {
    return labels_.size();
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  @java.lang.Override
  public com.google.api.LabelDescriptor getLabels(int index) {
    return labels_.get(index);
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(
      int index) {
    return labels_.get(index);
  }
  private void ensureLabelsIsMutable() {
    com.google.protobuf.Internal.ProtobufList<com.google.api.LabelDescriptor> tmp = labels_;
    if (!tmp.isModifiable()) {
      labels_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }

  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  private void setLabels(
      int index, com.google.api.LabelDescriptor value) {
    value.getClass();
  ensureLabelsIsMutable();
    labels_.set(index, value);
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  private void addLabels(com.google.api.LabelDescriptor value) {
    value.getClass();
  ensureLabelsIsMutable();
    labels_.add(value);
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  private void addLabels(
      int index, com.google.api.LabelDescriptor value) {
    value.getClass();
  ensureLabelsIsMutable();
    labels_.add(index, value);
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  private void addAllLabels(
      java.lang.Iterable<? extends com.google.api.LabelDescriptor> values) {
    ensureLabelsIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, labels_);
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  private void clearLabels() {
    labels_ = emptyProtobufList();
  }
  /**
   * <pre>
   * The set of labels that can be used to describe a specific
   * instance of this metric type. For example, the
   * `appengine.googleapis.com/http/server/response_latencies` metric
   * type has a label for the HTTP response code, `response_code`, so
   * you can look at latencies for successful responses or just
   * for responses that failed.
   * </pre>
   *
   * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
   */
  private void removeLabels(int index) {
    ensureLabelsIsMutable();
    labels_.remove(index);
  }

  public static final int METRIC_KIND_FIELD_NUMBER = 3;
  private int metricKind_;
  /**
   * <pre>
   * Whether the metric records instantaneous values, changes to a value, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
   * @return The enum numeric value on the wire for metricKind.
   */
  @java.lang.Override
  public int getMetricKindValue() {
    return metricKind_;
  }
  /**
   * <pre>
   * Whether the metric records instantaneous values, changes to a value, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
   * @return The metricKind.
   */
  @java.lang.Override
  public com.google.api.MetricDescriptor.MetricKind getMetricKind() {
    com.google.api.MetricDescriptor.MetricKind result = com.google.api.MetricDescriptor.MetricKind.forNumber(metricKind_);
    return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result;
  }
  /**
   * <pre>
   * Whether the metric records instantaneous values, changes to a value, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
   * @param value The enum numeric value on the wire for metricKind to set.
   */
  private void setMetricKindValue(int value) {
      metricKind_ = value;
  }
  /**
   * <pre>
   * Whether the metric records instantaneous values, changes to a value, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
   * @param value The metricKind to set.
   */
  private void setMetricKind(com.google.api.MetricDescriptor.MetricKind value) {
    metricKind_ = value.getNumber();
    
  }
  /**
   * <pre>
   * Whether the metric records instantaneous values, changes to a value, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
   */
  private void clearMetricKind() {
    
    metricKind_ = 0;
  }

  public static final int VALUE_TYPE_FIELD_NUMBER = 4;
  private int valueType_;
  /**
   * <pre>
   * Whether the measurement is an integer, a floating-point number, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
   * @return The enum numeric value on the wire for valueType.
   */
  @java.lang.Override
  public int getValueTypeValue() {
    return valueType_;
  }
  /**
   * <pre>
   * Whether the measurement is an integer, a floating-point number, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
   * @return The valueType.
   */
  @java.lang.Override
  public com.google.api.MetricDescriptor.ValueType getValueType() {
    com.google.api.MetricDescriptor.ValueType result = com.google.api.MetricDescriptor.ValueType.forNumber(valueType_);
    return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result;
  }
  /**
   * <pre>
   * Whether the measurement is an integer, a floating-point number, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
   * @param value The enum numeric value on the wire for valueType to set.
   */
  private void setValueTypeValue(int value) {
      valueType_ = value;
  }
  /**
   * <pre>
   * Whether the measurement is an integer, a floating-point number, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
   * @param value The valueType to set.
   */
  private void setValueType(com.google.api.MetricDescriptor.ValueType value) {
    valueType_ = value.getNumber();
    
  }
  /**
   * <pre>
   * Whether the measurement is an integer, a floating-point number, etc.
   * Some combinations of `metric_kind` and `value_type` might not be supported.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
   */
  private void clearValueType() {
    
    valueType_ = 0;
  }

  public static final int UNIT_FIELD_NUMBER = 5;
  private java.lang.String unit_;
  /**
   * <pre>
   * The units in which the metric value is reported. It is only applicable
   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
   * defines the representation of the stored metric values.
   * Different systems may scale the values to be more easily displayed (so a
   * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
   * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
   * `KBy`, then the value of the metric is always in thousands of bytes, no
   * matter how it may be displayed..
   * If you want a custom metric to record the exact number of CPU-seconds used
   * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
   * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
   * CPU-seconds, then the value is written as `12005`.
   * Alternatively, if you want a custom metric to record data in a more
   * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
   * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
   * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
   * The supported units are a subset of [The Unified Code for Units of
   * Measure](http://unitsofmeasure.org/ucum.html) standard:
   * **Basic units (UNIT)**
   * * `bit`   bit
   * * `By`    byte
   * * `s`     second
   * * `min`   minute
   * * `h`     hour
   * * `d`     day
   * * `1`     dimensionless
   * **Prefixes (PREFIX)**
   * * `k`     kilo    (10^3)
   * * `M`     mega    (10^6)
   * * `G`     giga    (10^9)
   * * `T`     tera    (10^12)
   * * `P`     peta    (10^15)
   * * `E`     exa     (10^18)
   * * `Z`     zetta   (10^21)
   * * `Y`     yotta   (10^24)
   * * `m`     milli   (10^-3)
   * * `u`     micro   (10^-6)
   * * `n`     nano    (10^-9)
   * * `p`     pico    (10^-12)
   * * `f`     femto   (10^-15)
   * * `a`     atto    (10^-18)
   * * `z`     zepto   (10^-21)
   * * `y`     yocto   (10^-24)
   * * `Ki`    kibi    (2^10)
   * * `Mi`    mebi    (2^20)
   * * `Gi`    gibi    (2^30)
   * * `Ti`    tebi    (2^40)
   * * `Pi`    pebi    (2^50)
   * **Grammar**
   * The grammar also includes these connectors:
   * * `/`    division or ratio (as an infix operator). For examples,
   *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
   *          have `/s` in a metric `unit`; rates should always be computed at
   *          query time from the underlying cumulative or delta value).
   * * `.`    multiplication or composition (as an infix operator). For
   *          examples, `GBy.d` or `k{watt}.h`.
   * The grammar for a unit is as follows:
   *     Expression = Component { "." Component } { "/" Component } ;
   *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
   *               | Annotation
   *               | "1"
   *               ;
   *     Annotation = "{" NAME "}" ;
   * Notes:
   * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
   *    is used alone, then the unit is equivalent to `1`. For examples,
   *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
   * * `NAME` is a sequence of non-blank printable ASCII characters not
   *    containing `{` or `}`.
   * * `1` represents a unitary [dimensionless
   *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
   *    as in `1/s`. It is typically used when none of the basic units are
   *    appropriate. For example, "new users per day" can be represented as
   *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
   *    users). Alternatively, "thousands of page views per day" would be
   *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
   *    value of `5.3` would mean "5300 page views per day").
   * * `%` represents dimensionless value of 1/100, and annotates values giving
   *    a percentage (so the metric values are typically in the range of 0..100,
   *    and a metric value `3` means "3 percent").
   * * `10^2.%` indicates a metric contains a ratio, typically in the range
   *    0..1, that will be multiplied by 100 and displayed as a percentage
   *    (so a metric value `0.03` means "3 percent").
   * </pre>
   *
   * <code>string unit = 5;</code>
   * @return The unit.
   */
  @java.lang.Override
  public java.lang.String getUnit() {
    return unit_;
  }
  /**
   * <pre>
   * The units in which the metric value is reported. It is only applicable
   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
   * defines the representation of the stored metric values.
   * Different systems may scale the values to be more easily displayed (so a
   * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
   * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
   * `KBy`, then the value of the metric is always in thousands of bytes, no
   * matter how it may be displayed..
   * If you want a custom metric to record the exact number of CPU-seconds used
   * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
   * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
   * CPU-seconds, then the value is written as `12005`.
   * Alternatively, if you want a custom metric to record data in a more
   * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
   * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
   * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
   * The supported units are a subset of [The Unified Code for Units of
   * Measure](http://unitsofmeasure.org/ucum.html) standard:
   * **Basic units (UNIT)**
   * * `bit`   bit
   * * `By`    byte
   * * `s`     second
   * * `min`   minute
   * * `h`     hour
   * * `d`     day
   * * `1`     dimensionless
   * **Prefixes (PREFIX)**
   * * `k`     kilo    (10^3)
   * * `M`     mega    (10^6)
   * * `G`     giga    (10^9)
   * * `T`     tera    (10^12)
   * * `P`     peta    (10^15)
   * * `E`     exa     (10^18)
   * * `Z`     zetta   (10^21)
   * * `Y`     yotta   (10^24)
   * * `m`     milli   (10^-3)
   * * `u`     micro   (10^-6)
   * * `n`     nano    (10^-9)
   * * `p`     pico    (10^-12)
   * * `f`     femto   (10^-15)
   * * `a`     atto    (10^-18)
   * * `z`     zepto   (10^-21)
   * * `y`     yocto   (10^-24)
   * * `Ki`    kibi    (2^10)
   * * `Mi`    mebi    (2^20)
   * * `Gi`    gibi    (2^30)
   * * `Ti`    tebi    (2^40)
   * * `Pi`    pebi    (2^50)
   * **Grammar**
   * The grammar also includes these connectors:
   * * `/`    division or ratio (as an infix operator). For examples,
   *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
   *          have `/s` in a metric `unit`; rates should always be computed at
   *          query time from the underlying cumulative or delta value).
   * * `.`    multiplication or composition (as an infix operator). For
   *          examples, `GBy.d` or `k{watt}.h`.
   * The grammar for a unit is as follows:
   *     Expression = Component { "." Component } { "/" Component } ;
   *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
   *               | Annotation
   *               | "1"
   *               ;
   *     Annotation = "{" NAME "}" ;
   * Notes:
   * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
   *    is used alone, then the unit is equivalent to `1`. For examples,
   *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
   * * `NAME` is a sequence of non-blank printable ASCII characters not
   *    containing `{` or `}`.
   * * `1` represents a unitary [dimensionless
   *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
   *    as in `1/s`. It is typically used when none of the basic units are
   *    appropriate. For example, "new users per day" can be represented as
   *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
   *    users). Alternatively, "thousands of page views per day" would be
   *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
   *    value of `5.3` would mean "5300 page views per day").
   * * `%` represents dimensionless value of 1/100, and annotates values giving
   *    a percentage (so the metric values are typically in the range of 0..100,
   *    and a metric value `3` means "3 percent").
   * * `10^2.%` indicates a metric contains a ratio, typically in the range
   *    0..1, that will be multiplied by 100 and displayed as a percentage
   *    (so a metric value `0.03` means "3 percent").
   * </pre>
   *
   * <code>string unit = 5;</code>
   * @return The bytes for unit.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getUnitBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(unit_);
  }
  /**
   * <pre>
   * The units in which the metric value is reported. It is only applicable
   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
   * defines the representation of the stored metric values.
   * Different systems may scale the values to be more easily displayed (so a
   * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
   * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
   * `KBy`, then the value of the metric is always in thousands of bytes, no
   * matter how it may be displayed..
   * If you want a custom metric to record the exact number of CPU-seconds used
   * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
   * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
   * CPU-seconds, then the value is written as `12005`.
   * Alternatively, if you want a custom metric to record data in a more
   * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
   * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
   * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
   * The supported units are a subset of [The Unified Code for Units of
   * Measure](http://unitsofmeasure.org/ucum.html) standard:
   * **Basic units (UNIT)**
   * * `bit`   bit
   * * `By`    byte
   * * `s`     second
   * * `min`   minute
   * * `h`     hour
   * * `d`     day
   * * `1`     dimensionless
   * **Prefixes (PREFIX)**
   * * `k`     kilo    (10^3)
   * * `M`     mega    (10^6)
   * * `G`     giga    (10^9)
   * * `T`     tera    (10^12)
   * * `P`     peta    (10^15)
   * * `E`     exa     (10^18)
   * * `Z`     zetta   (10^21)
   * * `Y`     yotta   (10^24)
   * * `m`     milli   (10^-3)
   * * `u`     micro   (10^-6)
   * * `n`     nano    (10^-9)
   * * `p`     pico    (10^-12)
   * * `f`     femto   (10^-15)
   * * `a`     atto    (10^-18)
   * * `z`     zepto   (10^-21)
   * * `y`     yocto   (10^-24)
   * * `Ki`    kibi    (2^10)
   * * `Mi`    mebi    (2^20)
   * * `Gi`    gibi    (2^30)
   * * `Ti`    tebi    (2^40)
   * * `Pi`    pebi    (2^50)
   * **Grammar**
   * The grammar also includes these connectors:
   * * `/`    division or ratio (as an infix operator). For examples,
   *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
   *          have `/s` in a metric `unit`; rates should always be computed at
   *          query time from the underlying cumulative or delta value).
   * * `.`    multiplication or composition (as an infix operator). For
   *          examples, `GBy.d` or `k{watt}.h`.
   * The grammar for a unit is as follows:
   *     Expression = Component { "." Component } { "/" Component } ;
   *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
   *               | Annotation
   *               | "1"
   *               ;
   *     Annotation = "{" NAME "}" ;
   * Notes:
   * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
   *    is used alone, then the unit is equivalent to `1`. For examples,
   *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
   * * `NAME` is a sequence of non-blank printable ASCII characters not
   *    containing `{` or `}`.
   * * `1` represents a unitary [dimensionless
   *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
   *    as in `1/s`. It is typically used when none of the basic units are
   *    appropriate. For example, "new users per day" can be represented as
   *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
   *    users). Alternatively, "thousands of page views per day" would be
   *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
   *    value of `5.3` would mean "5300 page views per day").
   * * `%` represents dimensionless value of 1/100, and annotates values giving
   *    a percentage (so the metric values are typically in the range of 0..100,
   *    and a metric value `3` means "3 percent").
   * * `10^2.%` indicates a metric contains a ratio, typically in the range
   *    0..1, that will be multiplied by 100 and displayed as a percentage
   *    (so a metric value `0.03` means "3 percent").
   * </pre>
   *
   * <code>string unit = 5;</code>
   * @param value The unit to set.
   */
  private void setUnit(
      java.lang.String value) {
    value.getClass();
  
    unit_ = value;
  }
  /**
   * <pre>
   * The units in which the metric value is reported. It is only applicable
   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
   * defines the representation of the stored metric values.
   * Different systems may scale the values to be more easily displayed (so a
   * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
   * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
   * `KBy`, then the value of the metric is always in thousands of bytes, no
   * matter how it may be displayed..
   * If you want a custom metric to record the exact number of CPU-seconds used
   * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
   * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
   * CPU-seconds, then the value is written as `12005`.
   * Alternatively, if you want a custom metric to record data in a more
   * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
   * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
   * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
   * The supported units are a subset of [The Unified Code for Units of
   * Measure](http://unitsofmeasure.org/ucum.html) standard:
   * **Basic units (UNIT)**
   * * `bit`   bit
   * * `By`    byte
   * * `s`     second
   * * `min`   minute
   * * `h`     hour
   * * `d`     day
   * * `1`     dimensionless
   * **Prefixes (PREFIX)**
   * * `k`     kilo    (10^3)
   * * `M`     mega    (10^6)
   * * `G`     giga    (10^9)
   * * `T`     tera    (10^12)
   * * `P`     peta    (10^15)
   * * `E`     exa     (10^18)
   * * `Z`     zetta   (10^21)
   * * `Y`     yotta   (10^24)
   * * `m`     milli   (10^-3)
   * * `u`     micro   (10^-6)
   * * `n`     nano    (10^-9)
   * * `p`     pico    (10^-12)
   * * `f`     femto   (10^-15)
   * * `a`     atto    (10^-18)
   * * `z`     zepto   (10^-21)
   * * `y`     yocto   (10^-24)
   * * `Ki`    kibi    (2^10)
   * * `Mi`    mebi    (2^20)
   * * `Gi`    gibi    (2^30)
   * * `Ti`    tebi    (2^40)
   * * `Pi`    pebi    (2^50)
   * **Grammar**
   * The grammar also includes these connectors:
   * * `/`    division or ratio (as an infix operator). For examples,
   *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
   *          have `/s` in a metric `unit`; rates should always be computed at
   *          query time from the underlying cumulative or delta value).
   * * `.`    multiplication or composition (as an infix operator). For
   *          examples, `GBy.d` or `k{watt}.h`.
   * The grammar for a unit is as follows:
   *     Expression = Component { "." Component } { "/" Component } ;
   *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
   *               | Annotation
   *               | "1"
   *               ;
   *     Annotation = "{" NAME "}" ;
   * Notes:
   * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
   *    is used alone, then the unit is equivalent to `1`. For examples,
   *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
   * * `NAME` is a sequence of non-blank printable ASCII characters not
   *    containing `{` or `}`.
   * * `1` represents a unitary [dimensionless
   *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
   *    as in `1/s`. It is typically used when none of the basic units are
   *    appropriate. For example, "new users per day" can be represented as
   *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
   *    users). Alternatively, "thousands of page views per day" would be
   *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
   *    value of `5.3` would mean "5300 page views per day").
   * * `%` represents dimensionless value of 1/100, and annotates values giving
   *    a percentage (so the metric values are typically in the range of 0..100,
   *    and a metric value `3` means "3 percent").
   * * `10^2.%` indicates a metric contains a ratio, typically in the range
   *    0..1, that will be multiplied by 100 and displayed as a percentage
   *    (so a metric value `0.03` means "3 percent").
   * </pre>
   *
   * <code>string unit = 5;</code>
   */
  private void clearUnit() {
    
    unit_ = getDefaultInstance().getUnit();
  }
  /**
   * <pre>
   * The units in which the metric value is reported. It is only applicable
   * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
   * defines the representation of the stored metric values.
   * Different systems may scale the values to be more easily displayed (so a
   * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
   * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
   * `KBy`, then the value of the metric is always in thousands of bytes, no
   * matter how it may be displayed..
   * If you want a custom metric to record the exact number of CPU-seconds used
   * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
   * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
   * CPU-seconds, then the value is written as `12005`.
   * Alternatively, if you want a custom metric to record data in a more
   * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
   * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
   * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
   * The supported units are a subset of [The Unified Code for Units of
   * Measure](http://unitsofmeasure.org/ucum.html) standard:
   * **Basic units (UNIT)**
   * * `bit`   bit
   * * `By`    byte
   * * `s`     second
   * * `min`   minute
   * * `h`     hour
   * * `d`     day
   * * `1`     dimensionless
   * **Prefixes (PREFIX)**
   * * `k`     kilo    (10^3)
   * * `M`     mega    (10^6)
   * * `G`     giga    (10^9)
   * * `T`     tera    (10^12)
   * * `P`     peta    (10^15)
   * * `E`     exa     (10^18)
   * * `Z`     zetta   (10^21)
   * * `Y`     yotta   (10^24)
   * * `m`     milli   (10^-3)
   * * `u`     micro   (10^-6)
   * * `n`     nano    (10^-9)
   * * `p`     pico    (10^-12)
   * * `f`     femto   (10^-15)
   * * `a`     atto    (10^-18)
   * * `z`     zepto   (10^-21)
   * * `y`     yocto   (10^-24)
   * * `Ki`    kibi    (2^10)
   * * `Mi`    mebi    (2^20)
   * * `Gi`    gibi    (2^30)
   * * `Ti`    tebi    (2^40)
   * * `Pi`    pebi    (2^50)
   * **Grammar**
   * The grammar also includes these connectors:
   * * `/`    division or ratio (as an infix operator). For examples,
   *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
   *          have `/s` in a metric `unit`; rates should always be computed at
   *          query time from the underlying cumulative or delta value).
   * * `.`    multiplication or composition (as an infix operator). For
   *          examples, `GBy.d` or `k{watt}.h`.
   * The grammar for a unit is as follows:
   *     Expression = Component { "." Component } { "/" Component } ;
   *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
   *               | Annotation
   *               | "1"
   *               ;
   *     Annotation = "{" NAME "}" ;
   * Notes:
   * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
   *    is used alone, then the unit is equivalent to `1`. For examples,
   *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
   * * `NAME` is a sequence of non-blank printable ASCII characters not
   *    containing `{` or `}`.
   * * `1` represents a unitary [dimensionless
   *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
   *    as in `1/s`. It is typically used when none of the basic units are
   *    appropriate. For example, "new users per day" can be represented as
   *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
   *    users). Alternatively, "thousands of page views per day" would be
   *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
   *    value of `5.3` would mean "5300 page views per day").
   * * `%` represents dimensionless value of 1/100, and annotates values giving
   *    a percentage (so the metric values are typically in the range of 0..100,
   *    and a metric value `3` means "3 percent").
   * * `10^2.%` indicates a metric contains a ratio, typically in the range
   *    0..1, that will be multiplied by 100 and displayed as a percentage
   *    (so a metric value `0.03` means "3 percent").
   * </pre>
   *
   * <code>string unit = 5;</code>
   * @param value The bytes for unit to set.
   */
  private void setUnitBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    unit_ = value.toStringUtf8();
    
  }

  public static final int DESCRIPTION_FIELD_NUMBER = 6;
  private java.lang.String description_;
  /**
   * <pre>
   * A detailed description of the metric, which can be used in documentation.
   * </pre>
   *
   * <code>string description = 6;</code>
   * @return The description.
   */
  @java.lang.Override
  public java.lang.String getDescription() {
    return description_;
  }
  /**
   * <pre>
   * A detailed description of the metric, which can be used in documentation.
   * </pre>
   *
   * <code>string description = 6;</code>
   * @return The bytes for description.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getDescriptionBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(description_);
  }
  /**
   * <pre>
   * A detailed description of the metric, which can be used in documentation.
   * </pre>
   *
   * <code>string description = 6;</code>
   * @param value The description to set.
   */
  private void setDescription(
      java.lang.String value) {
    value.getClass();
  
    description_ = value;
  }
  /**
   * <pre>
   * A detailed description of the metric, which can be used in documentation.
   * </pre>
   *
   * <code>string description = 6;</code>
   */
  private void clearDescription() {
    
    description_ = getDefaultInstance().getDescription();
  }
  /**
   * <pre>
   * A detailed description of the metric, which can be used in documentation.
   * </pre>
   *
   * <code>string description = 6;</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 DISPLAY_NAME_FIELD_NUMBER = 7;
  private java.lang.String displayName_;
  /**
   * <pre>
   * A concise name for the metric, which can be displayed in user interfaces.
   * Use sentence case without an ending period, for example "Request count".
   * This field is optional but it is recommended to be set for any metrics
   * associated with user-visible concepts, such as Quota.
   * </pre>
   *
   * <code>string display_name = 7;</code>
   * @return The displayName.
   */
  @java.lang.Override
  public java.lang.String getDisplayName() {
    return displayName_;
  }
  /**
   * <pre>
   * A concise name for the metric, which can be displayed in user interfaces.
   * Use sentence case without an ending period, for example "Request count".
   * This field is optional but it is recommended to be set for any metrics
   * associated with user-visible concepts, such as Quota.
   * </pre>
   *
   * <code>string display_name = 7;</code>
   * @return The bytes for displayName.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getDisplayNameBytes() {
    return com.google.protobuf.ByteString.copyFromUtf8(displayName_);
  }
  /**
   * <pre>
   * A concise name for the metric, which can be displayed in user interfaces.
   * Use sentence case without an ending period, for example "Request count".
   * This field is optional but it is recommended to be set for any metrics
   * associated with user-visible concepts, such as Quota.
   * </pre>
   *
   * <code>string display_name = 7;</code>
   * @param value The displayName to set.
   */
  private void setDisplayName(
      java.lang.String value) {
    value.getClass();
  
    displayName_ = value;
  }
  /**
   * <pre>
   * A concise name for the metric, which can be displayed in user interfaces.
   * Use sentence case without an ending period, for example "Request count".
   * This field is optional but it is recommended to be set for any metrics
   * associated with user-visible concepts, such as Quota.
   * </pre>
   *
   * <code>string display_name = 7;</code>
   */
  private void clearDisplayName() {
    
    displayName_ = getDefaultInstance().getDisplayName();
  }
  /**
   * <pre>
   * A concise name for the metric, which can be displayed in user interfaces.
   * Use sentence case without an ending period, for example "Request count".
   * This field is optional but it is recommended to be set for any metrics
   * associated with user-visible concepts, such as Quota.
   * </pre>
   *
   * <code>string display_name = 7;</code>
   * @param value The bytes for displayName to set.
   */
  private void setDisplayNameBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    displayName_ = value.toStringUtf8();
    
  }

  public static final int METADATA_FIELD_NUMBER = 10;
  private com.google.api.MetricDescriptor.MetricDescriptorMetadata metadata_;
  /**
   * <pre>
   * Optional. Metadata which can be used to guide usage of the metric.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
   */
  @java.lang.Override
  public boolean hasMetadata() {
    return metadata_ != null;
  }
  /**
   * <pre>
   * Optional. Metadata which can be used to guide usage of the metric.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
   */
  @java.lang.Override
  public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() {
    return metadata_ == null ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance() : metadata_;
  }
  /**
   * <pre>
   * Optional. Metadata which can be used to guide usage of the metric.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
   */
  private void setMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) {
    value.getClass();
  metadata_ = value;
    
    }
  /**
   * <pre>
   * Optional. Metadata which can be used to guide usage of the metric.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
   */
  @java.lang.SuppressWarnings({"ReferenceEquality"})
  private void mergeMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) {
    value.getClass();
  if (metadata_ != null &&
        metadata_ != com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()) {
      metadata_ =
        com.google.api.MetricDescriptor.MetricDescriptorMetadata.newBuilder(metadata_).mergeFrom(value).buildPartial();
    } else {
      metadata_ = value;
    }
    
  }
  /**
   * <pre>
   * Optional. Metadata which can be used to guide usage of the metric.
   * </pre>
   *
   * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
   */
  private void clearMetadata() {  metadata_ = null;
    
  }

  public static final int LAUNCH_STAGE_FIELD_NUMBER = 12;
  private int launchStage_;
  /**
   * <pre>
   * Optional. The launch stage of the metric definition.
   * </pre>
   *
   * <code>.google.api.LaunchStage launch_stage = 12;</code>
   * @return The enum numeric value on the wire for launchStage.
   */
  @java.lang.Override
  public int getLaunchStageValue() {
    return launchStage_;
  }
  /**
   * <pre>
   * Optional. The launch stage of the metric definition.
   * </pre>
   *
   * <code>.google.api.LaunchStage launch_stage = 12;</code>
   * @return The launchStage.
   */
  @java.lang.Override
  public com.google.api.LaunchStage getLaunchStage() {
    com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_);
    return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result;
  }
  /**
   * <pre>
   * Optional. The launch stage of the metric definition.
   * </pre>
   *
   * <code>.google.api.LaunchStage launch_stage = 12;</code>
   * @param value The enum numeric value on the wire for launchStage to set.
   */
  private void setLaunchStageValue(int value) {
      launchStage_ = value;
  }
  /**
   * <pre>
   * Optional. The launch stage of the metric definition.
   * </pre>
   *
   * <code>.google.api.LaunchStage launch_stage = 12;</code>
   * @param value The launchStage to set.
   */
  private void setLaunchStage(com.google.api.LaunchStage value) {
    launchStage_ = value.getNumber();
    
  }
  /**
   * <pre>
   * Optional. The launch stage of the metric definition.
   * </pre>
   *
   * <code>.google.api.LaunchStage launch_stage = 12;</code>
   */
  private void clearLaunchStage() {
    
    launchStage_ = 0;
  }

  public static final int MONITORED_RESOURCE_TYPES_FIELD_NUMBER = 13;
  private com.google.protobuf.Internal.ProtobufList<java.lang.String> monitoredResourceTypes_;
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @return A list containing the monitoredResourceTypes.
   */
  @java.lang.Override
  public java.util.List<java.lang.String> getMonitoredResourceTypesList() {
    return monitoredResourceTypes_;
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @return The count of monitoredResourceTypes.
   */
  @java.lang.Override
  public int getMonitoredResourceTypesCount() {
    return monitoredResourceTypes_.size();
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @param index The index of the element to return.
   * @return The monitoredResourceTypes at the given index.
   */
  @java.lang.Override
  public java.lang.String getMonitoredResourceTypes(int index) {
    return monitoredResourceTypes_.get(index);
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @param index The index of the value to return.
   * @return The bytes of the monitoredResourceTypes at the given index.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getMonitoredResourceTypesBytes(int index) {
    return com.google.protobuf.ByteString.copyFromUtf8(
        monitoredResourceTypes_.get(index));
  }
  private void ensureMonitoredResourceTypesIsMutable() {
    com.google.protobuf.Internal.ProtobufList<java.lang.String> tmp =
        monitoredResourceTypes_;  if (!tmp.isModifiable()) {
      monitoredResourceTypes_ =
          com.google.protobuf.GeneratedMessageLite.mutableCopy(tmp);
     }
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @param index The index to set the value at.
   * @param value The monitoredResourceTypes to set.
   */
  private void setMonitoredResourceTypes(
      int index, java.lang.String value) {
    value.getClass();
  ensureMonitoredResourceTypesIsMutable();
    monitoredResourceTypes_.set(index, value);
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @param value The monitoredResourceTypes to add.
   */
  private void addMonitoredResourceTypes(
      java.lang.String value) {
    value.getClass();
  ensureMonitoredResourceTypesIsMutable();
    monitoredResourceTypes_.add(value);
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @param values The monitoredResourceTypes to add.
   */
  private void addAllMonitoredResourceTypes(
      java.lang.Iterable<java.lang.String> values) {
    ensureMonitoredResourceTypesIsMutable();
    com.google.protobuf.AbstractMessageLite.addAll(
        values, monitoredResourceTypes_);
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   */
  private void clearMonitoredResourceTypes() {
    monitoredResourceTypes_ = com.google.protobuf.GeneratedMessageLite.emptyProtobufList();
  }
  /**
   * <pre>
   * Read-only. If present, then a [time
   * series][google.monitoring.v3.TimeSeries], which is identified partially by
   * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
   * with this metric type can only be associated with one of the monitored
   * resource types listed here.
   * </pre>
   *
   * <code>repeated string monitored_resource_types = 13;</code>
   * @param value The bytes of the monitoredResourceTypes to add.
   */
  private void addMonitoredResourceTypesBytes(
      com.google.protobuf.ByteString value) {
    checkByteStringIsUtf8(value);
    ensureMonitoredResourceTypesIsMutable();
    monitoredResourceTypes_.add(value.toStringUtf8());
  }

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

  /**
   * <pre>
   * Defines a metric type and its schema. Once a metric descriptor is created,
   * deleting or altering it stops data collection and makes the metric type's
   * existing data unusable.
   * </pre>
   *
   * Protobuf type {@code google.api.MetricDescriptor}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageLite.Builder<
        com.google.api.MetricDescriptor, Builder> implements
      // @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor)
      com.google.api.MetricDescriptorOrBuilder {
    // Construct using com.google.api.MetricDescriptor.newBuilder()
    private Builder() {
      super(DEFAULT_INSTANCE);
    }


    /**
     * <pre>
     * The resource name of the metric descriptor.
     * </pre>
     *
     * <code>string name = 1;</code>
     * @return The name.
     */
    @java.lang.Override
    public java.lang.String getName() {
      return instance.getName();
    }
    /**
     * <pre>
     * The resource name of the metric descriptor.
     * </pre>
     *
     * <code>string name = 1;</code>
     * @return The bytes for name.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getNameBytes() {
      return instance.getNameBytes();
    }
    /**
     * <pre>
     * The resource name of the metric descriptor.
     * </pre>
     *
     * <code>string name = 1;</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>
     * The resource name of the metric descriptor.
     * </pre>
     *
     * <code>string name = 1;</code>
     * @return This builder for chaining.
     */
    public Builder clearName() {
      copyOnWrite();
      instance.clearName();
      return this;
    }
    /**
     * <pre>
     * The resource name of the metric descriptor.
     * </pre>
     *
     * <code>string name = 1;</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>
     * The metric type, including its DNS name prefix. The type is not
     * URL-encoded. All user-defined metric types have the DNS name
     * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
     * use a natural hierarchical grouping. For example:
     *     "custom.googleapis.com/invoice/paid/amount"
     *     "external.googleapis.com/prometheus/up"
     *     "appengine.googleapis.com/http/server/response_latencies"
     * </pre>
     *
     * <code>string type = 8;</code>
     * @return The type.
     */
    @java.lang.Override
    public java.lang.String getType() {
      return instance.getType();
    }
    /**
     * <pre>
     * The metric type, including its DNS name prefix. The type is not
     * URL-encoded. All user-defined metric types have the DNS name
     * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
     * use a natural hierarchical grouping. For example:
     *     "custom.googleapis.com/invoice/paid/amount"
     *     "external.googleapis.com/prometheus/up"
     *     "appengine.googleapis.com/http/server/response_latencies"
     * </pre>
     *
     * <code>string type = 8;</code>
     * @return The bytes for type.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getTypeBytes() {
      return instance.getTypeBytes();
    }
    /**
     * <pre>
     * The metric type, including its DNS name prefix. The type is not
     * URL-encoded. All user-defined metric types have the DNS name
     * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
     * use a natural hierarchical grouping. For example:
     *     "custom.googleapis.com/invoice/paid/amount"
     *     "external.googleapis.com/prometheus/up"
     *     "appengine.googleapis.com/http/server/response_latencies"
     * </pre>
     *
     * <code>string type = 8;</code>
     * @param value The type to set.
     * @return This builder for chaining.
     */
    public Builder setType(
        java.lang.String value) {
      copyOnWrite();
      instance.setType(value);
      return this;
    }
    /**
     * <pre>
     * The metric type, including its DNS name prefix. The type is not
     * URL-encoded. All user-defined metric types have the DNS name
     * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
     * use a natural hierarchical grouping. For example:
     *     "custom.googleapis.com/invoice/paid/amount"
     *     "external.googleapis.com/prometheus/up"
     *     "appengine.googleapis.com/http/server/response_latencies"
     * </pre>
     *
     * <code>string type = 8;</code>
     * @return This builder for chaining.
     */
    public Builder clearType() {
      copyOnWrite();
      instance.clearType();
      return this;
    }
    /**
     * <pre>
     * The metric type, including its DNS name prefix. The type is not
     * URL-encoded. All user-defined metric types have the DNS name
     * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
     * use a natural hierarchical grouping. For example:
     *     "custom.googleapis.com/invoice/paid/amount"
     *     "external.googleapis.com/prometheus/up"
     *     "appengine.googleapis.com/http/server/response_latencies"
     * </pre>
     *
     * <code>string type = 8;</code>
     * @param value The bytes for type to set.
     * @return This builder for chaining.
     */
    public Builder setTypeBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setTypeBytes(value);
      return this;
    }

    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    @java.lang.Override
    public java.util.List<com.google.api.LabelDescriptor> getLabelsList() {
      return java.util.Collections.unmodifiableList(
          instance.getLabelsList());
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    @java.lang.Override
    public int getLabelsCount() {
      return instance.getLabelsCount();
    }/**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    @java.lang.Override
    public com.google.api.LabelDescriptor getLabels(int index) {
      return instance.getLabels(index);
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder setLabels(
        int index, com.google.api.LabelDescriptor value) {
      copyOnWrite();
      instance.setLabels(index, value);
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder setLabels(
        int index, com.google.api.LabelDescriptor.Builder builderForValue) {
      copyOnWrite();
      instance.setLabels(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder addLabels(com.google.api.LabelDescriptor value) {
      copyOnWrite();
      instance.addLabels(value);
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder addLabels(
        int index, com.google.api.LabelDescriptor value) {
      copyOnWrite();
      instance.addLabels(index, value);
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder addLabels(
        com.google.api.LabelDescriptor.Builder builderForValue) {
      copyOnWrite();
      instance.addLabels(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder addLabels(
        int index, com.google.api.LabelDescriptor.Builder builderForValue) {
      copyOnWrite();
      instance.addLabels(index,
          builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder addAllLabels(
        java.lang.Iterable<? extends com.google.api.LabelDescriptor> values) {
      copyOnWrite();
      instance.addAllLabels(values);
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder clearLabels() {
      copyOnWrite();
      instance.clearLabels();
      return this;
    }
    /**
     * <pre>
     * The set of labels that can be used to describe a specific
     * instance of this metric type. For example, the
     * `appengine.googleapis.com/http/server/response_latencies` metric
     * type has a label for the HTTP response code, `response_code`, so
     * you can look at latencies for successful responses or just
     * for responses that failed.
     * </pre>
     *
     * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
     */
    public Builder removeLabels(int index) {
      copyOnWrite();
      instance.removeLabels(index);
      return this;
    }

    /**
     * <pre>
     * Whether the metric records instantaneous values, changes to a value, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
     * @return The enum numeric value on the wire for metricKind.
     */
    @java.lang.Override
    public int getMetricKindValue() {
      return instance.getMetricKindValue();
    }
    /**
     * <pre>
     * Whether the metric records instantaneous values, changes to a value, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
     * @param value The metricKind to set.
     * @return This builder for chaining.
     */
    public Builder setMetricKindValue(int value) {
      copyOnWrite();
      instance.setMetricKindValue(value);
      return this;
    }
    /**
     * <pre>
     * Whether the metric records instantaneous values, changes to a value, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
     * @return The metricKind.
     */
    @java.lang.Override
    public com.google.api.MetricDescriptor.MetricKind getMetricKind() {
      return instance.getMetricKind();
    }
    /**
     * <pre>
     * Whether the metric records instantaneous values, changes to a value, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
     * @param value The enum numeric value on the wire for metricKind to set.
     * @return This builder for chaining.
     */
    public Builder setMetricKind(com.google.api.MetricDescriptor.MetricKind value) {
      copyOnWrite();
      instance.setMetricKind(value);
      return this;
    }
    /**
     * <pre>
     * Whether the metric records instantaneous values, changes to a value, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
     * @return This builder for chaining.
     */
    public Builder clearMetricKind() {
      copyOnWrite();
      instance.clearMetricKind();
      return this;
    }

    /**
     * <pre>
     * Whether the measurement is an integer, a floating-point number, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
     * @return The enum numeric value on the wire for valueType.
     */
    @java.lang.Override
    public int getValueTypeValue() {
      return instance.getValueTypeValue();
    }
    /**
     * <pre>
     * Whether the measurement is an integer, a floating-point number, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
     * @param value The valueType to set.
     * @return This builder for chaining.
     */
    public Builder setValueTypeValue(int value) {
      copyOnWrite();
      instance.setValueTypeValue(value);
      return this;
    }
    /**
     * <pre>
     * Whether the measurement is an integer, a floating-point number, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
     * @return The valueType.
     */
    @java.lang.Override
    public com.google.api.MetricDescriptor.ValueType getValueType() {
      return instance.getValueType();
    }
    /**
     * <pre>
     * Whether the measurement is an integer, a floating-point number, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
     * @param value The enum numeric value on the wire for valueType to set.
     * @return This builder for chaining.
     */
    public Builder setValueType(com.google.api.MetricDescriptor.ValueType value) {
      copyOnWrite();
      instance.setValueType(value);
      return this;
    }
    /**
     * <pre>
     * Whether the measurement is an integer, a floating-point number, etc.
     * Some combinations of `metric_kind` and `value_type` might not be supported.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
     * @return This builder for chaining.
     */
    public Builder clearValueType() {
      copyOnWrite();
      instance.clearValueType();
      return this;
    }

    /**
     * <pre>
     * The units in which the metric value is reported. It is only applicable
     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
     * defines the representation of the stored metric values.
     * Different systems may scale the values to be more easily displayed (so a
     * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
     * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
     * `KBy`, then the value of the metric is always in thousands of bytes, no
     * matter how it may be displayed..
     * If you want a custom metric to record the exact number of CPU-seconds used
     * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
     * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
     * CPU-seconds, then the value is written as `12005`.
     * Alternatively, if you want a custom metric to record data in a more
     * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
     * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
     * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
     * The supported units are a subset of [The Unified Code for Units of
     * Measure](http://unitsofmeasure.org/ucum.html) standard:
     * **Basic units (UNIT)**
     * * `bit`   bit
     * * `By`    byte
     * * `s`     second
     * * `min`   minute
     * * `h`     hour
     * * `d`     day
     * * `1`     dimensionless
     * **Prefixes (PREFIX)**
     * * `k`     kilo    (10^3)
     * * `M`     mega    (10^6)
     * * `G`     giga    (10^9)
     * * `T`     tera    (10^12)
     * * `P`     peta    (10^15)
     * * `E`     exa     (10^18)
     * * `Z`     zetta   (10^21)
     * * `Y`     yotta   (10^24)
     * * `m`     milli   (10^-3)
     * * `u`     micro   (10^-6)
     * * `n`     nano    (10^-9)
     * * `p`     pico    (10^-12)
     * * `f`     femto   (10^-15)
     * * `a`     atto    (10^-18)
     * * `z`     zepto   (10^-21)
     * * `y`     yocto   (10^-24)
     * * `Ki`    kibi    (2^10)
     * * `Mi`    mebi    (2^20)
     * * `Gi`    gibi    (2^30)
     * * `Ti`    tebi    (2^40)
     * * `Pi`    pebi    (2^50)
     * **Grammar**
     * The grammar also includes these connectors:
     * * `/`    division or ratio (as an infix operator). For examples,
     *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
     *          have `/s` in a metric `unit`; rates should always be computed at
     *          query time from the underlying cumulative or delta value).
     * * `.`    multiplication or composition (as an infix operator). For
     *          examples, `GBy.d` or `k{watt}.h`.
     * The grammar for a unit is as follows:
     *     Expression = Component { "." Component } { "/" Component } ;
     *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
     *               | Annotation
     *               | "1"
     *               ;
     *     Annotation = "{" NAME "}" ;
     * Notes:
     * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
     *    is used alone, then the unit is equivalent to `1`. For examples,
     *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
     * * `NAME` is a sequence of non-blank printable ASCII characters not
     *    containing `{` or `}`.
     * * `1` represents a unitary [dimensionless
     *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
     *    as in `1/s`. It is typically used when none of the basic units are
     *    appropriate. For example, "new users per day" can be represented as
     *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
     *    users). Alternatively, "thousands of page views per day" would be
     *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
     *    value of `5.3` would mean "5300 page views per day").
     * * `%` represents dimensionless value of 1/100, and annotates values giving
     *    a percentage (so the metric values are typically in the range of 0..100,
     *    and a metric value `3` means "3 percent").
     * * `10^2.%` indicates a metric contains a ratio, typically in the range
     *    0..1, that will be multiplied by 100 and displayed as a percentage
     *    (so a metric value `0.03` means "3 percent").
     * </pre>
     *
     * <code>string unit = 5;</code>
     * @return The unit.
     */
    @java.lang.Override
    public java.lang.String getUnit() {
      return instance.getUnit();
    }
    /**
     * <pre>
     * The units in which the metric value is reported. It is only applicable
     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
     * defines the representation of the stored metric values.
     * Different systems may scale the values to be more easily displayed (so a
     * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
     * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
     * `KBy`, then the value of the metric is always in thousands of bytes, no
     * matter how it may be displayed..
     * If you want a custom metric to record the exact number of CPU-seconds used
     * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
     * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
     * CPU-seconds, then the value is written as `12005`.
     * Alternatively, if you want a custom metric to record data in a more
     * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
     * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
     * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
     * The supported units are a subset of [The Unified Code for Units of
     * Measure](http://unitsofmeasure.org/ucum.html) standard:
     * **Basic units (UNIT)**
     * * `bit`   bit
     * * `By`    byte
     * * `s`     second
     * * `min`   minute
     * * `h`     hour
     * * `d`     day
     * * `1`     dimensionless
     * **Prefixes (PREFIX)**
     * * `k`     kilo    (10^3)
     * * `M`     mega    (10^6)
     * * `G`     giga    (10^9)
     * * `T`     tera    (10^12)
     * * `P`     peta    (10^15)
     * * `E`     exa     (10^18)
     * * `Z`     zetta   (10^21)
     * * `Y`     yotta   (10^24)
     * * `m`     milli   (10^-3)
     * * `u`     micro   (10^-6)
     * * `n`     nano    (10^-9)
     * * `p`     pico    (10^-12)
     * * `f`     femto   (10^-15)
     * * `a`     atto    (10^-18)
     * * `z`     zepto   (10^-21)
     * * `y`     yocto   (10^-24)
     * * `Ki`    kibi    (2^10)
     * * `Mi`    mebi    (2^20)
     * * `Gi`    gibi    (2^30)
     * * `Ti`    tebi    (2^40)
     * * `Pi`    pebi    (2^50)
     * **Grammar**
     * The grammar also includes these connectors:
     * * `/`    division or ratio (as an infix operator). For examples,
     *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
     *          have `/s` in a metric `unit`; rates should always be computed at
     *          query time from the underlying cumulative or delta value).
     * * `.`    multiplication or composition (as an infix operator). For
     *          examples, `GBy.d` or `k{watt}.h`.
     * The grammar for a unit is as follows:
     *     Expression = Component { "." Component } { "/" Component } ;
     *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
     *               | Annotation
     *               | "1"
     *               ;
     *     Annotation = "{" NAME "}" ;
     * Notes:
     * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
     *    is used alone, then the unit is equivalent to `1`. For examples,
     *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
     * * `NAME` is a sequence of non-blank printable ASCII characters not
     *    containing `{` or `}`.
     * * `1` represents a unitary [dimensionless
     *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
     *    as in `1/s`. It is typically used when none of the basic units are
     *    appropriate. For example, "new users per day" can be represented as
     *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
     *    users). Alternatively, "thousands of page views per day" would be
     *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
     *    value of `5.3` would mean "5300 page views per day").
     * * `%` represents dimensionless value of 1/100, and annotates values giving
     *    a percentage (so the metric values are typically in the range of 0..100,
     *    and a metric value `3` means "3 percent").
     * * `10^2.%` indicates a metric contains a ratio, typically in the range
     *    0..1, that will be multiplied by 100 and displayed as a percentage
     *    (so a metric value `0.03` means "3 percent").
     * </pre>
     *
     * <code>string unit = 5;</code>
     * @return The bytes for unit.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getUnitBytes() {
      return instance.getUnitBytes();
    }
    /**
     * <pre>
     * The units in which the metric value is reported. It is only applicable
     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
     * defines the representation of the stored metric values.
     * Different systems may scale the values to be more easily displayed (so a
     * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
     * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
     * `KBy`, then the value of the metric is always in thousands of bytes, no
     * matter how it may be displayed..
     * If you want a custom metric to record the exact number of CPU-seconds used
     * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
     * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
     * CPU-seconds, then the value is written as `12005`.
     * Alternatively, if you want a custom metric to record data in a more
     * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
     * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
     * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
     * The supported units are a subset of [The Unified Code for Units of
     * Measure](http://unitsofmeasure.org/ucum.html) standard:
     * **Basic units (UNIT)**
     * * `bit`   bit
     * * `By`    byte
     * * `s`     second
     * * `min`   minute
     * * `h`     hour
     * * `d`     day
     * * `1`     dimensionless
     * **Prefixes (PREFIX)**
     * * `k`     kilo    (10^3)
     * * `M`     mega    (10^6)
     * * `G`     giga    (10^9)
     * * `T`     tera    (10^12)
     * * `P`     peta    (10^15)
     * * `E`     exa     (10^18)
     * * `Z`     zetta   (10^21)
     * * `Y`     yotta   (10^24)
     * * `m`     milli   (10^-3)
     * * `u`     micro   (10^-6)
     * * `n`     nano    (10^-9)
     * * `p`     pico    (10^-12)
     * * `f`     femto   (10^-15)
     * * `a`     atto    (10^-18)
     * * `z`     zepto   (10^-21)
     * * `y`     yocto   (10^-24)
     * * `Ki`    kibi    (2^10)
     * * `Mi`    mebi    (2^20)
     * * `Gi`    gibi    (2^30)
     * * `Ti`    tebi    (2^40)
     * * `Pi`    pebi    (2^50)
     * **Grammar**
     * The grammar also includes these connectors:
     * * `/`    division or ratio (as an infix operator). For examples,
     *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
     *          have `/s` in a metric `unit`; rates should always be computed at
     *          query time from the underlying cumulative or delta value).
     * * `.`    multiplication or composition (as an infix operator). For
     *          examples, `GBy.d` or `k{watt}.h`.
     * The grammar for a unit is as follows:
     *     Expression = Component { "." Component } { "/" Component } ;
     *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
     *               | Annotation
     *               | "1"
     *               ;
     *     Annotation = "{" NAME "}" ;
     * Notes:
     * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
     *    is used alone, then the unit is equivalent to `1`. For examples,
     *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
     * * `NAME` is a sequence of non-blank printable ASCII characters not
     *    containing `{` or `}`.
     * * `1` represents a unitary [dimensionless
     *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
     *    as in `1/s`. It is typically used when none of the basic units are
     *    appropriate. For example, "new users per day" can be represented as
     *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
     *    users). Alternatively, "thousands of page views per day" would be
     *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
     *    value of `5.3` would mean "5300 page views per day").
     * * `%` represents dimensionless value of 1/100, and annotates values giving
     *    a percentage (so the metric values are typically in the range of 0..100,
     *    and a metric value `3` means "3 percent").
     * * `10^2.%` indicates a metric contains a ratio, typically in the range
     *    0..1, that will be multiplied by 100 and displayed as a percentage
     *    (so a metric value `0.03` means "3 percent").
     * </pre>
     *
     * <code>string unit = 5;</code>
     * @param value The unit to set.
     * @return This builder for chaining.
     */
    public Builder setUnit(
        java.lang.String value) {
      copyOnWrite();
      instance.setUnit(value);
      return this;
    }
    /**
     * <pre>
     * The units in which the metric value is reported. It is only applicable
     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
     * defines the representation of the stored metric values.
     * Different systems may scale the values to be more easily displayed (so a
     * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
     * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
     * `KBy`, then the value of the metric is always in thousands of bytes, no
     * matter how it may be displayed..
     * If you want a custom metric to record the exact number of CPU-seconds used
     * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
     * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
     * CPU-seconds, then the value is written as `12005`.
     * Alternatively, if you want a custom metric to record data in a more
     * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
     * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
     * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
     * The supported units are a subset of [The Unified Code for Units of
     * Measure](http://unitsofmeasure.org/ucum.html) standard:
     * **Basic units (UNIT)**
     * * `bit`   bit
     * * `By`    byte
     * * `s`     second
     * * `min`   minute
     * * `h`     hour
     * * `d`     day
     * * `1`     dimensionless
     * **Prefixes (PREFIX)**
     * * `k`     kilo    (10^3)
     * * `M`     mega    (10^6)
     * * `G`     giga    (10^9)
     * * `T`     tera    (10^12)
     * * `P`     peta    (10^15)
     * * `E`     exa     (10^18)
     * * `Z`     zetta   (10^21)
     * * `Y`     yotta   (10^24)
     * * `m`     milli   (10^-3)
     * * `u`     micro   (10^-6)
     * * `n`     nano    (10^-9)
     * * `p`     pico    (10^-12)
     * * `f`     femto   (10^-15)
     * * `a`     atto    (10^-18)
     * * `z`     zepto   (10^-21)
     * * `y`     yocto   (10^-24)
     * * `Ki`    kibi    (2^10)
     * * `Mi`    mebi    (2^20)
     * * `Gi`    gibi    (2^30)
     * * `Ti`    tebi    (2^40)
     * * `Pi`    pebi    (2^50)
     * **Grammar**
     * The grammar also includes these connectors:
     * * `/`    division or ratio (as an infix operator). For examples,
     *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
     *          have `/s` in a metric `unit`; rates should always be computed at
     *          query time from the underlying cumulative or delta value).
     * * `.`    multiplication or composition (as an infix operator). For
     *          examples, `GBy.d` or `k{watt}.h`.
     * The grammar for a unit is as follows:
     *     Expression = Component { "." Component } { "/" Component } ;
     *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
     *               | Annotation
     *               | "1"
     *               ;
     *     Annotation = "{" NAME "}" ;
     * Notes:
     * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
     *    is used alone, then the unit is equivalent to `1`. For examples,
     *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
     * * `NAME` is a sequence of non-blank printable ASCII characters not
     *    containing `{` or `}`.
     * * `1` represents a unitary [dimensionless
     *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
     *    as in `1/s`. It is typically used when none of the basic units are
     *    appropriate. For example, "new users per day" can be represented as
     *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
     *    users). Alternatively, "thousands of page views per day" would be
     *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
     *    value of `5.3` would mean "5300 page views per day").
     * * `%` represents dimensionless value of 1/100, and annotates values giving
     *    a percentage (so the metric values are typically in the range of 0..100,
     *    and a metric value `3` means "3 percent").
     * * `10^2.%` indicates a metric contains a ratio, typically in the range
     *    0..1, that will be multiplied by 100 and displayed as a percentage
     *    (so a metric value `0.03` means "3 percent").
     * </pre>
     *
     * <code>string unit = 5;</code>
     * @return This builder for chaining.
     */
    public Builder clearUnit() {
      copyOnWrite();
      instance.clearUnit();
      return this;
    }
    /**
     * <pre>
     * The units in which the metric value is reported. It is only applicable
     * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
     * defines the representation of the stored metric values.
     * Different systems may scale the values to be more easily displayed (so a
     * value of `0.02KBy` _might_ be displayed as `20By`, and a value of
     * `3523KBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
     * `KBy`, then the value of the metric is always in thousands of bytes, no
     * matter how it may be displayed..
     * If you want a custom metric to record the exact number of CPU-seconds used
     * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
     * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
     * CPU-seconds, then the value is written as `12005`.
     * Alternatively, if you want a custom metric to record data in a more
     * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
     * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
     * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
     * The supported units are a subset of [The Unified Code for Units of
     * Measure](http://unitsofmeasure.org/ucum.html) standard:
     * **Basic units (UNIT)**
     * * `bit`   bit
     * * `By`    byte
     * * `s`     second
     * * `min`   minute
     * * `h`     hour
     * * `d`     day
     * * `1`     dimensionless
     * **Prefixes (PREFIX)**
     * * `k`     kilo    (10^3)
     * * `M`     mega    (10^6)
     * * `G`     giga    (10^9)
     * * `T`     tera    (10^12)
     * * `P`     peta    (10^15)
     * * `E`     exa     (10^18)
     * * `Z`     zetta   (10^21)
     * * `Y`     yotta   (10^24)
     * * `m`     milli   (10^-3)
     * * `u`     micro   (10^-6)
     * * `n`     nano    (10^-9)
     * * `p`     pico    (10^-12)
     * * `f`     femto   (10^-15)
     * * `a`     atto    (10^-18)
     * * `z`     zepto   (10^-21)
     * * `y`     yocto   (10^-24)
     * * `Ki`    kibi    (2^10)
     * * `Mi`    mebi    (2^20)
     * * `Gi`    gibi    (2^30)
     * * `Ti`    tebi    (2^40)
     * * `Pi`    pebi    (2^50)
     * **Grammar**
     * The grammar also includes these connectors:
     * * `/`    division or ratio (as an infix operator). For examples,
     *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
     *          have `/s` in a metric `unit`; rates should always be computed at
     *          query time from the underlying cumulative or delta value).
     * * `.`    multiplication or composition (as an infix operator). For
     *          examples, `GBy.d` or `k{watt}.h`.
     * The grammar for a unit is as follows:
     *     Expression = Component { "." Component } { "/" Component } ;
     *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
     *               | Annotation
     *               | "1"
     *               ;
     *     Annotation = "{" NAME "}" ;
     * Notes:
     * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
     *    is used alone, then the unit is equivalent to `1`. For examples,
     *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
     * * `NAME` is a sequence of non-blank printable ASCII characters not
     *    containing `{` or `}`.
     * * `1` represents a unitary [dimensionless
     *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
     *    as in `1/s`. It is typically used when none of the basic units are
     *    appropriate. For example, "new users per day" can be represented as
     *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
     *    users). Alternatively, "thousands of page views per day" would be
     *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
     *    value of `5.3` would mean "5300 page views per day").
     * * `%` represents dimensionless value of 1/100, and annotates values giving
     *    a percentage (so the metric values are typically in the range of 0..100,
     *    and a metric value `3` means "3 percent").
     * * `10^2.%` indicates a metric contains a ratio, typically in the range
     *    0..1, that will be multiplied by 100 and displayed as a percentage
     *    (so a metric value `0.03` means "3 percent").
     * </pre>
     *
     * <code>string unit = 5;</code>
     * @param value The bytes for unit to set.
     * @return This builder for chaining.
     */
    public Builder setUnitBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setUnitBytes(value);
      return this;
    }

    /**
     * <pre>
     * A detailed description of the metric, which can be used in documentation.
     * </pre>
     *
     * <code>string description = 6;</code>
     * @return The description.
     */
    @java.lang.Override
    public java.lang.String getDescription() {
      return instance.getDescription();
    }
    /**
     * <pre>
     * A detailed description of the metric, which can be used in documentation.
     * </pre>
     *
     * <code>string description = 6;</code>
     * @return The bytes for description.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDescriptionBytes() {
      return instance.getDescriptionBytes();
    }
    /**
     * <pre>
     * A detailed description of the metric, which can be used in documentation.
     * </pre>
     *
     * <code>string description = 6;</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>
     * A detailed description of the metric, which can be used in documentation.
     * </pre>
     *
     * <code>string description = 6;</code>
     * @return This builder for chaining.
     */
    public Builder clearDescription() {
      copyOnWrite();
      instance.clearDescription();
      return this;
    }
    /**
     * <pre>
     * A detailed description of the metric, which can be used in documentation.
     * </pre>
     *
     * <code>string description = 6;</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>
     * A concise name for the metric, which can be displayed in user interfaces.
     * Use sentence case without an ending period, for example "Request count".
     * This field is optional but it is recommended to be set for any metrics
     * associated with user-visible concepts, such as Quota.
     * </pre>
     *
     * <code>string display_name = 7;</code>
     * @return The displayName.
     */
    @java.lang.Override
    public java.lang.String getDisplayName() {
      return instance.getDisplayName();
    }
    /**
     * <pre>
     * A concise name for the metric, which can be displayed in user interfaces.
     * Use sentence case without an ending period, for example "Request count".
     * This field is optional but it is recommended to be set for any metrics
     * associated with user-visible concepts, such as Quota.
     * </pre>
     *
     * <code>string display_name = 7;</code>
     * @return The bytes for displayName.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getDisplayNameBytes() {
      return instance.getDisplayNameBytes();
    }
    /**
     * <pre>
     * A concise name for the metric, which can be displayed in user interfaces.
     * Use sentence case without an ending period, for example "Request count".
     * This field is optional but it is recommended to be set for any metrics
     * associated with user-visible concepts, such as Quota.
     * </pre>
     *
     * <code>string display_name = 7;</code>
     * @param value The displayName to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayName(
        java.lang.String value) {
      copyOnWrite();
      instance.setDisplayName(value);
      return this;
    }
    /**
     * <pre>
     * A concise name for the metric, which can be displayed in user interfaces.
     * Use sentence case without an ending period, for example "Request count".
     * This field is optional but it is recommended to be set for any metrics
     * associated with user-visible concepts, such as Quota.
     * </pre>
     *
     * <code>string display_name = 7;</code>
     * @return This builder for chaining.
     */
    public Builder clearDisplayName() {
      copyOnWrite();
      instance.clearDisplayName();
      return this;
    }
    /**
     * <pre>
     * A concise name for the metric, which can be displayed in user interfaces.
     * Use sentence case without an ending period, for example "Request count".
     * This field is optional but it is recommended to be set for any metrics
     * associated with user-visible concepts, such as Quota.
     * </pre>
     *
     * <code>string display_name = 7;</code>
     * @param value The bytes for displayName to set.
     * @return This builder for chaining.
     */
    public Builder setDisplayNameBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.setDisplayNameBytes(value);
      return this;
    }

    /**
     * <pre>
     * Optional. Metadata which can be used to guide usage of the metric.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
     */
    @java.lang.Override
    public boolean hasMetadata() {
      return instance.hasMetadata();
    }
    /**
     * <pre>
     * Optional. Metadata which can be used to guide usage of the metric.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
     */
    @java.lang.Override
    public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() {
      return instance.getMetadata();
    }
    /**
     * <pre>
     * Optional. Metadata which can be used to guide usage of the metric.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
     */
    public Builder setMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) {
      copyOnWrite();
      instance.setMetadata(value);
      return this;
      }
    /**
     * <pre>
     * Optional. Metadata which can be used to guide usage of the metric.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
     */
    public Builder setMetadata(
        com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder builderForValue) {
      copyOnWrite();
      instance.setMetadata(builderForValue.build());
      return this;
    }
    /**
     * <pre>
     * Optional. Metadata which can be used to guide usage of the metric.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
     */
    public Builder mergeMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) {
      copyOnWrite();
      instance.mergeMetadata(value);
      return this;
    }
    /**
     * <pre>
     * Optional. Metadata which can be used to guide usage of the metric.
     * </pre>
     *
     * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
     */
    public Builder clearMetadata() {  copyOnWrite();
      instance.clearMetadata();
      return this;
    }

    /**
     * <pre>
     * Optional. The launch stage of the metric definition.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 12;</code>
     * @return The enum numeric value on the wire for launchStage.
     */
    @java.lang.Override
    public int getLaunchStageValue() {
      return instance.getLaunchStageValue();
    }
    /**
     * <pre>
     * Optional. The launch stage of the metric definition.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 12;</code>
     * @param value The launchStage to set.
     * @return This builder for chaining.
     */
    public Builder setLaunchStageValue(int value) {
      copyOnWrite();
      instance.setLaunchStageValue(value);
      return this;
    }
    /**
     * <pre>
     * Optional. The launch stage of the metric definition.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 12;</code>
     * @return The launchStage.
     */
    @java.lang.Override
    public com.google.api.LaunchStage getLaunchStage() {
      return instance.getLaunchStage();
    }
    /**
     * <pre>
     * Optional. The launch stage of the metric definition.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 12;</code>
     * @param value The enum numeric value on the wire for launchStage to set.
     * @return This builder for chaining.
     */
    public Builder setLaunchStage(com.google.api.LaunchStage value) {
      copyOnWrite();
      instance.setLaunchStage(value);
      return this;
    }
    /**
     * <pre>
     * Optional. The launch stage of the metric definition.
     * </pre>
     *
     * <code>.google.api.LaunchStage launch_stage = 12;</code>
     * @return This builder for chaining.
     */
    public Builder clearLaunchStage() {
      copyOnWrite();
      instance.clearLaunchStage();
      return this;
    }

    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @return A list containing the monitoredResourceTypes.
     */
    @java.lang.Override
    public java.util.List<java.lang.String>
        getMonitoredResourceTypesList() {
      return java.util.Collections.unmodifiableList(
          instance.getMonitoredResourceTypesList());
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @return The count of monitoredResourceTypes.
     */
    @java.lang.Override
    public int getMonitoredResourceTypesCount() {
      return instance.getMonitoredResourceTypesCount();
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @param index The index of the element to return.
     * @return The monitoredResourceTypes at the given index.
     */
    @java.lang.Override
    public java.lang.String getMonitoredResourceTypes(int index) {
      return instance.getMonitoredResourceTypes(index);
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @param index The index of the value to return.
     * @return The bytes of the monitoredResourceTypes at the given index.
     */
    @java.lang.Override
    public com.google.protobuf.ByteString
        getMonitoredResourceTypesBytes(int index) {
      return instance.getMonitoredResourceTypesBytes(index);
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @param index The index to set the value at.
     * @param value The monitoredResourceTypes to set.
     * @return This builder for chaining.
     */
    public Builder setMonitoredResourceTypes(
        int index, java.lang.String value) {
      copyOnWrite();
      instance.setMonitoredResourceTypes(index, value);
      return this;
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @param value The monitoredResourceTypes to add.
     * @return This builder for chaining.
     */
    public Builder addMonitoredResourceTypes(
        java.lang.String value) {
      copyOnWrite();
      instance.addMonitoredResourceTypes(value);
      return this;
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @param values The monitoredResourceTypes to add.
     * @return This builder for chaining.
     */
    public Builder addAllMonitoredResourceTypes(
        java.lang.Iterable<java.lang.String> values) {
      copyOnWrite();
      instance.addAllMonitoredResourceTypes(values);
      return this;
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @return This builder for chaining.
     */
    public Builder clearMonitoredResourceTypes() {
      copyOnWrite();
      instance.clearMonitoredResourceTypes();
      return this;
    }
    /**
     * <pre>
     * Read-only. If present, then a [time
     * series][google.monitoring.v3.TimeSeries], which is identified partially by
     * a metric type and a [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that is associated
     * with this metric type can only be associated with one of the monitored
     * resource types listed here.
     * </pre>
     *
     * <code>repeated string monitored_resource_types = 13;</code>
     * @param value The bytes of the monitoredResourceTypes to add.
     * @return This builder for chaining.
     */
    public Builder addMonitoredResourceTypesBytes(
        com.google.protobuf.ByteString value) {
      copyOnWrite();
      instance.addMonitoredResourceTypesBytes(value);
      return this;
    }

    // @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor)
  }
  @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.MetricDescriptor();
      }
      case NEW_BUILDER: {
        return new Builder();
      }
      case BUILD_MESSAGE_INFO: {
          java.lang.Object[] objects = new java.lang.Object[] {
            "name_",
            "labels_",
            com.google.api.LabelDescriptor.class,
            "metricKind_",
            "valueType_",
            "unit_",
            "description_",
            "displayName_",
            "type_",
            "metadata_",
            "launchStage_",
            "monitoredResourceTypes_",
          };
          java.lang.String info =
              "\u0000\u000b\u0000\u0000\u0001\r\u000b\u0000\u0002\u0000\u0001\u0208\u0002\u001b" +
              "\u0003\f\u0004\f\u0005\u0208\u0006\u0208\u0007\u0208\b\u0208\n\t\f\f\r\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.MetricDescriptor> parser = PARSER;
        if (parser == null) {
          synchronized (com.google.api.MetricDescriptor.class) {
            parser = PARSER;
            if (parser == null) {
              parser =
                  new DefaultInstanceBasedParser<com.google.api.MetricDescriptor>(
                      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.MetricDescriptor)
  private static final com.google.api.MetricDescriptor DEFAULT_INSTANCE;
  static {
    MetricDescriptor defaultInstance = new MetricDescriptor();
    // New instances are implicitly immutable so no need to make
    // immutable.
    DEFAULT_INSTANCE = defaultInstance;
    com.google.protobuf.GeneratedMessageLite.registerDefaultInstance(
      MetricDescriptor.class, defaultInstance);
  }

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

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

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

