• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 Google LLC
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     https://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 // Generated by the protocol buffer compiler.  DO NOT EDIT!
17 // source: google/api/metric.proto
18 
19 package com.google.api;
20 
21 /**
22  *
23  *
24  * <pre>
25  * Defines a metric type and its schema. Once a metric descriptor is created,
26  * deleting or altering it stops data collection and makes the metric type's
27  * existing data unusable.
28  * </pre>
29  *
30  * Protobuf type {@code google.api.MetricDescriptor}
31  */
32 public final class MetricDescriptor extends com.google.protobuf.GeneratedMessageV3
33     implements
34     // @@protoc_insertion_point(message_implements:google.api.MetricDescriptor)
35     MetricDescriptorOrBuilder {
36   private static final long serialVersionUID = 0L;
37   // Use MetricDescriptor.newBuilder() to construct.
MetricDescriptor(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)38   private MetricDescriptor(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
39     super(builder);
40   }
41 
MetricDescriptor()42   private MetricDescriptor() {
43     name_ = "";
44     type_ = "";
45     labels_ = java.util.Collections.emptyList();
46     metricKind_ = 0;
47     valueType_ = 0;
48     unit_ = "";
49     description_ = "";
50     displayName_ = "";
51     launchStage_ = 0;
52     monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
53   }
54 
55   @java.lang.Override
56   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)57   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
58     return new MetricDescriptor();
59   }
60 
61   @java.lang.Override
getUnknownFields()62   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
63     return this.unknownFields;
64   }
65 
getDescriptor()66   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
67     return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
68   }
69 
70   @java.lang.Override
71   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()72       internalGetFieldAccessorTable() {
73     return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_fieldAccessorTable
74         .ensureFieldAccessorsInitialized(
75             com.google.api.MetricDescriptor.class, com.google.api.MetricDescriptor.Builder.class);
76   }
77 
78   /**
79    *
80    *
81    * <pre>
82    * The kind of measurement. It describes how the data is reported.
83    * For information on setting the start time and end time based on
84    * the MetricKind, see [TimeInterval][google.monitoring.v3.TimeInterval].
85    * </pre>
86    *
87    * Protobuf enum {@code google.api.MetricDescriptor.MetricKind}
88    */
89   public enum MetricKind implements com.google.protobuf.ProtocolMessageEnum {
90     /**
91      *
92      *
93      * <pre>
94      * Do not use this default value.
95      * </pre>
96      *
97      * <code>METRIC_KIND_UNSPECIFIED = 0;</code>
98      */
99     METRIC_KIND_UNSPECIFIED(0),
100     /**
101      *
102      *
103      * <pre>
104      * An instantaneous measurement of a value.
105      * </pre>
106      *
107      * <code>GAUGE = 1;</code>
108      */
109     GAUGE(1),
110     /**
111      *
112      *
113      * <pre>
114      * The change in a value during a time interval.
115      * </pre>
116      *
117      * <code>DELTA = 2;</code>
118      */
119     DELTA(2),
120     /**
121      *
122      *
123      * <pre>
124      * A value accumulated over a time interval.  Cumulative
125      * measurements in a time series should have the same start time
126      * and increasing end times, until an event resets the cumulative
127      * value to zero and sets a new start time for the following
128      * points.
129      * </pre>
130      *
131      * <code>CUMULATIVE = 3;</code>
132      */
133     CUMULATIVE(3),
134     UNRECOGNIZED(-1),
135     ;
136 
137     /**
138      *
139      *
140      * <pre>
141      * Do not use this default value.
142      * </pre>
143      *
144      * <code>METRIC_KIND_UNSPECIFIED = 0;</code>
145      */
146     public static final int METRIC_KIND_UNSPECIFIED_VALUE = 0;
147     /**
148      *
149      *
150      * <pre>
151      * An instantaneous measurement of a value.
152      * </pre>
153      *
154      * <code>GAUGE = 1;</code>
155      */
156     public static final int GAUGE_VALUE = 1;
157     /**
158      *
159      *
160      * <pre>
161      * The change in a value during a time interval.
162      * </pre>
163      *
164      * <code>DELTA = 2;</code>
165      */
166     public static final int DELTA_VALUE = 2;
167     /**
168      *
169      *
170      * <pre>
171      * A value accumulated over a time interval.  Cumulative
172      * measurements in a time series should have the same start time
173      * and increasing end times, until an event resets the cumulative
174      * value to zero and sets a new start time for the following
175      * points.
176      * </pre>
177      *
178      * <code>CUMULATIVE = 3;</code>
179      */
180     public static final int CUMULATIVE_VALUE = 3;
181 
getNumber()182     public final int getNumber() {
183       if (this == UNRECOGNIZED) {
184         throw new java.lang.IllegalArgumentException(
185             "Can't get the number of an unknown enum value.");
186       }
187       return value;
188     }
189 
190     /**
191      * @param value The numeric wire value of the corresponding enum entry.
192      * @return The enum associated with the given numeric wire value.
193      * @deprecated Use {@link #forNumber(int)} instead.
194      */
195     @java.lang.Deprecated
valueOf(int value)196     public static MetricKind valueOf(int value) {
197       return forNumber(value);
198     }
199 
200     /**
201      * @param value The numeric wire value of the corresponding enum entry.
202      * @return The enum associated with the given numeric wire value.
203      */
forNumber(int value)204     public static MetricKind forNumber(int value) {
205       switch (value) {
206         case 0:
207           return METRIC_KIND_UNSPECIFIED;
208         case 1:
209           return GAUGE;
210         case 2:
211           return DELTA;
212         case 3:
213           return CUMULATIVE;
214         default:
215           return null;
216       }
217     }
218 
internalGetValueMap()219     public static com.google.protobuf.Internal.EnumLiteMap<MetricKind> internalGetValueMap() {
220       return internalValueMap;
221     }
222 
223     private static final com.google.protobuf.Internal.EnumLiteMap<MetricKind> internalValueMap =
224         new com.google.protobuf.Internal.EnumLiteMap<MetricKind>() {
225           public MetricKind findValueByNumber(int number) {
226             return MetricKind.forNumber(number);
227           }
228         };
229 
getValueDescriptor()230     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
231       if (this == UNRECOGNIZED) {
232         throw new java.lang.IllegalStateException(
233             "Can't get the descriptor of an unrecognized enum value.");
234       }
235       return getDescriptor().getValues().get(ordinal());
236     }
237 
getDescriptorForType()238     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
239       return getDescriptor();
240     }
241 
getDescriptor()242     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
243       return com.google.api.MetricDescriptor.getDescriptor().getEnumTypes().get(0);
244     }
245 
246     private static final MetricKind[] VALUES = values();
247 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)248     public static MetricKind valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
249       if (desc.getType() != getDescriptor()) {
250         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
251       }
252       if (desc.getIndex() == -1) {
253         return UNRECOGNIZED;
254       }
255       return VALUES[desc.getIndex()];
256     }
257 
258     private final int value;
259 
MetricKind(int value)260     private MetricKind(int value) {
261       this.value = value;
262     }
263 
264     // @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.MetricKind)
265   }
266 
267   /**
268    *
269    *
270    * <pre>
271    * The value type of a metric.
272    * </pre>
273    *
274    * Protobuf enum {@code google.api.MetricDescriptor.ValueType}
275    */
276   public enum ValueType implements com.google.protobuf.ProtocolMessageEnum {
277     /**
278      *
279      *
280      * <pre>
281      * Do not use this default value.
282      * </pre>
283      *
284      * <code>VALUE_TYPE_UNSPECIFIED = 0;</code>
285      */
286     VALUE_TYPE_UNSPECIFIED(0),
287     /**
288      *
289      *
290      * <pre>
291      * The value is a boolean.
292      * This value type can be used only if the metric kind is `GAUGE`.
293      * </pre>
294      *
295      * <code>BOOL = 1;</code>
296      */
297     BOOL(1),
298     /**
299      *
300      *
301      * <pre>
302      * The value is a signed 64-bit integer.
303      * </pre>
304      *
305      * <code>INT64 = 2;</code>
306      */
307     INT64(2),
308     /**
309      *
310      *
311      * <pre>
312      * The value is a double precision floating point number.
313      * </pre>
314      *
315      * <code>DOUBLE = 3;</code>
316      */
317     DOUBLE(3),
318     /**
319      *
320      *
321      * <pre>
322      * The value is a text string.
323      * This value type can be used only if the metric kind is `GAUGE`.
324      * </pre>
325      *
326      * <code>STRING = 4;</code>
327      */
328     STRING(4),
329     /**
330      *
331      *
332      * <pre>
333      * The value is a [`Distribution`][google.api.Distribution].
334      * </pre>
335      *
336      * <code>DISTRIBUTION = 5;</code>
337      */
338     DISTRIBUTION(5),
339     /**
340      *
341      *
342      * <pre>
343      * The value is money.
344      * </pre>
345      *
346      * <code>MONEY = 6;</code>
347      */
348     MONEY(6),
349     UNRECOGNIZED(-1),
350     ;
351 
352     /**
353      *
354      *
355      * <pre>
356      * Do not use this default value.
357      * </pre>
358      *
359      * <code>VALUE_TYPE_UNSPECIFIED = 0;</code>
360      */
361     public static final int VALUE_TYPE_UNSPECIFIED_VALUE = 0;
362     /**
363      *
364      *
365      * <pre>
366      * The value is a boolean.
367      * This value type can be used only if the metric kind is `GAUGE`.
368      * </pre>
369      *
370      * <code>BOOL = 1;</code>
371      */
372     public static final int BOOL_VALUE = 1;
373     /**
374      *
375      *
376      * <pre>
377      * The value is a signed 64-bit integer.
378      * </pre>
379      *
380      * <code>INT64 = 2;</code>
381      */
382     public static final int INT64_VALUE = 2;
383     /**
384      *
385      *
386      * <pre>
387      * The value is a double precision floating point number.
388      * </pre>
389      *
390      * <code>DOUBLE = 3;</code>
391      */
392     public static final int DOUBLE_VALUE = 3;
393     /**
394      *
395      *
396      * <pre>
397      * The value is a text string.
398      * This value type can be used only if the metric kind is `GAUGE`.
399      * </pre>
400      *
401      * <code>STRING = 4;</code>
402      */
403     public static final int STRING_VALUE = 4;
404     /**
405      *
406      *
407      * <pre>
408      * The value is a [`Distribution`][google.api.Distribution].
409      * </pre>
410      *
411      * <code>DISTRIBUTION = 5;</code>
412      */
413     public static final int DISTRIBUTION_VALUE = 5;
414     /**
415      *
416      *
417      * <pre>
418      * The value is money.
419      * </pre>
420      *
421      * <code>MONEY = 6;</code>
422      */
423     public static final int MONEY_VALUE = 6;
424 
getNumber()425     public final int getNumber() {
426       if (this == UNRECOGNIZED) {
427         throw new java.lang.IllegalArgumentException(
428             "Can't get the number of an unknown enum value.");
429       }
430       return value;
431     }
432 
433     /**
434      * @param value The numeric wire value of the corresponding enum entry.
435      * @return The enum associated with the given numeric wire value.
436      * @deprecated Use {@link #forNumber(int)} instead.
437      */
438     @java.lang.Deprecated
valueOf(int value)439     public static ValueType valueOf(int value) {
440       return forNumber(value);
441     }
442 
443     /**
444      * @param value The numeric wire value of the corresponding enum entry.
445      * @return The enum associated with the given numeric wire value.
446      */
forNumber(int value)447     public static ValueType forNumber(int value) {
448       switch (value) {
449         case 0:
450           return VALUE_TYPE_UNSPECIFIED;
451         case 1:
452           return BOOL;
453         case 2:
454           return INT64;
455         case 3:
456           return DOUBLE;
457         case 4:
458           return STRING;
459         case 5:
460           return DISTRIBUTION;
461         case 6:
462           return MONEY;
463         default:
464           return null;
465       }
466     }
467 
internalGetValueMap()468     public static com.google.protobuf.Internal.EnumLiteMap<ValueType> internalGetValueMap() {
469       return internalValueMap;
470     }
471 
472     private static final com.google.protobuf.Internal.EnumLiteMap<ValueType> internalValueMap =
473         new com.google.protobuf.Internal.EnumLiteMap<ValueType>() {
474           public ValueType findValueByNumber(int number) {
475             return ValueType.forNumber(number);
476           }
477         };
478 
getValueDescriptor()479     public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
480       if (this == UNRECOGNIZED) {
481         throw new java.lang.IllegalStateException(
482             "Can't get the descriptor of an unrecognized enum value.");
483       }
484       return getDescriptor().getValues().get(ordinal());
485     }
486 
getDescriptorForType()487     public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
488       return getDescriptor();
489     }
490 
getDescriptor()491     public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
492       return com.google.api.MetricDescriptor.getDescriptor().getEnumTypes().get(1);
493     }
494 
495     private static final ValueType[] VALUES = values();
496 
valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)497     public static ValueType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
498       if (desc.getType() != getDescriptor()) {
499         throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
500       }
501       if (desc.getIndex() == -1) {
502         return UNRECOGNIZED;
503       }
504       return VALUES[desc.getIndex()];
505     }
506 
507     private final int value;
508 
ValueType(int value)509     private ValueType(int value) {
510       this.value = value;
511     }
512 
513     // @@protoc_insertion_point(enum_scope:google.api.MetricDescriptor.ValueType)
514   }
515 
516   public interface MetricDescriptorMetadataOrBuilder
517       extends
518       // @@protoc_insertion_point(interface_extends:google.api.MetricDescriptor.MetricDescriptorMetadata)
519       com.google.protobuf.MessageOrBuilder {
520 
521     /**
522      *
523      *
524      * <pre>
525      * Deprecated. Must use the
526      * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
527      * instead.
528      * </pre>
529      *
530      * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
531      *
532      * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated.
533      *     See google/api/metric.proto;l=85
534      * @return The enum numeric value on the wire for launchStage.
535      */
536     @java.lang.Deprecated
getLaunchStageValue()537     int getLaunchStageValue();
538     /**
539      *
540      *
541      * <pre>
542      * Deprecated. Must use the
543      * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
544      * instead.
545      * </pre>
546      *
547      * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
548      *
549      * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated.
550      *     See google/api/metric.proto;l=85
551      * @return The launchStage.
552      */
553     @java.lang.Deprecated
getLaunchStage()554     com.google.api.LaunchStage getLaunchStage();
555 
556     /**
557      *
558      *
559      * <pre>
560      * The sampling period of metric data points. For metrics which are written
561      * periodically, consecutive data points are stored at this time interval,
562      * excluding data loss due to errors. Metrics with a higher granularity have
563      * a smaller sampling period.
564      * </pre>
565      *
566      * <code>.google.protobuf.Duration sample_period = 2;</code>
567      *
568      * @return Whether the samplePeriod field is set.
569      */
hasSamplePeriod()570     boolean hasSamplePeriod();
571     /**
572      *
573      *
574      * <pre>
575      * The sampling period of metric data points. For metrics which are written
576      * periodically, consecutive data points are stored at this time interval,
577      * excluding data loss due to errors. Metrics with a higher granularity have
578      * a smaller sampling period.
579      * </pre>
580      *
581      * <code>.google.protobuf.Duration sample_period = 2;</code>
582      *
583      * @return The samplePeriod.
584      */
getSamplePeriod()585     com.google.protobuf.Duration getSamplePeriod();
586     /**
587      *
588      *
589      * <pre>
590      * The sampling period of metric data points. For metrics which are written
591      * periodically, consecutive data points are stored at this time interval,
592      * excluding data loss due to errors. Metrics with a higher granularity have
593      * a smaller sampling period.
594      * </pre>
595      *
596      * <code>.google.protobuf.Duration sample_period = 2;</code>
597      */
getSamplePeriodOrBuilder()598     com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder();
599 
600     /**
601      *
602      *
603      * <pre>
604      * The delay of data points caused by ingestion. Data points older than this
605      * age are guaranteed to be ingested and available to be read, excluding
606      * data loss due to errors.
607      * </pre>
608      *
609      * <code>.google.protobuf.Duration ingest_delay = 3;</code>
610      *
611      * @return Whether the ingestDelay field is set.
612      */
hasIngestDelay()613     boolean hasIngestDelay();
614     /**
615      *
616      *
617      * <pre>
618      * The delay of data points caused by ingestion. Data points older than this
619      * age are guaranteed to be ingested and available to be read, excluding
620      * data loss due to errors.
621      * </pre>
622      *
623      * <code>.google.protobuf.Duration ingest_delay = 3;</code>
624      *
625      * @return The ingestDelay.
626      */
getIngestDelay()627     com.google.protobuf.Duration getIngestDelay();
628     /**
629      *
630      *
631      * <pre>
632      * The delay of data points caused by ingestion. Data points older than this
633      * age are guaranteed to be ingested and available to be read, excluding
634      * data loss due to errors.
635      * </pre>
636      *
637      * <code>.google.protobuf.Duration ingest_delay = 3;</code>
638      */
getIngestDelayOrBuilder()639     com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder();
640   }
641   /**
642    *
643    *
644    * <pre>
645    * Additional annotations that can be used to guide the usage of a metric.
646    * </pre>
647    *
648    * Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata}
649    */
650   public static final class MetricDescriptorMetadata extends com.google.protobuf.GeneratedMessageV3
651       implements
652       // @@protoc_insertion_point(message_implements:google.api.MetricDescriptor.MetricDescriptorMetadata)
653       MetricDescriptorMetadataOrBuilder {
654     private static final long serialVersionUID = 0L;
655     // Use MetricDescriptorMetadata.newBuilder() to construct.
MetricDescriptorMetadata(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)656     private MetricDescriptorMetadata(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
657       super(builder);
658     }
659 
MetricDescriptorMetadata()660     private MetricDescriptorMetadata() {
661       launchStage_ = 0;
662     }
663 
664     @java.lang.Override
665     @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)666     protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
667       return new MetricDescriptorMetadata();
668     }
669 
670     @java.lang.Override
getUnknownFields()671     public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
672       return this.unknownFields;
673     }
674 
getDescriptor()675     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
676       return com.google.api.MetricProto
677           .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor;
678     }
679 
680     @java.lang.Override
681     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()682         internalGetFieldAccessorTable() {
683       return com.google.api.MetricProto
684           .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable
685           .ensureFieldAccessorsInitialized(
686               com.google.api.MetricDescriptor.MetricDescriptorMetadata.class,
687               com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder.class);
688     }
689 
690     public static final int LAUNCH_STAGE_FIELD_NUMBER = 1;
691     private int launchStage_ = 0;
692     /**
693      *
694      *
695      * <pre>
696      * Deprecated. Must use the
697      * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
698      * instead.
699      * </pre>
700      *
701      * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
702      *
703      * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated.
704      *     See google/api/metric.proto;l=85
705      * @return The enum numeric value on the wire for launchStage.
706      */
707     @java.lang.Override
708     @java.lang.Deprecated
getLaunchStageValue()709     public int getLaunchStageValue() {
710       return launchStage_;
711     }
712     /**
713      *
714      *
715      * <pre>
716      * Deprecated. Must use the
717      * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
718      * instead.
719      * </pre>
720      *
721      * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
722      *
723      * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is deprecated.
724      *     See google/api/metric.proto;l=85
725      * @return The launchStage.
726      */
727     @java.lang.Override
728     @java.lang.Deprecated
getLaunchStage()729     public com.google.api.LaunchStage getLaunchStage() {
730       com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_);
731       return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result;
732     }
733 
734     public static final int SAMPLE_PERIOD_FIELD_NUMBER = 2;
735     private com.google.protobuf.Duration samplePeriod_;
736     /**
737      *
738      *
739      * <pre>
740      * The sampling period of metric data points. For metrics which are written
741      * periodically, consecutive data points are stored at this time interval,
742      * excluding data loss due to errors. Metrics with a higher granularity have
743      * a smaller sampling period.
744      * </pre>
745      *
746      * <code>.google.protobuf.Duration sample_period = 2;</code>
747      *
748      * @return Whether the samplePeriod field is set.
749      */
750     @java.lang.Override
hasSamplePeriod()751     public boolean hasSamplePeriod() {
752       return samplePeriod_ != null;
753     }
754     /**
755      *
756      *
757      * <pre>
758      * The sampling period of metric data points. For metrics which are written
759      * periodically, consecutive data points are stored at this time interval,
760      * excluding data loss due to errors. Metrics with a higher granularity have
761      * a smaller sampling period.
762      * </pre>
763      *
764      * <code>.google.protobuf.Duration sample_period = 2;</code>
765      *
766      * @return The samplePeriod.
767      */
768     @java.lang.Override
getSamplePeriod()769     public com.google.protobuf.Duration getSamplePeriod() {
770       return samplePeriod_ == null
771           ? com.google.protobuf.Duration.getDefaultInstance()
772           : samplePeriod_;
773     }
774     /**
775      *
776      *
777      * <pre>
778      * The sampling period of metric data points. For metrics which are written
779      * periodically, consecutive data points are stored at this time interval,
780      * excluding data loss due to errors. Metrics with a higher granularity have
781      * a smaller sampling period.
782      * </pre>
783      *
784      * <code>.google.protobuf.Duration sample_period = 2;</code>
785      */
786     @java.lang.Override
getSamplePeriodOrBuilder()787     public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() {
788       return samplePeriod_ == null
789           ? com.google.protobuf.Duration.getDefaultInstance()
790           : samplePeriod_;
791     }
792 
793     public static final int INGEST_DELAY_FIELD_NUMBER = 3;
794     private com.google.protobuf.Duration ingestDelay_;
795     /**
796      *
797      *
798      * <pre>
799      * The delay of data points caused by ingestion. Data points older than this
800      * age are guaranteed to be ingested and available to be read, excluding
801      * data loss due to errors.
802      * </pre>
803      *
804      * <code>.google.protobuf.Duration ingest_delay = 3;</code>
805      *
806      * @return Whether the ingestDelay field is set.
807      */
808     @java.lang.Override
hasIngestDelay()809     public boolean hasIngestDelay() {
810       return ingestDelay_ != null;
811     }
812     /**
813      *
814      *
815      * <pre>
816      * The delay of data points caused by ingestion. Data points older than this
817      * age are guaranteed to be ingested and available to be read, excluding
818      * data loss due to errors.
819      * </pre>
820      *
821      * <code>.google.protobuf.Duration ingest_delay = 3;</code>
822      *
823      * @return The ingestDelay.
824      */
825     @java.lang.Override
getIngestDelay()826     public com.google.protobuf.Duration getIngestDelay() {
827       return ingestDelay_ == null
828           ? com.google.protobuf.Duration.getDefaultInstance()
829           : ingestDelay_;
830     }
831     /**
832      *
833      *
834      * <pre>
835      * The delay of data points caused by ingestion. Data points older than this
836      * age are guaranteed to be ingested and available to be read, excluding
837      * data loss due to errors.
838      * </pre>
839      *
840      * <code>.google.protobuf.Duration ingest_delay = 3;</code>
841      */
842     @java.lang.Override
getIngestDelayOrBuilder()843     public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() {
844       return ingestDelay_ == null
845           ? com.google.protobuf.Duration.getDefaultInstance()
846           : ingestDelay_;
847     }
848 
849     private byte memoizedIsInitialized = -1;
850 
851     @java.lang.Override
isInitialized()852     public final boolean isInitialized() {
853       byte isInitialized = memoizedIsInitialized;
854       if (isInitialized == 1) return true;
855       if (isInitialized == 0) return false;
856 
857       memoizedIsInitialized = 1;
858       return true;
859     }
860 
861     @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)862     public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
863       if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
864         output.writeEnum(1, launchStage_);
865       }
866       if (samplePeriod_ != null) {
867         output.writeMessage(2, getSamplePeriod());
868       }
869       if (ingestDelay_ != null) {
870         output.writeMessage(3, getIngestDelay());
871       }
872       getUnknownFields().writeTo(output);
873     }
874 
875     @java.lang.Override
getSerializedSize()876     public int getSerializedSize() {
877       int size = memoizedSize;
878       if (size != -1) return size;
879 
880       size = 0;
881       if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
882         size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, launchStage_);
883       }
884       if (samplePeriod_ != null) {
885         size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getSamplePeriod());
886       }
887       if (ingestDelay_ != null) {
888         size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getIngestDelay());
889       }
890       size += getUnknownFields().getSerializedSize();
891       memoizedSize = size;
892       return size;
893     }
894 
895     @java.lang.Override
equals(final java.lang.Object obj)896     public boolean equals(final java.lang.Object obj) {
897       if (obj == this) {
898         return true;
899       }
900       if (!(obj instanceof com.google.api.MetricDescriptor.MetricDescriptorMetadata)) {
901         return super.equals(obj);
902       }
903       com.google.api.MetricDescriptor.MetricDescriptorMetadata other =
904           (com.google.api.MetricDescriptor.MetricDescriptorMetadata) obj;
905 
906       if (launchStage_ != other.launchStage_) return false;
907       if (hasSamplePeriod() != other.hasSamplePeriod()) return false;
908       if (hasSamplePeriod()) {
909         if (!getSamplePeriod().equals(other.getSamplePeriod())) return false;
910       }
911       if (hasIngestDelay() != other.hasIngestDelay()) return false;
912       if (hasIngestDelay()) {
913         if (!getIngestDelay().equals(other.getIngestDelay())) return false;
914       }
915       if (!getUnknownFields().equals(other.getUnknownFields())) return false;
916       return true;
917     }
918 
919     @java.lang.Override
hashCode()920     public int hashCode() {
921       if (memoizedHashCode != 0) {
922         return memoizedHashCode;
923       }
924       int hash = 41;
925       hash = (19 * hash) + getDescriptor().hashCode();
926       hash = (37 * hash) + LAUNCH_STAGE_FIELD_NUMBER;
927       hash = (53 * hash) + launchStage_;
928       if (hasSamplePeriod()) {
929         hash = (37 * hash) + SAMPLE_PERIOD_FIELD_NUMBER;
930         hash = (53 * hash) + getSamplePeriod().hashCode();
931       }
932       if (hasIngestDelay()) {
933         hash = (37 * hash) + INGEST_DELAY_FIELD_NUMBER;
934         hash = (53 * hash) + getIngestDelay().hashCode();
935       }
936       hash = (29 * hash) + getUnknownFields().hashCode();
937       memoizedHashCode = hash;
938       return hash;
939     }
940 
parseFrom( java.nio.ByteBuffer data)941     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
942         java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
943       return PARSER.parseFrom(data);
944     }
945 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)946     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
947         java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
948         throws com.google.protobuf.InvalidProtocolBufferException {
949       return PARSER.parseFrom(data, extensionRegistry);
950     }
951 
parseFrom( com.google.protobuf.ByteString data)952     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
953         com.google.protobuf.ByteString data)
954         throws com.google.protobuf.InvalidProtocolBufferException {
955       return PARSER.parseFrom(data);
956     }
957 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)958     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
959         com.google.protobuf.ByteString data,
960         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
961         throws com.google.protobuf.InvalidProtocolBufferException {
962       return PARSER.parseFrom(data, extensionRegistry);
963     }
964 
parseFrom(byte[] data)965     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(byte[] data)
966         throws com.google.protobuf.InvalidProtocolBufferException {
967       return PARSER.parseFrom(data);
968     }
969 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)970     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
971         byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
972         throws com.google.protobuf.InvalidProtocolBufferException {
973       return PARSER.parseFrom(data, extensionRegistry);
974     }
975 
parseFrom( java.io.InputStream input)976     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
977         java.io.InputStream input) throws java.io.IOException {
978       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
979     }
980 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)981     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
982         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
983         throws java.io.IOException {
984       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
985           PARSER, input, extensionRegistry);
986     }
987 
parseDelimitedFrom( java.io.InputStream input)988     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseDelimitedFrom(
989         java.io.InputStream input) throws java.io.IOException {
990       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
991     }
992 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)993     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseDelimitedFrom(
994         java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
995         throws java.io.IOException {
996       return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
997           PARSER, input, extensionRegistry);
998     }
999 
parseFrom( com.google.protobuf.CodedInputStream input)1000     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
1001         com.google.protobuf.CodedInputStream input) throws java.io.IOException {
1002       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
1003     }
1004 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1005     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata parseFrom(
1006         com.google.protobuf.CodedInputStream input,
1007         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1008         throws java.io.IOException {
1009       return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
1010           PARSER, input, extensionRegistry);
1011     }
1012 
1013     @java.lang.Override
newBuilderForType()1014     public Builder newBuilderForType() {
1015       return newBuilder();
1016     }
1017 
newBuilder()1018     public static Builder newBuilder() {
1019       return DEFAULT_INSTANCE.toBuilder();
1020     }
1021 
newBuilder( com.google.api.MetricDescriptor.MetricDescriptorMetadata prototype)1022     public static Builder newBuilder(
1023         com.google.api.MetricDescriptor.MetricDescriptorMetadata prototype) {
1024       return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
1025     }
1026 
1027     @java.lang.Override
toBuilder()1028     public Builder toBuilder() {
1029       return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
1030     }
1031 
1032     @java.lang.Override
newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1033     protected Builder newBuilderForType(
1034         com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1035       Builder builder = new Builder(parent);
1036       return builder;
1037     }
1038     /**
1039      *
1040      *
1041      * <pre>
1042      * Additional annotations that can be used to guide the usage of a metric.
1043      * </pre>
1044      *
1045      * Protobuf type {@code google.api.MetricDescriptor.MetricDescriptorMetadata}
1046      */
1047     public static final class Builder
1048         extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
1049         implements
1050         // @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor.MetricDescriptorMetadata)
1051         com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder {
getDescriptor()1052       public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
1053         return com.google.api.MetricProto
1054             .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor;
1055       }
1056 
1057       @java.lang.Override
1058       protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()1059           internalGetFieldAccessorTable() {
1060         return com.google.api.MetricProto
1061             .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_fieldAccessorTable
1062             .ensureFieldAccessorsInitialized(
1063                 com.google.api.MetricDescriptor.MetricDescriptorMetadata.class,
1064                 com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder.class);
1065       }
1066 
1067       // Construct using com.google.api.MetricDescriptor.MetricDescriptorMetadata.newBuilder()
Builder()1068       private Builder() {}
1069 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1070       private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
1071         super(parent);
1072       }
1073 
1074       @java.lang.Override
clear()1075       public Builder clear() {
1076         super.clear();
1077         bitField0_ = 0;
1078         launchStage_ = 0;
1079         samplePeriod_ = null;
1080         if (samplePeriodBuilder_ != null) {
1081           samplePeriodBuilder_.dispose();
1082           samplePeriodBuilder_ = null;
1083         }
1084         ingestDelay_ = null;
1085         if (ingestDelayBuilder_ != null) {
1086           ingestDelayBuilder_.dispose();
1087           ingestDelayBuilder_ = null;
1088         }
1089         return this;
1090       }
1091 
1092       @java.lang.Override
getDescriptorForType()1093       public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
1094         return com.google.api.MetricProto
1095             .internal_static_google_api_MetricDescriptor_MetricDescriptorMetadata_descriptor;
1096       }
1097 
1098       @java.lang.Override
getDefaultInstanceForType()1099       public com.google.api.MetricDescriptor.MetricDescriptorMetadata getDefaultInstanceForType() {
1100         return com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance();
1101       }
1102 
1103       @java.lang.Override
build()1104       public com.google.api.MetricDescriptor.MetricDescriptorMetadata build() {
1105         com.google.api.MetricDescriptor.MetricDescriptorMetadata result = buildPartial();
1106         if (!result.isInitialized()) {
1107           throw newUninitializedMessageException(result);
1108         }
1109         return result;
1110       }
1111 
1112       @java.lang.Override
buildPartial()1113       public com.google.api.MetricDescriptor.MetricDescriptorMetadata buildPartial() {
1114         com.google.api.MetricDescriptor.MetricDescriptorMetadata result =
1115             new com.google.api.MetricDescriptor.MetricDescriptorMetadata(this);
1116         if (bitField0_ != 0) {
1117           buildPartial0(result);
1118         }
1119         onBuilt();
1120         return result;
1121       }
1122 
buildPartial0(com.google.api.MetricDescriptor.MetricDescriptorMetadata result)1123       private void buildPartial0(com.google.api.MetricDescriptor.MetricDescriptorMetadata result) {
1124         int from_bitField0_ = bitField0_;
1125         if (((from_bitField0_ & 0x00000001) != 0)) {
1126           result.launchStage_ = launchStage_;
1127         }
1128         if (((from_bitField0_ & 0x00000002) != 0)) {
1129           result.samplePeriod_ =
1130               samplePeriodBuilder_ == null ? samplePeriod_ : samplePeriodBuilder_.build();
1131         }
1132         if (((from_bitField0_ & 0x00000004) != 0)) {
1133           result.ingestDelay_ =
1134               ingestDelayBuilder_ == null ? ingestDelay_ : ingestDelayBuilder_.build();
1135         }
1136       }
1137 
1138       @java.lang.Override
clone()1139       public Builder clone() {
1140         return super.clone();
1141       }
1142 
1143       @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1144       public Builder setField(
1145           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1146         return super.setField(field, value);
1147       }
1148 
1149       @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1150       public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
1151         return super.clearField(field);
1152       }
1153 
1154       @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1155       public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
1156         return super.clearOneof(oneof);
1157       }
1158 
1159       @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1160       public Builder setRepeatedField(
1161           com.google.protobuf.Descriptors.FieldDescriptor field,
1162           int index,
1163           java.lang.Object value) {
1164         return super.setRepeatedField(field, index, value);
1165       }
1166 
1167       @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1168       public Builder addRepeatedField(
1169           com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
1170         return super.addRepeatedField(field, value);
1171       }
1172 
1173       @java.lang.Override
mergeFrom(com.google.protobuf.Message other)1174       public Builder mergeFrom(com.google.protobuf.Message other) {
1175         if (other instanceof com.google.api.MetricDescriptor.MetricDescriptorMetadata) {
1176           return mergeFrom((com.google.api.MetricDescriptor.MetricDescriptorMetadata) other);
1177         } else {
1178           super.mergeFrom(other);
1179           return this;
1180         }
1181       }
1182 
mergeFrom(com.google.api.MetricDescriptor.MetricDescriptorMetadata other)1183       public Builder mergeFrom(com.google.api.MetricDescriptor.MetricDescriptorMetadata other) {
1184         if (other == com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance())
1185           return this;
1186         if (other.launchStage_ != 0) {
1187           setLaunchStageValue(other.getLaunchStageValue());
1188         }
1189         if (other.hasSamplePeriod()) {
1190           mergeSamplePeriod(other.getSamplePeriod());
1191         }
1192         if (other.hasIngestDelay()) {
1193           mergeIngestDelay(other.getIngestDelay());
1194         }
1195         this.mergeUnknownFields(other.getUnknownFields());
1196         onChanged();
1197         return this;
1198       }
1199 
1200       @java.lang.Override
isInitialized()1201       public final boolean isInitialized() {
1202         return true;
1203       }
1204 
1205       @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1206       public Builder mergeFrom(
1207           com.google.protobuf.CodedInputStream input,
1208           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1209           throws java.io.IOException {
1210         if (extensionRegistry == null) {
1211           throw new java.lang.NullPointerException();
1212         }
1213         try {
1214           boolean done = false;
1215           while (!done) {
1216             int tag = input.readTag();
1217             switch (tag) {
1218               case 0:
1219                 done = true;
1220                 break;
1221               case 8:
1222                 {
1223                   launchStage_ = input.readEnum();
1224                   bitField0_ |= 0x00000001;
1225                   break;
1226                 } // case 8
1227               case 18:
1228                 {
1229                   input.readMessage(getSamplePeriodFieldBuilder().getBuilder(), extensionRegistry);
1230                   bitField0_ |= 0x00000002;
1231                   break;
1232                 } // case 18
1233               case 26:
1234                 {
1235                   input.readMessage(getIngestDelayFieldBuilder().getBuilder(), extensionRegistry);
1236                   bitField0_ |= 0x00000004;
1237                   break;
1238                 } // case 26
1239               default:
1240                 {
1241                   if (!super.parseUnknownField(input, extensionRegistry, tag)) {
1242                     done = true; // was an endgroup tag
1243                   }
1244                   break;
1245                 } // default:
1246             } // switch (tag)
1247           } // while (!done)
1248         } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1249           throw e.unwrapIOException();
1250         } finally {
1251           onChanged();
1252         } // finally
1253         return this;
1254       }
1255 
1256       private int bitField0_;
1257 
1258       private int launchStage_ = 0;
1259       /**
1260        *
1261        *
1262        * <pre>
1263        * Deprecated. Must use the
1264        * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
1265        * instead.
1266        * </pre>
1267        *
1268        * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
1269        *
1270        * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is
1271        *     deprecated. See google/api/metric.proto;l=85
1272        * @return The enum numeric value on the wire for launchStage.
1273        */
1274       @java.lang.Override
1275       @java.lang.Deprecated
getLaunchStageValue()1276       public int getLaunchStageValue() {
1277         return launchStage_;
1278       }
1279       /**
1280        *
1281        *
1282        * <pre>
1283        * Deprecated. Must use the
1284        * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
1285        * instead.
1286        * </pre>
1287        *
1288        * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
1289        *
1290        * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is
1291        *     deprecated. See google/api/metric.proto;l=85
1292        * @param value The enum numeric value on the wire for launchStage to set.
1293        * @return This builder for chaining.
1294        */
1295       @java.lang.Deprecated
setLaunchStageValue(int value)1296       public Builder setLaunchStageValue(int value) {
1297         launchStage_ = value;
1298         bitField0_ |= 0x00000001;
1299         onChanged();
1300         return this;
1301       }
1302       /**
1303        *
1304        *
1305        * <pre>
1306        * Deprecated. Must use the
1307        * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
1308        * instead.
1309        * </pre>
1310        *
1311        * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
1312        *
1313        * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is
1314        *     deprecated. See google/api/metric.proto;l=85
1315        * @return The launchStage.
1316        */
1317       @java.lang.Override
1318       @java.lang.Deprecated
getLaunchStage()1319       public com.google.api.LaunchStage getLaunchStage() {
1320         com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_);
1321         return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result;
1322       }
1323       /**
1324        *
1325        *
1326        * <pre>
1327        * Deprecated. Must use the
1328        * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
1329        * instead.
1330        * </pre>
1331        *
1332        * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
1333        *
1334        * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is
1335        *     deprecated. See google/api/metric.proto;l=85
1336        * @param value The launchStage to set.
1337        * @return This builder for chaining.
1338        */
1339       @java.lang.Deprecated
setLaunchStage(com.google.api.LaunchStage value)1340       public Builder setLaunchStage(com.google.api.LaunchStage value) {
1341         if (value == null) {
1342           throw new NullPointerException();
1343         }
1344         bitField0_ |= 0x00000001;
1345         launchStage_ = value.getNumber();
1346         onChanged();
1347         return this;
1348       }
1349       /**
1350        *
1351        *
1352        * <pre>
1353        * Deprecated. Must use the
1354        * [MetricDescriptor.launch_stage][google.api.MetricDescriptor.launch_stage]
1355        * instead.
1356        * </pre>
1357        *
1358        * <code>.google.api.LaunchStage launch_stage = 1 [deprecated = true];</code>
1359        *
1360        * @deprecated google.api.MetricDescriptor.MetricDescriptorMetadata.launch_stage is
1361        *     deprecated. See google/api/metric.proto;l=85
1362        * @return This builder for chaining.
1363        */
1364       @java.lang.Deprecated
clearLaunchStage()1365       public Builder clearLaunchStage() {
1366         bitField0_ = (bitField0_ & ~0x00000001);
1367         launchStage_ = 0;
1368         onChanged();
1369         return this;
1370       }
1371 
1372       private com.google.protobuf.Duration samplePeriod_;
1373       private com.google.protobuf.SingleFieldBuilderV3<
1374               com.google.protobuf.Duration,
1375               com.google.protobuf.Duration.Builder,
1376               com.google.protobuf.DurationOrBuilder>
1377           samplePeriodBuilder_;
1378       /**
1379        *
1380        *
1381        * <pre>
1382        * The sampling period of metric data points. For metrics which are written
1383        * periodically, consecutive data points are stored at this time interval,
1384        * excluding data loss due to errors. Metrics with a higher granularity have
1385        * a smaller sampling period.
1386        * </pre>
1387        *
1388        * <code>.google.protobuf.Duration sample_period = 2;</code>
1389        *
1390        * @return Whether the samplePeriod field is set.
1391        */
hasSamplePeriod()1392       public boolean hasSamplePeriod() {
1393         return ((bitField0_ & 0x00000002) != 0);
1394       }
1395       /**
1396        *
1397        *
1398        * <pre>
1399        * The sampling period of metric data points. For metrics which are written
1400        * periodically, consecutive data points are stored at this time interval,
1401        * excluding data loss due to errors. Metrics with a higher granularity have
1402        * a smaller sampling period.
1403        * </pre>
1404        *
1405        * <code>.google.protobuf.Duration sample_period = 2;</code>
1406        *
1407        * @return The samplePeriod.
1408        */
getSamplePeriod()1409       public com.google.protobuf.Duration getSamplePeriod() {
1410         if (samplePeriodBuilder_ == null) {
1411           return samplePeriod_ == null
1412               ? com.google.protobuf.Duration.getDefaultInstance()
1413               : samplePeriod_;
1414         } else {
1415           return samplePeriodBuilder_.getMessage();
1416         }
1417       }
1418       /**
1419        *
1420        *
1421        * <pre>
1422        * The sampling period of metric data points. For metrics which are written
1423        * periodically, consecutive data points are stored at this time interval,
1424        * excluding data loss due to errors. Metrics with a higher granularity have
1425        * a smaller sampling period.
1426        * </pre>
1427        *
1428        * <code>.google.protobuf.Duration sample_period = 2;</code>
1429        */
setSamplePeriod(com.google.protobuf.Duration value)1430       public Builder setSamplePeriod(com.google.protobuf.Duration value) {
1431         if (samplePeriodBuilder_ == null) {
1432           if (value == null) {
1433             throw new NullPointerException();
1434           }
1435           samplePeriod_ = value;
1436         } else {
1437           samplePeriodBuilder_.setMessage(value);
1438         }
1439         bitField0_ |= 0x00000002;
1440         onChanged();
1441         return this;
1442       }
1443       /**
1444        *
1445        *
1446        * <pre>
1447        * The sampling period of metric data points. For metrics which are written
1448        * periodically, consecutive data points are stored at this time interval,
1449        * excluding data loss due to errors. Metrics with a higher granularity have
1450        * a smaller sampling period.
1451        * </pre>
1452        *
1453        * <code>.google.protobuf.Duration sample_period = 2;</code>
1454        */
setSamplePeriod(com.google.protobuf.Duration.Builder builderForValue)1455       public Builder setSamplePeriod(com.google.protobuf.Duration.Builder builderForValue) {
1456         if (samplePeriodBuilder_ == null) {
1457           samplePeriod_ = builderForValue.build();
1458         } else {
1459           samplePeriodBuilder_.setMessage(builderForValue.build());
1460         }
1461         bitField0_ |= 0x00000002;
1462         onChanged();
1463         return this;
1464       }
1465       /**
1466        *
1467        *
1468        * <pre>
1469        * The sampling period of metric data points. For metrics which are written
1470        * periodically, consecutive data points are stored at this time interval,
1471        * excluding data loss due to errors. Metrics with a higher granularity have
1472        * a smaller sampling period.
1473        * </pre>
1474        *
1475        * <code>.google.protobuf.Duration sample_period = 2;</code>
1476        */
mergeSamplePeriod(com.google.protobuf.Duration value)1477       public Builder mergeSamplePeriod(com.google.protobuf.Duration value) {
1478         if (samplePeriodBuilder_ == null) {
1479           if (((bitField0_ & 0x00000002) != 0)
1480               && samplePeriod_ != null
1481               && samplePeriod_ != com.google.protobuf.Duration.getDefaultInstance()) {
1482             getSamplePeriodBuilder().mergeFrom(value);
1483           } else {
1484             samplePeriod_ = value;
1485           }
1486         } else {
1487           samplePeriodBuilder_.mergeFrom(value);
1488         }
1489         bitField0_ |= 0x00000002;
1490         onChanged();
1491         return this;
1492       }
1493       /**
1494        *
1495        *
1496        * <pre>
1497        * The sampling period of metric data points. For metrics which are written
1498        * periodically, consecutive data points are stored at this time interval,
1499        * excluding data loss due to errors. Metrics with a higher granularity have
1500        * a smaller sampling period.
1501        * </pre>
1502        *
1503        * <code>.google.protobuf.Duration sample_period = 2;</code>
1504        */
clearSamplePeriod()1505       public Builder clearSamplePeriod() {
1506         bitField0_ = (bitField0_ & ~0x00000002);
1507         samplePeriod_ = null;
1508         if (samplePeriodBuilder_ != null) {
1509           samplePeriodBuilder_.dispose();
1510           samplePeriodBuilder_ = null;
1511         }
1512         onChanged();
1513         return this;
1514       }
1515       /**
1516        *
1517        *
1518        * <pre>
1519        * The sampling period of metric data points. For metrics which are written
1520        * periodically, consecutive data points are stored at this time interval,
1521        * excluding data loss due to errors. Metrics with a higher granularity have
1522        * a smaller sampling period.
1523        * </pre>
1524        *
1525        * <code>.google.protobuf.Duration sample_period = 2;</code>
1526        */
getSamplePeriodBuilder()1527       public com.google.protobuf.Duration.Builder getSamplePeriodBuilder() {
1528         bitField0_ |= 0x00000002;
1529         onChanged();
1530         return getSamplePeriodFieldBuilder().getBuilder();
1531       }
1532       /**
1533        *
1534        *
1535        * <pre>
1536        * The sampling period of metric data points. For metrics which are written
1537        * periodically, consecutive data points are stored at this time interval,
1538        * excluding data loss due to errors. Metrics with a higher granularity have
1539        * a smaller sampling period.
1540        * </pre>
1541        *
1542        * <code>.google.protobuf.Duration sample_period = 2;</code>
1543        */
getSamplePeriodOrBuilder()1544       public com.google.protobuf.DurationOrBuilder getSamplePeriodOrBuilder() {
1545         if (samplePeriodBuilder_ != null) {
1546           return samplePeriodBuilder_.getMessageOrBuilder();
1547         } else {
1548           return samplePeriod_ == null
1549               ? com.google.protobuf.Duration.getDefaultInstance()
1550               : samplePeriod_;
1551         }
1552       }
1553       /**
1554        *
1555        *
1556        * <pre>
1557        * The sampling period of metric data points. For metrics which are written
1558        * periodically, consecutive data points are stored at this time interval,
1559        * excluding data loss due to errors. Metrics with a higher granularity have
1560        * a smaller sampling period.
1561        * </pre>
1562        *
1563        * <code>.google.protobuf.Duration sample_period = 2;</code>
1564        */
1565       private com.google.protobuf.SingleFieldBuilderV3<
1566               com.google.protobuf.Duration,
1567               com.google.protobuf.Duration.Builder,
1568               com.google.protobuf.DurationOrBuilder>
getSamplePeriodFieldBuilder()1569           getSamplePeriodFieldBuilder() {
1570         if (samplePeriodBuilder_ == null) {
1571           samplePeriodBuilder_ =
1572               new com.google.protobuf.SingleFieldBuilderV3<
1573                   com.google.protobuf.Duration,
1574                   com.google.protobuf.Duration.Builder,
1575                   com.google.protobuf.DurationOrBuilder>(
1576                   getSamplePeriod(), getParentForChildren(), isClean());
1577           samplePeriod_ = null;
1578         }
1579         return samplePeriodBuilder_;
1580       }
1581 
1582       private com.google.protobuf.Duration ingestDelay_;
1583       private com.google.protobuf.SingleFieldBuilderV3<
1584               com.google.protobuf.Duration,
1585               com.google.protobuf.Duration.Builder,
1586               com.google.protobuf.DurationOrBuilder>
1587           ingestDelayBuilder_;
1588       /**
1589        *
1590        *
1591        * <pre>
1592        * The delay of data points caused by ingestion. Data points older than this
1593        * age are guaranteed to be ingested and available to be read, excluding
1594        * data loss due to errors.
1595        * </pre>
1596        *
1597        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1598        *
1599        * @return Whether the ingestDelay field is set.
1600        */
hasIngestDelay()1601       public boolean hasIngestDelay() {
1602         return ((bitField0_ & 0x00000004) != 0);
1603       }
1604       /**
1605        *
1606        *
1607        * <pre>
1608        * The delay of data points caused by ingestion. Data points older than this
1609        * age are guaranteed to be ingested and available to be read, excluding
1610        * data loss due to errors.
1611        * </pre>
1612        *
1613        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1614        *
1615        * @return The ingestDelay.
1616        */
getIngestDelay()1617       public com.google.protobuf.Duration getIngestDelay() {
1618         if (ingestDelayBuilder_ == null) {
1619           return ingestDelay_ == null
1620               ? com.google.protobuf.Duration.getDefaultInstance()
1621               : ingestDelay_;
1622         } else {
1623           return ingestDelayBuilder_.getMessage();
1624         }
1625       }
1626       /**
1627        *
1628        *
1629        * <pre>
1630        * The delay of data points caused by ingestion. Data points older than this
1631        * age are guaranteed to be ingested and available to be read, excluding
1632        * data loss due to errors.
1633        * </pre>
1634        *
1635        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1636        */
setIngestDelay(com.google.protobuf.Duration value)1637       public Builder setIngestDelay(com.google.protobuf.Duration value) {
1638         if (ingestDelayBuilder_ == null) {
1639           if (value == null) {
1640             throw new NullPointerException();
1641           }
1642           ingestDelay_ = value;
1643         } else {
1644           ingestDelayBuilder_.setMessage(value);
1645         }
1646         bitField0_ |= 0x00000004;
1647         onChanged();
1648         return this;
1649       }
1650       /**
1651        *
1652        *
1653        * <pre>
1654        * The delay of data points caused by ingestion. Data points older than this
1655        * age are guaranteed to be ingested and available to be read, excluding
1656        * data loss due to errors.
1657        * </pre>
1658        *
1659        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1660        */
setIngestDelay(com.google.protobuf.Duration.Builder builderForValue)1661       public Builder setIngestDelay(com.google.protobuf.Duration.Builder builderForValue) {
1662         if (ingestDelayBuilder_ == null) {
1663           ingestDelay_ = builderForValue.build();
1664         } else {
1665           ingestDelayBuilder_.setMessage(builderForValue.build());
1666         }
1667         bitField0_ |= 0x00000004;
1668         onChanged();
1669         return this;
1670       }
1671       /**
1672        *
1673        *
1674        * <pre>
1675        * The delay of data points caused by ingestion. Data points older than this
1676        * age are guaranteed to be ingested and available to be read, excluding
1677        * data loss due to errors.
1678        * </pre>
1679        *
1680        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1681        */
mergeIngestDelay(com.google.protobuf.Duration value)1682       public Builder mergeIngestDelay(com.google.protobuf.Duration value) {
1683         if (ingestDelayBuilder_ == null) {
1684           if (((bitField0_ & 0x00000004) != 0)
1685               && ingestDelay_ != null
1686               && ingestDelay_ != com.google.protobuf.Duration.getDefaultInstance()) {
1687             getIngestDelayBuilder().mergeFrom(value);
1688           } else {
1689             ingestDelay_ = value;
1690           }
1691         } else {
1692           ingestDelayBuilder_.mergeFrom(value);
1693         }
1694         bitField0_ |= 0x00000004;
1695         onChanged();
1696         return this;
1697       }
1698       /**
1699        *
1700        *
1701        * <pre>
1702        * The delay of data points caused by ingestion. Data points older than this
1703        * age are guaranteed to be ingested and available to be read, excluding
1704        * data loss due to errors.
1705        * </pre>
1706        *
1707        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1708        */
clearIngestDelay()1709       public Builder clearIngestDelay() {
1710         bitField0_ = (bitField0_ & ~0x00000004);
1711         ingestDelay_ = null;
1712         if (ingestDelayBuilder_ != null) {
1713           ingestDelayBuilder_.dispose();
1714           ingestDelayBuilder_ = null;
1715         }
1716         onChanged();
1717         return this;
1718       }
1719       /**
1720        *
1721        *
1722        * <pre>
1723        * The delay of data points caused by ingestion. Data points older than this
1724        * age are guaranteed to be ingested and available to be read, excluding
1725        * data loss due to errors.
1726        * </pre>
1727        *
1728        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1729        */
getIngestDelayBuilder()1730       public com.google.protobuf.Duration.Builder getIngestDelayBuilder() {
1731         bitField0_ |= 0x00000004;
1732         onChanged();
1733         return getIngestDelayFieldBuilder().getBuilder();
1734       }
1735       /**
1736        *
1737        *
1738        * <pre>
1739        * The delay of data points caused by ingestion. Data points older than this
1740        * age are guaranteed to be ingested and available to be read, excluding
1741        * data loss due to errors.
1742        * </pre>
1743        *
1744        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1745        */
getIngestDelayOrBuilder()1746       public com.google.protobuf.DurationOrBuilder getIngestDelayOrBuilder() {
1747         if (ingestDelayBuilder_ != null) {
1748           return ingestDelayBuilder_.getMessageOrBuilder();
1749         } else {
1750           return ingestDelay_ == null
1751               ? com.google.protobuf.Duration.getDefaultInstance()
1752               : ingestDelay_;
1753         }
1754       }
1755       /**
1756        *
1757        *
1758        * <pre>
1759        * The delay of data points caused by ingestion. Data points older than this
1760        * age are guaranteed to be ingested and available to be read, excluding
1761        * data loss due to errors.
1762        * </pre>
1763        *
1764        * <code>.google.protobuf.Duration ingest_delay = 3;</code>
1765        */
1766       private com.google.protobuf.SingleFieldBuilderV3<
1767               com.google.protobuf.Duration,
1768               com.google.protobuf.Duration.Builder,
1769               com.google.protobuf.DurationOrBuilder>
getIngestDelayFieldBuilder()1770           getIngestDelayFieldBuilder() {
1771         if (ingestDelayBuilder_ == null) {
1772           ingestDelayBuilder_ =
1773               new com.google.protobuf.SingleFieldBuilderV3<
1774                   com.google.protobuf.Duration,
1775                   com.google.protobuf.Duration.Builder,
1776                   com.google.protobuf.DurationOrBuilder>(
1777                   getIngestDelay(), getParentForChildren(), isClean());
1778           ingestDelay_ = null;
1779         }
1780         return ingestDelayBuilder_;
1781       }
1782 
1783       @java.lang.Override
setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1784       public final Builder setUnknownFields(
1785           final com.google.protobuf.UnknownFieldSet unknownFields) {
1786         return super.setUnknownFields(unknownFields);
1787       }
1788 
1789       @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1790       public final Builder mergeUnknownFields(
1791           final com.google.protobuf.UnknownFieldSet unknownFields) {
1792         return super.mergeUnknownFields(unknownFields);
1793       }
1794 
1795       // @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor.MetricDescriptorMetadata)
1796     }
1797 
1798     // @@protoc_insertion_point(class_scope:google.api.MetricDescriptor.MetricDescriptorMetadata)
1799     private static final com.google.api.MetricDescriptor.MetricDescriptorMetadata DEFAULT_INSTANCE;
1800 
1801     static {
1802       DEFAULT_INSTANCE = new com.google.api.MetricDescriptor.MetricDescriptorMetadata();
1803     }
1804 
getDefaultInstance()1805     public static com.google.api.MetricDescriptor.MetricDescriptorMetadata getDefaultInstance() {
1806       return DEFAULT_INSTANCE;
1807     }
1808 
1809     private static final com.google.protobuf.Parser<MetricDescriptorMetadata> PARSER =
1810         new com.google.protobuf.AbstractParser<MetricDescriptorMetadata>() {
1811           @java.lang.Override
1812           public MetricDescriptorMetadata parsePartialFrom(
1813               com.google.protobuf.CodedInputStream input,
1814               com.google.protobuf.ExtensionRegistryLite extensionRegistry)
1815               throws com.google.protobuf.InvalidProtocolBufferException {
1816             Builder builder = newBuilder();
1817             try {
1818               builder.mergeFrom(input, extensionRegistry);
1819             } catch (com.google.protobuf.InvalidProtocolBufferException e) {
1820               throw e.setUnfinishedMessage(builder.buildPartial());
1821             } catch (com.google.protobuf.UninitializedMessageException e) {
1822               throw e.asInvalidProtocolBufferException()
1823                   .setUnfinishedMessage(builder.buildPartial());
1824             } catch (java.io.IOException e) {
1825               throw new com.google.protobuf.InvalidProtocolBufferException(e)
1826                   .setUnfinishedMessage(builder.buildPartial());
1827             }
1828             return builder.buildPartial();
1829           }
1830         };
1831 
parser()1832     public static com.google.protobuf.Parser<MetricDescriptorMetadata> parser() {
1833       return PARSER;
1834     }
1835 
1836     @java.lang.Override
getParserForType()1837     public com.google.protobuf.Parser<MetricDescriptorMetadata> getParserForType() {
1838       return PARSER;
1839     }
1840 
1841     @java.lang.Override
getDefaultInstanceForType()1842     public com.google.api.MetricDescriptor.MetricDescriptorMetadata getDefaultInstanceForType() {
1843       return DEFAULT_INSTANCE;
1844     }
1845   }
1846 
1847   public static final int NAME_FIELD_NUMBER = 1;
1848 
1849   @SuppressWarnings("serial")
1850   private volatile java.lang.Object name_ = "";
1851   /**
1852    *
1853    *
1854    * <pre>
1855    * The resource name of the metric descriptor.
1856    * </pre>
1857    *
1858    * <code>string name = 1;</code>
1859    *
1860    * @return The name.
1861    */
1862   @java.lang.Override
getName()1863   public java.lang.String getName() {
1864     java.lang.Object ref = name_;
1865     if (ref instanceof java.lang.String) {
1866       return (java.lang.String) ref;
1867     } else {
1868       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1869       java.lang.String s = bs.toStringUtf8();
1870       name_ = s;
1871       return s;
1872     }
1873   }
1874   /**
1875    *
1876    *
1877    * <pre>
1878    * The resource name of the metric descriptor.
1879    * </pre>
1880    *
1881    * <code>string name = 1;</code>
1882    *
1883    * @return The bytes for name.
1884    */
1885   @java.lang.Override
getNameBytes()1886   public com.google.protobuf.ByteString getNameBytes() {
1887     java.lang.Object ref = name_;
1888     if (ref instanceof java.lang.String) {
1889       com.google.protobuf.ByteString b =
1890           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1891       name_ = b;
1892       return b;
1893     } else {
1894       return (com.google.protobuf.ByteString) ref;
1895     }
1896   }
1897 
1898   public static final int TYPE_FIELD_NUMBER = 8;
1899 
1900   @SuppressWarnings("serial")
1901   private volatile java.lang.Object type_ = "";
1902   /**
1903    *
1904    *
1905    * <pre>
1906    * The metric type, including its DNS name prefix. The type is not
1907    * URL-encoded. All user-defined metric types have the DNS name
1908    * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
1909    * use a natural hierarchical grouping. For example:
1910    *     "custom.googleapis.com/invoice/paid/amount"
1911    *     "external.googleapis.com/prometheus/up"
1912    *     "appengine.googleapis.com/http/server/response_latencies"
1913    * </pre>
1914    *
1915    * <code>string type = 8;</code>
1916    *
1917    * @return The type.
1918    */
1919   @java.lang.Override
getType()1920   public java.lang.String getType() {
1921     java.lang.Object ref = type_;
1922     if (ref instanceof java.lang.String) {
1923       return (java.lang.String) ref;
1924     } else {
1925       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
1926       java.lang.String s = bs.toStringUtf8();
1927       type_ = s;
1928       return s;
1929     }
1930   }
1931   /**
1932    *
1933    *
1934    * <pre>
1935    * The metric type, including its DNS name prefix. The type is not
1936    * URL-encoded. All user-defined metric types have the DNS name
1937    * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
1938    * use a natural hierarchical grouping. For example:
1939    *     "custom.googleapis.com/invoice/paid/amount"
1940    *     "external.googleapis.com/prometheus/up"
1941    *     "appengine.googleapis.com/http/server/response_latencies"
1942    * </pre>
1943    *
1944    * <code>string type = 8;</code>
1945    *
1946    * @return The bytes for type.
1947    */
1948   @java.lang.Override
getTypeBytes()1949   public com.google.protobuf.ByteString getTypeBytes() {
1950     java.lang.Object ref = type_;
1951     if (ref instanceof java.lang.String) {
1952       com.google.protobuf.ByteString b =
1953           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
1954       type_ = b;
1955       return b;
1956     } else {
1957       return (com.google.protobuf.ByteString) ref;
1958     }
1959   }
1960 
1961   public static final int LABELS_FIELD_NUMBER = 2;
1962 
1963   @SuppressWarnings("serial")
1964   private java.util.List<com.google.api.LabelDescriptor> labels_;
1965   /**
1966    *
1967    *
1968    * <pre>
1969    * The set of labels that can be used to describe a specific
1970    * instance of this metric type. For example, the
1971    * `appengine.googleapis.com/http/server/response_latencies` metric
1972    * type has a label for the HTTP response code, `response_code`, so
1973    * you can look at latencies for successful responses or just
1974    * for responses that failed.
1975    * </pre>
1976    *
1977    * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
1978    */
1979   @java.lang.Override
getLabelsList()1980   public java.util.List<com.google.api.LabelDescriptor> getLabelsList() {
1981     return labels_;
1982   }
1983   /**
1984    *
1985    *
1986    * <pre>
1987    * The set of labels that can be used to describe a specific
1988    * instance of this metric type. For example, the
1989    * `appengine.googleapis.com/http/server/response_latencies` metric
1990    * type has a label for the HTTP response code, `response_code`, so
1991    * you can look at latencies for successful responses or just
1992    * for responses that failed.
1993    * </pre>
1994    *
1995    * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
1996    */
1997   @java.lang.Override
1998   public java.util.List<? extends com.google.api.LabelDescriptorOrBuilder>
getLabelsOrBuilderList()1999       getLabelsOrBuilderList() {
2000     return labels_;
2001   }
2002   /**
2003    *
2004    *
2005    * <pre>
2006    * The set of labels that can be used to describe a specific
2007    * instance of this metric type. For example, the
2008    * `appengine.googleapis.com/http/server/response_latencies` metric
2009    * type has a label for the HTTP response code, `response_code`, so
2010    * you can look at latencies for successful responses or just
2011    * for responses that failed.
2012    * </pre>
2013    *
2014    * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
2015    */
2016   @java.lang.Override
getLabelsCount()2017   public int getLabelsCount() {
2018     return labels_.size();
2019   }
2020   /**
2021    *
2022    *
2023    * <pre>
2024    * The set of labels that can be used to describe a specific
2025    * instance of this metric type. For example, the
2026    * `appengine.googleapis.com/http/server/response_latencies` metric
2027    * type has a label for the HTTP response code, `response_code`, so
2028    * you can look at latencies for successful responses or just
2029    * for responses that failed.
2030    * </pre>
2031    *
2032    * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
2033    */
2034   @java.lang.Override
getLabels(int index)2035   public com.google.api.LabelDescriptor getLabels(int index) {
2036     return labels_.get(index);
2037   }
2038   /**
2039    *
2040    *
2041    * <pre>
2042    * The set of labels that can be used to describe a specific
2043    * instance of this metric type. For example, the
2044    * `appengine.googleapis.com/http/server/response_latencies` metric
2045    * type has a label for the HTTP response code, `response_code`, so
2046    * you can look at latencies for successful responses or just
2047    * for responses that failed.
2048    * </pre>
2049    *
2050    * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
2051    */
2052   @java.lang.Override
getLabelsOrBuilder(int index)2053   public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) {
2054     return labels_.get(index);
2055   }
2056 
2057   public static final int METRIC_KIND_FIELD_NUMBER = 3;
2058   private int metricKind_ = 0;
2059   /**
2060    *
2061    *
2062    * <pre>
2063    * Whether the metric records instantaneous values, changes to a value, etc.
2064    * Some combinations of `metric_kind` and `value_type` might not be supported.
2065    * </pre>
2066    *
2067    * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
2068    *
2069    * @return The enum numeric value on the wire for metricKind.
2070    */
2071   @java.lang.Override
getMetricKindValue()2072   public int getMetricKindValue() {
2073     return metricKind_;
2074   }
2075   /**
2076    *
2077    *
2078    * <pre>
2079    * Whether the metric records instantaneous values, changes to a value, etc.
2080    * Some combinations of `metric_kind` and `value_type` might not be supported.
2081    * </pre>
2082    *
2083    * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
2084    *
2085    * @return The metricKind.
2086    */
2087   @java.lang.Override
getMetricKind()2088   public com.google.api.MetricDescriptor.MetricKind getMetricKind() {
2089     com.google.api.MetricDescriptor.MetricKind result =
2090         com.google.api.MetricDescriptor.MetricKind.forNumber(metricKind_);
2091     return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result;
2092   }
2093 
2094   public static final int VALUE_TYPE_FIELD_NUMBER = 4;
2095   private int valueType_ = 0;
2096   /**
2097    *
2098    *
2099    * <pre>
2100    * Whether the measurement is an integer, a floating-point number, etc.
2101    * Some combinations of `metric_kind` and `value_type` might not be supported.
2102    * </pre>
2103    *
2104    * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
2105    *
2106    * @return The enum numeric value on the wire for valueType.
2107    */
2108   @java.lang.Override
getValueTypeValue()2109   public int getValueTypeValue() {
2110     return valueType_;
2111   }
2112   /**
2113    *
2114    *
2115    * <pre>
2116    * Whether the measurement is an integer, a floating-point number, etc.
2117    * Some combinations of `metric_kind` and `value_type` might not be supported.
2118    * </pre>
2119    *
2120    * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
2121    *
2122    * @return The valueType.
2123    */
2124   @java.lang.Override
getValueType()2125   public com.google.api.MetricDescriptor.ValueType getValueType() {
2126     com.google.api.MetricDescriptor.ValueType result =
2127         com.google.api.MetricDescriptor.ValueType.forNumber(valueType_);
2128     return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result;
2129   }
2130 
2131   public static final int UNIT_FIELD_NUMBER = 5;
2132 
2133   @SuppressWarnings("serial")
2134   private volatile java.lang.Object unit_ = "";
2135   /**
2136    *
2137    *
2138    * <pre>
2139    * The units in which the metric value is reported. It is only applicable
2140    * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
2141    * defines the representation of the stored metric values.
2142    * Different systems might scale the values to be more easily displayed (so a
2143    * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
2144    * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
2145    * `kBy`, then the value of the metric is always in thousands of bytes, no
2146    * matter how it might be displayed.
2147    * If you want a custom metric to record the exact number of CPU-seconds used
2148    * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
2149    * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
2150    * CPU-seconds, then the value is written as `12005`.
2151    * Alternatively, if you want a custom metric to record data in a more
2152    * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
2153    * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
2154    * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
2155    * The supported units are a subset of [The Unified Code for Units of
2156    * Measure](https://unitsofmeasure.org/ucum.html) standard:
2157    * **Basic units (UNIT)**
2158    * * `bit`   bit
2159    * * `By`    byte
2160    * * `s`     second
2161    * * `min`   minute
2162    * * `h`     hour
2163    * * `d`     day
2164    * * `1`     dimensionless
2165    * **Prefixes (PREFIX)**
2166    * * `k`     kilo    (10^3)
2167    * * `M`     mega    (10^6)
2168    * * `G`     giga    (10^9)
2169    * * `T`     tera    (10^12)
2170    * * `P`     peta    (10^15)
2171    * * `E`     exa     (10^18)
2172    * * `Z`     zetta   (10^21)
2173    * * `Y`     yotta   (10^24)
2174    * * `m`     milli   (10^-3)
2175    * * `u`     micro   (10^-6)
2176    * * `n`     nano    (10^-9)
2177    * * `p`     pico    (10^-12)
2178    * * `f`     femto   (10^-15)
2179    * * `a`     atto    (10^-18)
2180    * * `z`     zepto   (10^-21)
2181    * * `y`     yocto   (10^-24)
2182    * * `Ki`    kibi    (2^10)
2183    * * `Mi`    mebi    (2^20)
2184    * * `Gi`    gibi    (2^30)
2185    * * `Ti`    tebi    (2^40)
2186    * * `Pi`    pebi    (2^50)
2187    * **Grammar**
2188    * The grammar also includes these connectors:
2189    * * `/`    division or ratio (as an infix operator). For examples,
2190    *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
2191    *          have `/s` in a metric `unit`; rates should always be computed at
2192    *          query time from the underlying cumulative or delta value).
2193    * * `.`    multiplication or composition (as an infix operator). For
2194    *          examples, `GBy.d` or `k{watt}.h`.
2195    * The grammar for a unit is as follows:
2196    *     Expression = Component { "." Component } { "/" Component } ;
2197    *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
2198    *               | Annotation
2199    *               | "1"
2200    *               ;
2201    *     Annotation = "{" NAME "}" ;
2202    * Notes:
2203    * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
2204    *    is used alone, then the unit is equivalent to `1`. For examples,
2205    *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
2206    * * `NAME` is a sequence of non-blank printable ASCII characters not
2207    *    containing `{` or `}`.
2208    * * `1` represents a unitary [dimensionless
2209    *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
2210    *    as in `1/s`. It is typically used when none of the basic units are
2211    *    appropriate. For example, "new users per day" can be represented as
2212    *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
2213    *    users). Alternatively, "thousands of page views per day" would be
2214    *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
2215    *    value of `5.3` would mean "5300 page views per day").
2216    * * `%` represents dimensionless value of 1/100, and annotates values giving
2217    *    a percentage (so the metric values are typically in the range of 0..100,
2218    *    and a metric value `3` means "3 percent").
2219    * * `10^2.%` indicates a metric contains a ratio, typically in the range
2220    *    0..1, that will be multiplied by 100 and displayed as a percentage
2221    *    (so a metric value `0.03` means "3 percent").
2222    * </pre>
2223    *
2224    * <code>string unit = 5;</code>
2225    *
2226    * @return The unit.
2227    */
2228   @java.lang.Override
getUnit()2229   public java.lang.String getUnit() {
2230     java.lang.Object ref = unit_;
2231     if (ref instanceof java.lang.String) {
2232       return (java.lang.String) ref;
2233     } else {
2234       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2235       java.lang.String s = bs.toStringUtf8();
2236       unit_ = s;
2237       return s;
2238     }
2239   }
2240   /**
2241    *
2242    *
2243    * <pre>
2244    * The units in which the metric value is reported. It is only applicable
2245    * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
2246    * defines the representation of the stored metric values.
2247    * Different systems might scale the values to be more easily displayed (so a
2248    * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
2249    * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
2250    * `kBy`, then the value of the metric is always in thousands of bytes, no
2251    * matter how it might be displayed.
2252    * If you want a custom metric to record the exact number of CPU-seconds used
2253    * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
2254    * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
2255    * CPU-seconds, then the value is written as `12005`.
2256    * Alternatively, if you want a custom metric to record data in a more
2257    * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
2258    * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
2259    * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
2260    * The supported units are a subset of [The Unified Code for Units of
2261    * Measure](https://unitsofmeasure.org/ucum.html) standard:
2262    * **Basic units (UNIT)**
2263    * * `bit`   bit
2264    * * `By`    byte
2265    * * `s`     second
2266    * * `min`   minute
2267    * * `h`     hour
2268    * * `d`     day
2269    * * `1`     dimensionless
2270    * **Prefixes (PREFIX)**
2271    * * `k`     kilo    (10^3)
2272    * * `M`     mega    (10^6)
2273    * * `G`     giga    (10^9)
2274    * * `T`     tera    (10^12)
2275    * * `P`     peta    (10^15)
2276    * * `E`     exa     (10^18)
2277    * * `Z`     zetta   (10^21)
2278    * * `Y`     yotta   (10^24)
2279    * * `m`     milli   (10^-3)
2280    * * `u`     micro   (10^-6)
2281    * * `n`     nano    (10^-9)
2282    * * `p`     pico    (10^-12)
2283    * * `f`     femto   (10^-15)
2284    * * `a`     atto    (10^-18)
2285    * * `z`     zepto   (10^-21)
2286    * * `y`     yocto   (10^-24)
2287    * * `Ki`    kibi    (2^10)
2288    * * `Mi`    mebi    (2^20)
2289    * * `Gi`    gibi    (2^30)
2290    * * `Ti`    tebi    (2^40)
2291    * * `Pi`    pebi    (2^50)
2292    * **Grammar**
2293    * The grammar also includes these connectors:
2294    * * `/`    division or ratio (as an infix operator). For examples,
2295    *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
2296    *          have `/s` in a metric `unit`; rates should always be computed at
2297    *          query time from the underlying cumulative or delta value).
2298    * * `.`    multiplication or composition (as an infix operator). For
2299    *          examples, `GBy.d` or `k{watt}.h`.
2300    * The grammar for a unit is as follows:
2301    *     Expression = Component { "." Component } { "/" Component } ;
2302    *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
2303    *               | Annotation
2304    *               | "1"
2305    *               ;
2306    *     Annotation = "{" NAME "}" ;
2307    * Notes:
2308    * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
2309    *    is used alone, then the unit is equivalent to `1`. For examples,
2310    *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
2311    * * `NAME` is a sequence of non-blank printable ASCII characters not
2312    *    containing `{` or `}`.
2313    * * `1` represents a unitary [dimensionless
2314    *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
2315    *    as in `1/s`. It is typically used when none of the basic units are
2316    *    appropriate. For example, "new users per day" can be represented as
2317    *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
2318    *    users). Alternatively, "thousands of page views per day" would be
2319    *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
2320    *    value of `5.3` would mean "5300 page views per day").
2321    * * `%` represents dimensionless value of 1/100, and annotates values giving
2322    *    a percentage (so the metric values are typically in the range of 0..100,
2323    *    and a metric value `3` means "3 percent").
2324    * * `10^2.%` indicates a metric contains a ratio, typically in the range
2325    *    0..1, that will be multiplied by 100 and displayed as a percentage
2326    *    (so a metric value `0.03` means "3 percent").
2327    * </pre>
2328    *
2329    * <code>string unit = 5;</code>
2330    *
2331    * @return The bytes for unit.
2332    */
2333   @java.lang.Override
getUnitBytes()2334   public com.google.protobuf.ByteString getUnitBytes() {
2335     java.lang.Object ref = unit_;
2336     if (ref instanceof java.lang.String) {
2337       com.google.protobuf.ByteString b =
2338           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2339       unit_ = b;
2340       return b;
2341     } else {
2342       return (com.google.protobuf.ByteString) ref;
2343     }
2344   }
2345 
2346   public static final int DESCRIPTION_FIELD_NUMBER = 6;
2347 
2348   @SuppressWarnings("serial")
2349   private volatile java.lang.Object description_ = "";
2350   /**
2351    *
2352    *
2353    * <pre>
2354    * A detailed description of the metric, which can be used in documentation.
2355    * </pre>
2356    *
2357    * <code>string description = 6;</code>
2358    *
2359    * @return The description.
2360    */
2361   @java.lang.Override
getDescription()2362   public java.lang.String getDescription() {
2363     java.lang.Object ref = description_;
2364     if (ref instanceof java.lang.String) {
2365       return (java.lang.String) ref;
2366     } else {
2367       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2368       java.lang.String s = bs.toStringUtf8();
2369       description_ = s;
2370       return s;
2371     }
2372   }
2373   /**
2374    *
2375    *
2376    * <pre>
2377    * A detailed description of the metric, which can be used in documentation.
2378    * </pre>
2379    *
2380    * <code>string description = 6;</code>
2381    *
2382    * @return The bytes for description.
2383    */
2384   @java.lang.Override
getDescriptionBytes()2385   public com.google.protobuf.ByteString getDescriptionBytes() {
2386     java.lang.Object ref = description_;
2387     if (ref instanceof java.lang.String) {
2388       com.google.protobuf.ByteString b =
2389           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2390       description_ = b;
2391       return b;
2392     } else {
2393       return (com.google.protobuf.ByteString) ref;
2394     }
2395   }
2396 
2397   public static final int DISPLAY_NAME_FIELD_NUMBER = 7;
2398 
2399   @SuppressWarnings("serial")
2400   private volatile java.lang.Object displayName_ = "";
2401   /**
2402    *
2403    *
2404    * <pre>
2405    * A concise name for the metric, which can be displayed in user interfaces.
2406    * Use sentence case without an ending period, for example "Request count".
2407    * This field is optional but it is recommended to be set for any metrics
2408    * associated with user-visible concepts, such as Quota.
2409    * </pre>
2410    *
2411    * <code>string display_name = 7;</code>
2412    *
2413    * @return The displayName.
2414    */
2415   @java.lang.Override
getDisplayName()2416   public java.lang.String getDisplayName() {
2417     java.lang.Object ref = displayName_;
2418     if (ref instanceof java.lang.String) {
2419       return (java.lang.String) ref;
2420     } else {
2421       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2422       java.lang.String s = bs.toStringUtf8();
2423       displayName_ = s;
2424       return s;
2425     }
2426   }
2427   /**
2428    *
2429    *
2430    * <pre>
2431    * A concise name for the metric, which can be displayed in user interfaces.
2432    * Use sentence case without an ending period, for example "Request count".
2433    * This field is optional but it is recommended to be set for any metrics
2434    * associated with user-visible concepts, such as Quota.
2435    * </pre>
2436    *
2437    * <code>string display_name = 7;</code>
2438    *
2439    * @return The bytes for displayName.
2440    */
2441   @java.lang.Override
getDisplayNameBytes()2442   public com.google.protobuf.ByteString getDisplayNameBytes() {
2443     java.lang.Object ref = displayName_;
2444     if (ref instanceof java.lang.String) {
2445       com.google.protobuf.ByteString b =
2446           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2447       displayName_ = b;
2448       return b;
2449     } else {
2450       return (com.google.protobuf.ByteString) ref;
2451     }
2452   }
2453 
2454   public static final int METADATA_FIELD_NUMBER = 10;
2455   private com.google.api.MetricDescriptor.MetricDescriptorMetadata metadata_;
2456   /**
2457    *
2458    *
2459    * <pre>
2460    * Optional. Metadata which can be used to guide usage of the metric.
2461    * </pre>
2462    *
2463    * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
2464    *
2465    * @return Whether the metadata field is set.
2466    */
2467   @java.lang.Override
hasMetadata()2468   public boolean hasMetadata() {
2469     return metadata_ != null;
2470   }
2471   /**
2472    *
2473    *
2474    * <pre>
2475    * Optional. Metadata which can be used to guide usage of the metric.
2476    * </pre>
2477    *
2478    * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
2479    *
2480    * @return The metadata.
2481    */
2482   @java.lang.Override
getMetadata()2483   public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() {
2484     return metadata_ == null
2485         ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()
2486         : metadata_;
2487   }
2488   /**
2489    *
2490    *
2491    * <pre>
2492    * Optional. Metadata which can be used to guide usage of the metric.
2493    * </pre>
2494    *
2495    * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
2496    */
2497   @java.lang.Override
getMetadataOrBuilder()2498   public com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder getMetadataOrBuilder() {
2499     return metadata_ == null
2500         ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()
2501         : metadata_;
2502   }
2503 
2504   public static final int LAUNCH_STAGE_FIELD_NUMBER = 12;
2505   private int launchStage_ = 0;
2506   /**
2507    *
2508    *
2509    * <pre>
2510    * Optional. The launch stage of the metric definition.
2511    * </pre>
2512    *
2513    * <code>.google.api.LaunchStage launch_stage = 12;</code>
2514    *
2515    * @return The enum numeric value on the wire for launchStage.
2516    */
2517   @java.lang.Override
getLaunchStageValue()2518   public int getLaunchStageValue() {
2519     return launchStage_;
2520   }
2521   /**
2522    *
2523    *
2524    * <pre>
2525    * Optional. The launch stage of the metric definition.
2526    * </pre>
2527    *
2528    * <code>.google.api.LaunchStage launch_stage = 12;</code>
2529    *
2530    * @return The launchStage.
2531    */
2532   @java.lang.Override
getLaunchStage()2533   public com.google.api.LaunchStage getLaunchStage() {
2534     com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_);
2535     return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result;
2536   }
2537 
2538   public static final int MONITORED_RESOURCE_TYPES_FIELD_NUMBER = 13;
2539 
2540   @SuppressWarnings("serial")
2541   private com.google.protobuf.LazyStringList monitoredResourceTypes_;
2542   /**
2543    *
2544    *
2545    * <pre>
2546    * Read-only. If present, then a [time
2547    * series][google.monitoring.v3.TimeSeries], which is identified partially by
2548    * a metric type and a
2549    * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
2550    * is associated with this metric type can only be associated with one of the
2551    * monitored resource types listed here.
2552    * </pre>
2553    *
2554    * <code>repeated string monitored_resource_types = 13;</code>
2555    *
2556    * @return A list containing the monitoredResourceTypes.
2557    */
getMonitoredResourceTypesList()2558   public com.google.protobuf.ProtocolStringList getMonitoredResourceTypesList() {
2559     return monitoredResourceTypes_;
2560   }
2561   /**
2562    *
2563    *
2564    * <pre>
2565    * Read-only. If present, then a [time
2566    * series][google.monitoring.v3.TimeSeries], which is identified partially by
2567    * a metric type and a
2568    * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
2569    * is associated with this metric type can only be associated with one of the
2570    * monitored resource types listed here.
2571    * </pre>
2572    *
2573    * <code>repeated string monitored_resource_types = 13;</code>
2574    *
2575    * @return The count of monitoredResourceTypes.
2576    */
getMonitoredResourceTypesCount()2577   public int getMonitoredResourceTypesCount() {
2578     return monitoredResourceTypes_.size();
2579   }
2580   /**
2581    *
2582    *
2583    * <pre>
2584    * Read-only. If present, then a [time
2585    * series][google.monitoring.v3.TimeSeries], which is identified partially by
2586    * a metric type and a
2587    * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
2588    * is associated with this metric type can only be associated with one of the
2589    * monitored resource types listed here.
2590    * </pre>
2591    *
2592    * <code>repeated string monitored_resource_types = 13;</code>
2593    *
2594    * @param index The index of the element to return.
2595    * @return The monitoredResourceTypes at the given index.
2596    */
getMonitoredResourceTypes(int index)2597   public java.lang.String getMonitoredResourceTypes(int index) {
2598     return monitoredResourceTypes_.get(index);
2599   }
2600   /**
2601    *
2602    *
2603    * <pre>
2604    * Read-only. If present, then a [time
2605    * series][google.monitoring.v3.TimeSeries], which is identified partially by
2606    * a metric type and a
2607    * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
2608    * is associated with this metric type can only be associated with one of the
2609    * monitored resource types listed here.
2610    * </pre>
2611    *
2612    * <code>repeated string monitored_resource_types = 13;</code>
2613    *
2614    * @param index The index of the value to return.
2615    * @return The bytes of the monitoredResourceTypes at the given index.
2616    */
getMonitoredResourceTypesBytes(int index)2617   public com.google.protobuf.ByteString getMonitoredResourceTypesBytes(int index) {
2618     return monitoredResourceTypes_.getByteString(index);
2619   }
2620 
2621   private byte memoizedIsInitialized = -1;
2622 
2623   @java.lang.Override
isInitialized()2624   public final boolean isInitialized() {
2625     byte isInitialized = memoizedIsInitialized;
2626     if (isInitialized == 1) return true;
2627     if (isInitialized == 0) return false;
2628 
2629     memoizedIsInitialized = 1;
2630     return true;
2631   }
2632 
2633   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)2634   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
2635     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
2636       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
2637     }
2638     for (int i = 0; i < labels_.size(); i++) {
2639       output.writeMessage(2, labels_.get(i));
2640     }
2641     if (metricKind_
2642         != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) {
2643       output.writeEnum(3, metricKind_);
2644     }
2645     if (valueType_
2646         != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) {
2647       output.writeEnum(4, valueType_);
2648     }
2649     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) {
2650       com.google.protobuf.GeneratedMessageV3.writeString(output, 5, unit_);
2651     }
2652     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
2653       com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_);
2654     }
2655     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
2656       com.google.protobuf.GeneratedMessageV3.writeString(output, 7, displayName_);
2657     }
2658     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) {
2659       com.google.protobuf.GeneratedMessageV3.writeString(output, 8, type_);
2660     }
2661     if (metadata_ != null) {
2662       output.writeMessage(10, getMetadata());
2663     }
2664     if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
2665       output.writeEnum(12, launchStage_);
2666     }
2667     for (int i = 0; i < monitoredResourceTypes_.size(); i++) {
2668       com.google.protobuf.GeneratedMessageV3.writeString(
2669           output, 13, monitoredResourceTypes_.getRaw(i));
2670     }
2671     getUnknownFields().writeTo(output);
2672   }
2673 
2674   @java.lang.Override
getSerializedSize()2675   public int getSerializedSize() {
2676     int size = memoizedSize;
2677     if (size != -1) return size;
2678 
2679     size = 0;
2680     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
2681       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
2682     }
2683     for (int i = 0; i < labels_.size(); i++) {
2684       size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, labels_.get(i));
2685     }
2686     if (metricKind_
2687         != com.google.api.MetricDescriptor.MetricKind.METRIC_KIND_UNSPECIFIED.getNumber()) {
2688       size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, metricKind_);
2689     }
2690     if (valueType_
2691         != com.google.api.MetricDescriptor.ValueType.VALUE_TYPE_UNSPECIFIED.getNumber()) {
2692       size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, valueType_);
2693     }
2694     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) {
2695       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, unit_);
2696     }
2697     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) {
2698       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_);
2699     }
2700     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
2701       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, displayName_);
2702     }
2703     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) {
2704       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, type_);
2705     }
2706     if (metadata_ != null) {
2707       size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getMetadata());
2708     }
2709     if (launchStage_ != com.google.api.LaunchStage.LAUNCH_STAGE_UNSPECIFIED.getNumber()) {
2710       size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, launchStage_);
2711     }
2712     {
2713       int dataSize = 0;
2714       for (int i = 0; i < monitoredResourceTypes_.size(); i++) {
2715         dataSize += computeStringSizeNoTag(monitoredResourceTypes_.getRaw(i));
2716       }
2717       size += dataSize;
2718       size += 1 * getMonitoredResourceTypesList().size();
2719     }
2720     size += getUnknownFields().getSerializedSize();
2721     memoizedSize = size;
2722     return size;
2723   }
2724 
2725   @java.lang.Override
equals(final java.lang.Object obj)2726   public boolean equals(final java.lang.Object obj) {
2727     if (obj == this) {
2728       return true;
2729     }
2730     if (!(obj instanceof com.google.api.MetricDescriptor)) {
2731       return super.equals(obj);
2732     }
2733     com.google.api.MetricDescriptor other = (com.google.api.MetricDescriptor) obj;
2734 
2735     if (!getName().equals(other.getName())) return false;
2736     if (!getType().equals(other.getType())) return false;
2737     if (!getLabelsList().equals(other.getLabelsList())) return false;
2738     if (metricKind_ != other.metricKind_) return false;
2739     if (valueType_ != other.valueType_) return false;
2740     if (!getUnit().equals(other.getUnit())) return false;
2741     if (!getDescription().equals(other.getDescription())) return false;
2742     if (!getDisplayName().equals(other.getDisplayName())) return false;
2743     if (hasMetadata() != other.hasMetadata()) return false;
2744     if (hasMetadata()) {
2745       if (!getMetadata().equals(other.getMetadata())) return false;
2746     }
2747     if (launchStage_ != other.launchStage_) return false;
2748     if (!getMonitoredResourceTypesList().equals(other.getMonitoredResourceTypesList()))
2749       return false;
2750     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
2751     return true;
2752   }
2753 
2754   @java.lang.Override
hashCode()2755   public int hashCode() {
2756     if (memoizedHashCode != 0) {
2757       return memoizedHashCode;
2758     }
2759     int hash = 41;
2760     hash = (19 * hash) + getDescriptor().hashCode();
2761     hash = (37 * hash) + NAME_FIELD_NUMBER;
2762     hash = (53 * hash) + getName().hashCode();
2763     hash = (37 * hash) + TYPE_FIELD_NUMBER;
2764     hash = (53 * hash) + getType().hashCode();
2765     if (getLabelsCount() > 0) {
2766       hash = (37 * hash) + LABELS_FIELD_NUMBER;
2767       hash = (53 * hash) + getLabelsList().hashCode();
2768     }
2769     hash = (37 * hash) + METRIC_KIND_FIELD_NUMBER;
2770     hash = (53 * hash) + metricKind_;
2771     hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER;
2772     hash = (53 * hash) + valueType_;
2773     hash = (37 * hash) + UNIT_FIELD_NUMBER;
2774     hash = (53 * hash) + getUnit().hashCode();
2775     hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER;
2776     hash = (53 * hash) + getDescription().hashCode();
2777     hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
2778     hash = (53 * hash) + getDisplayName().hashCode();
2779     if (hasMetadata()) {
2780       hash = (37 * hash) + METADATA_FIELD_NUMBER;
2781       hash = (53 * hash) + getMetadata().hashCode();
2782     }
2783     hash = (37 * hash) + LAUNCH_STAGE_FIELD_NUMBER;
2784     hash = (53 * hash) + launchStage_;
2785     if (getMonitoredResourceTypesCount() > 0) {
2786       hash = (37 * hash) + MONITORED_RESOURCE_TYPES_FIELD_NUMBER;
2787       hash = (53 * hash) + getMonitoredResourceTypesList().hashCode();
2788     }
2789     hash = (29 * hash) + getUnknownFields().hashCode();
2790     memoizedHashCode = hash;
2791     return hash;
2792   }
2793 
parseFrom(java.nio.ByteBuffer data)2794   public static com.google.api.MetricDescriptor parseFrom(java.nio.ByteBuffer data)
2795       throws com.google.protobuf.InvalidProtocolBufferException {
2796     return PARSER.parseFrom(data);
2797   }
2798 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2799   public static com.google.api.MetricDescriptor parseFrom(
2800       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2801       throws com.google.protobuf.InvalidProtocolBufferException {
2802     return PARSER.parseFrom(data, extensionRegistry);
2803   }
2804 
parseFrom(com.google.protobuf.ByteString data)2805   public static com.google.api.MetricDescriptor parseFrom(com.google.protobuf.ByteString data)
2806       throws com.google.protobuf.InvalidProtocolBufferException {
2807     return PARSER.parseFrom(data);
2808   }
2809 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2810   public static com.google.api.MetricDescriptor parseFrom(
2811       com.google.protobuf.ByteString data,
2812       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2813       throws com.google.protobuf.InvalidProtocolBufferException {
2814     return PARSER.parseFrom(data, extensionRegistry);
2815   }
2816 
parseFrom(byte[] data)2817   public static com.google.api.MetricDescriptor parseFrom(byte[] data)
2818       throws com.google.protobuf.InvalidProtocolBufferException {
2819     return PARSER.parseFrom(data);
2820   }
2821 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2822   public static com.google.api.MetricDescriptor parseFrom(
2823       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2824       throws com.google.protobuf.InvalidProtocolBufferException {
2825     return PARSER.parseFrom(data, extensionRegistry);
2826   }
2827 
parseFrom(java.io.InputStream input)2828   public static com.google.api.MetricDescriptor parseFrom(java.io.InputStream input)
2829       throws java.io.IOException {
2830     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2831   }
2832 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2833   public static com.google.api.MetricDescriptor parseFrom(
2834       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2835       throws java.io.IOException {
2836     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2837         PARSER, input, extensionRegistry);
2838   }
2839 
parseDelimitedFrom(java.io.InputStream input)2840   public static com.google.api.MetricDescriptor parseDelimitedFrom(java.io.InputStream input)
2841       throws java.io.IOException {
2842     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
2843   }
2844 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2845   public static com.google.api.MetricDescriptor parseDelimitedFrom(
2846       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2847       throws java.io.IOException {
2848     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
2849         PARSER, input, extensionRegistry);
2850   }
2851 
parseFrom( com.google.protobuf.CodedInputStream input)2852   public static com.google.api.MetricDescriptor parseFrom(
2853       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
2854     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
2855   }
2856 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)2857   public static com.google.api.MetricDescriptor parseFrom(
2858       com.google.protobuf.CodedInputStream input,
2859       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
2860       throws java.io.IOException {
2861     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
2862         PARSER, input, extensionRegistry);
2863   }
2864 
2865   @java.lang.Override
newBuilderForType()2866   public Builder newBuilderForType() {
2867     return newBuilder();
2868   }
2869 
newBuilder()2870   public static Builder newBuilder() {
2871     return DEFAULT_INSTANCE.toBuilder();
2872   }
2873 
newBuilder(com.google.api.MetricDescriptor prototype)2874   public static Builder newBuilder(com.google.api.MetricDescriptor prototype) {
2875     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
2876   }
2877 
2878   @java.lang.Override
toBuilder()2879   public Builder toBuilder() {
2880     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
2881   }
2882 
2883   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2884   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2885     Builder builder = new Builder(parent);
2886     return builder;
2887   }
2888   /**
2889    *
2890    *
2891    * <pre>
2892    * Defines a metric type and its schema. Once a metric descriptor is created,
2893    * deleting or altering it stops data collection and makes the metric type's
2894    * existing data unusable.
2895    * </pre>
2896    *
2897    * Protobuf type {@code google.api.MetricDescriptor}
2898    */
2899   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
2900       implements
2901       // @@protoc_insertion_point(builder_implements:google.api.MetricDescriptor)
2902       com.google.api.MetricDescriptorOrBuilder {
getDescriptor()2903     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
2904       return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
2905     }
2906 
2907     @java.lang.Override
2908     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()2909         internalGetFieldAccessorTable() {
2910       return com.google.api.MetricProto
2911           .internal_static_google_api_MetricDescriptor_fieldAccessorTable
2912           .ensureFieldAccessorsInitialized(
2913               com.google.api.MetricDescriptor.class, com.google.api.MetricDescriptor.Builder.class);
2914     }
2915 
2916     // Construct using com.google.api.MetricDescriptor.newBuilder()
Builder()2917     private Builder() {}
2918 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)2919     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
2920       super(parent);
2921     }
2922 
2923     @java.lang.Override
clear()2924     public Builder clear() {
2925       super.clear();
2926       bitField0_ = 0;
2927       name_ = "";
2928       type_ = "";
2929       if (labelsBuilder_ == null) {
2930         labels_ = java.util.Collections.emptyList();
2931       } else {
2932         labels_ = null;
2933         labelsBuilder_.clear();
2934       }
2935       bitField0_ = (bitField0_ & ~0x00000004);
2936       metricKind_ = 0;
2937       valueType_ = 0;
2938       unit_ = "";
2939       description_ = "";
2940       displayName_ = "";
2941       metadata_ = null;
2942       if (metadataBuilder_ != null) {
2943         metadataBuilder_.dispose();
2944         metadataBuilder_ = null;
2945       }
2946       launchStage_ = 0;
2947       monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
2948       bitField0_ = (bitField0_ & ~0x00000400);
2949       return this;
2950     }
2951 
2952     @java.lang.Override
getDescriptorForType()2953     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
2954       return com.google.api.MetricProto.internal_static_google_api_MetricDescriptor_descriptor;
2955     }
2956 
2957     @java.lang.Override
getDefaultInstanceForType()2958     public com.google.api.MetricDescriptor getDefaultInstanceForType() {
2959       return com.google.api.MetricDescriptor.getDefaultInstance();
2960     }
2961 
2962     @java.lang.Override
build()2963     public com.google.api.MetricDescriptor build() {
2964       com.google.api.MetricDescriptor result = buildPartial();
2965       if (!result.isInitialized()) {
2966         throw newUninitializedMessageException(result);
2967       }
2968       return result;
2969     }
2970 
2971     @java.lang.Override
buildPartial()2972     public com.google.api.MetricDescriptor buildPartial() {
2973       com.google.api.MetricDescriptor result = new com.google.api.MetricDescriptor(this);
2974       buildPartialRepeatedFields(result);
2975       if (bitField0_ != 0) {
2976         buildPartial0(result);
2977       }
2978       onBuilt();
2979       return result;
2980     }
2981 
buildPartialRepeatedFields(com.google.api.MetricDescriptor result)2982     private void buildPartialRepeatedFields(com.google.api.MetricDescriptor result) {
2983       if (labelsBuilder_ == null) {
2984         if (((bitField0_ & 0x00000004) != 0)) {
2985           labels_ = java.util.Collections.unmodifiableList(labels_);
2986           bitField0_ = (bitField0_ & ~0x00000004);
2987         }
2988         result.labels_ = labels_;
2989       } else {
2990         result.labels_ = labelsBuilder_.build();
2991       }
2992       if (((bitField0_ & 0x00000400) != 0)) {
2993         monitoredResourceTypes_ = monitoredResourceTypes_.getUnmodifiableView();
2994         bitField0_ = (bitField0_ & ~0x00000400);
2995       }
2996       result.monitoredResourceTypes_ = monitoredResourceTypes_;
2997     }
2998 
buildPartial0(com.google.api.MetricDescriptor result)2999     private void buildPartial0(com.google.api.MetricDescriptor result) {
3000       int from_bitField0_ = bitField0_;
3001       if (((from_bitField0_ & 0x00000001) != 0)) {
3002         result.name_ = name_;
3003       }
3004       if (((from_bitField0_ & 0x00000002) != 0)) {
3005         result.type_ = type_;
3006       }
3007       if (((from_bitField0_ & 0x00000008) != 0)) {
3008         result.metricKind_ = metricKind_;
3009       }
3010       if (((from_bitField0_ & 0x00000010) != 0)) {
3011         result.valueType_ = valueType_;
3012       }
3013       if (((from_bitField0_ & 0x00000020) != 0)) {
3014         result.unit_ = unit_;
3015       }
3016       if (((from_bitField0_ & 0x00000040) != 0)) {
3017         result.description_ = description_;
3018       }
3019       if (((from_bitField0_ & 0x00000080) != 0)) {
3020         result.displayName_ = displayName_;
3021       }
3022       if (((from_bitField0_ & 0x00000100) != 0)) {
3023         result.metadata_ = metadataBuilder_ == null ? metadata_ : metadataBuilder_.build();
3024       }
3025       if (((from_bitField0_ & 0x00000200) != 0)) {
3026         result.launchStage_ = launchStage_;
3027       }
3028     }
3029 
3030     @java.lang.Override
clone()3031     public Builder clone() {
3032       return super.clone();
3033     }
3034 
3035     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)3036     public Builder setField(
3037         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
3038       return super.setField(field, value);
3039     }
3040 
3041     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)3042     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
3043       return super.clearField(field);
3044     }
3045 
3046     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)3047     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
3048       return super.clearOneof(oneof);
3049     }
3050 
3051     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)3052     public Builder setRepeatedField(
3053         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
3054       return super.setRepeatedField(field, index, value);
3055     }
3056 
3057     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)3058     public Builder addRepeatedField(
3059         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
3060       return super.addRepeatedField(field, value);
3061     }
3062 
3063     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)3064     public Builder mergeFrom(com.google.protobuf.Message other) {
3065       if (other instanceof com.google.api.MetricDescriptor) {
3066         return mergeFrom((com.google.api.MetricDescriptor) other);
3067       } else {
3068         super.mergeFrom(other);
3069         return this;
3070       }
3071     }
3072 
mergeFrom(com.google.api.MetricDescriptor other)3073     public Builder mergeFrom(com.google.api.MetricDescriptor other) {
3074       if (other == com.google.api.MetricDescriptor.getDefaultInstance()) return this;
3075       if (!other.getName().isEmpty()) {
3076         name_ = other.name_;
3077         bitField0_ |= 0x00000001;
3078         onChanged();
3079       }
3080       if (!other.getType().isEmpty()) {
3081         type_ = other.type_;
3082         bitField0_ |= 0x00000002;
3083         onChanged();
3084       }
3085       if (labelsBuilder_ == null) {
3086         if (!other.labels_.isEmpty()) {
3087           if (labels_.isEmpty()) {
3088             labels_ = other.labels_;
3089             bitField0_ = (bitField0_ & ~0x00000004);
3090           } else {
3091             ensureLabelsIsMutable();
3092             labels_.addAll(other.labels_);
3093           }
3094           onChanged();
3095         }
3096       } else {
3097         if (!other.labels_.isEmpty()) {
3098           if (labelsBuilder_.isEmpty()) {
3099             labelsBuilder_.dispose();
3100             labelsBuilder_ = null;
3101             labels_ = other.labels_;
3102             bitField0_ = (bitField0_ & ~0x00000004);
3103             labelsBuilder_ =
3104                 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
3105                     ? getLabelsFieldBuilder()
3106                     : null;
3107           } else {
3108             labelsBuilder_.addAllMessages(other.labels_);
3109           }
3110         }
3111       }
3112       if (other.metricKind_ != 0) {
3113         setMetricKindValue(other.getMetricKindValue());
3114       }
3115       if (other.valueType_ != 0) {
3116         setValueTypeValue(other.getValueTypeValue());
3117       }
3118       if (!other.getUnit().isEmpty()) {
3119         unit_ = other.unit_;
3120         bitField0_ |= 0x00000020;
3121         onChanged();
3122       }
3123       if (!other.getDescription().isEmpty()) {
3124         description_ = other.description_;
3125         bitField0_ |= 0x00000040;
3126         onChanged();
3127       }
3128       if (!other.getDisplayName().isEmpty()) {
3129         displayName_ = other.displayName_;
3130         bitField0_ |= 0x00000080;
3131         onChanged();
3132       }
3133       if (other.hasMetadata()) {
3134         mergeMetadata(other.getMetadata());
3135       }
3136       if (other.launchStage_ != 0) {
3137         setLaunchStageValue(other.getLaunchStageValue());
3138       }
3139       if (!other.monitoredResourceTypes_.isEmpty()) {
3140         if (monitoredResourceTypes_.isEmpty()) {
3141           monitoredResourceTypes_ = other.monitoredResourceTypes_;
3142           bitField0_ = (bitField0_ & ~0x00000400);
3143         } else {
3144           ensureMonitoredResourceTypesIsMutable();
3145           monitoredResourceTypes_.addAll(other.monitoredResourceTypes_);
3146         }
3147         onChanged();
3148       }
3149       this.mergeUnknownFields(other.getUnknownFields());
3150       onChanged();
3151       return this;
3152     }
3153 
3154     @java.lang.Override
isInitialized()3155     public final boolean isInitialized() {
3156       return true;
3157     }
3158 
3159     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)3160     public Builder mergeFrom(
3161         com.google.protobuf.CodedInputStream input,
3162         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
3163         throws java.io.IOException {
3164       if (extensionRegistry == null) {
3165         throw new java.lang.NullPointerException();
3166       }
3167       try {
3168         boolean done = false;
3169         while (!done) {
3170           int tag = input.readTag();
3171           switch (tag) {
3172             case 0:
3173               done = true;
3174               break;
3175             case 10:
3176               {
3177                 name_ = input.readStringRequireUtf8();
3178                 bitField0_ |= 0x00000001;
3179                 break;
3180               } // case 10
3181             case 18:
3182               {
3183                 com.google.api.LabelDescriptor m =
3184                     input.readMessage(com.google.api.LabelDescriptor.parser(), extensionRegistry);
3185                 if (labelsBuilder_ == null) {
3186                   ensureLabelsIsMutable();
3187                   labels_.add(m);
3188                 } else {
3189                   labelsBuilder_.addMessage(m);
3190                 }
3191                 break;
3192               } // case 18
3193             case 24:
3194               {
3195                 metricKind_ = input.readEnum();
3196                 bitField0_ |= 0x00000008;
3197                 break;
3198               } // case 24
3199             case 32:
3200               {
3201                 valueType_ = input.readEnum();
3202                 bitField0_ |= 0x00000010;
3203                 break;
3204               } // case 32
3205             case 42:
3206               {
3207                 unit_ = input.readStringRequireUtf8();
3208                 bitField0_ |= 0x00000020;
3209                 break;
3210               } // case 42
3211             case 50:
3212               {
3213                 description_ = input.readStringRequireUtf8();
3214                 bitField0_ |= 0x00000040;
3215                 break;
3216               } // case 50
3217             case 58:
3218               {
3219                 displayName_ = input.readStringRequireUtf8();
3220                 bitField0_ |= 0x00000080;
3221                 break;
3222               } // case 58
3223             case 66:
3224               {
3225                 type_ = input.readStringRequireUtf8();
3226                 bitField0_ |= 0x00000002;
3227                 break;
3228               } // case 66
3229             case 82:
3230               {
3231                 input.readMessage(getMetadataFieldBuilder().getBuilder(), extensionRegistry);
3232                 bitField0_ |= 0x00000100;
3233                 break;
3234               } // case 82
3235             case 96:
3236               {
3237                 launchStage_ = input.readEnum();
3238                 bitField0_ |= 0x00000200;
3239                 break;
3240               } // case 96
3241             case 106:
3242               {
3243                 java.lang.String s = input.readStringRequireUtf8();
3244                 ensureMonitoredResourceTypesIsMutable();
3245                 monitoredResourceTypes_.add(s);
3246                 break;
3247               } // case 106
3248             default:
3249               {
3250                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
3251                   done = true; // was an endgroup tag
3252                 }
3253                 break;
3254               } // default:
3255           } // switch (tag)
3256         } // while (!done)
3257       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
3258         throw e.unwrapIOException();
3259       } finally {
3260         onChanged();
3261       } // finally
3262       return this;
3263     }
3264 
3265     private int bitField0_;
3266 
3267     private java.lang.Object name_ = "";
3268     /**
3269      *
3270      *
3271      * <pre>
3272      * The resource name of the metric descriptor.
3273      * </pre>
3274      *
3275      * <code>string name = 1;</code>
3276      *
3277      * @return The name.
3278      */
getName()3279     public java.lang.String getName() {
3280       java.lang.Object ref = name_;
3281       if (!(ref instanceof java.lang.String)) {
3282         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3283         java.lang.String s = bs.toStringUtf8();
3284         name_ = s;
3285         return s;
3286       } else {
3287         return (java.lang.String) ref;
3288       }
3289     }
3290     /**
3291      *
3292      *
3293      * <pre>
3294      * The resource name of the metric descriptor.
3295      * </pre>
3296      *
3297      * <code>string name = 1;</code>
3298      *
3299      * @return The bytes for name.
3300      */
getNameBytes()3301     public com.google.protobuf.ByteString getNameBytes() {
3302       java.lang.Object ref = name_;
3303       if (ref instanceof String) {
3304         com.google.protobuf.ByteString b =
3305             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3306         name_ = b;
3307         return b;
3308       } else {
3309         return (com.google.protobuf.ByteString) ref;
3310       }
3311     }
3312     /**
3313      *
3314      *
3315      * <pre>
3316      * The resource name of the metric descriptor.
3317      * </pre>
3318      *
3319      * <code>string name = 1;</code>
3320      *
3321      * @param value The name to set.
3322      * @return This builder for chaining.
3323      */
setName(java.lang.String value)3324     public Builder setName(java.lang.String value) {
3325       if (value == null) {
3326         throw new NullPointerException();
3327       }
3328       name_ = value;
3329       bitField0_ |= 0x00000001;
3330       onChanged();
3331       return this;
3332     }
3333     /**
3334      *
3335      *
3336      * <pre>
3337      * The resource name of the metric descriptor.
3338      * </pre>
3339      *
3340      * <code>string name = 1;</code>
3341      *
3342      * @return This builder for chaining.
3343      */
clearName()3344     public Builder clearName() {
3345       name_ = getDefaultInstance().getName();
3346       bitField0_ = (bitField0_ & ~0x00000001);
3347       onChanged();
3348       return this;
3349     }
3350     /**
3351      *
3352      *
3353      * <pre>
3354      * The resource name of the metric descriptor.
3355      * </pre>
3356      *
3357      * <code>string name = 1;</code>
3358      *
3359      * @param value The bytes for name to set.
3360      * @return This builder for chaining.
3361      */
setNameBytes(com.google.protobuf.ByteString value)3362     public Builder setNameBytes(com.google.protobuf.ByteString value) {
3363       if (value == null) {
3364         throw new NullPointerException();
3365       }
3366       checkByteStringIsUtf8(value);
3367       name_ = value;
3368       bitField0_ |= 0x00000001;
3369       onChanged();
3370       return this;
3371     }
3372 
3373     private java.lang.Object type_ = "";
3374     /**
3375      *
3376      *
3377      * <pre>
3378      * The metric type, including its DNS name prefix. The type is not
3379      * URL-encoded. All user-defined metric types have the DNS name
3380      * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
3381      * use a natural hierarchical grouping. For example:
3382      *     "custom.googleapis.com/invoice/paid/amount"
3383      *     "external.googleapis.com/prometheus/up"
3384      *     "appengine.googleapis.com/http/server/response_latencies"
3385      * </pre>
3386      *
3387      * <code>string type = 8;</code>
3388      *
3389      * @return The type.
3390      */
getType()3391     public java.lang.String getType() {
3392       java.lang.Object ref = type_;
3393       if (!(ref instanceof java.lang.String)) {
3394         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
3395         java.lang.String s = bs.toStringUtf8();
3396         type_ = s;
3397         return s;
3398       } else {
3399         return (java.lang.String) ref;
3400       }
3401     }
3402     /**
3403      *
3404      *
3405      * <pre>
3406      * The metric type, including its DNS name prefix. The type is not
3407      * URL-encoded. All user-defined metric types have the DNS name
3408      * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
3409      * use a natural hierarchical grouping. For example:
3410      *     "custom.googleapis.com/invoice/paid/amount"
3411      *     "external.googleapis.com/prometheus/up"
3412      *     "appengine.googleapis.com/http/server/response_latencies"
3413      * </pre>
3414      *
3415      * <code>string type = 8;</code>
3416      *
3417      * @return The bytes for type.
3418      */
getTypeBytes()3419     public com.google.protobuf.ByteString getTypeBytes() {
3420       java.lang.Object ref = type_;
3421       if (ref instanceof String) {
3422         com.google.protobuf.ByteString b =
3423             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
3424         type_ = b;
3425         return b;
3426       } else {
3427         return (com.google.protobuf.ByteString) ref;
3428       }
3429     }
3430     /**
3431      *
3432      *
3433      * <pre>
3434      * The metric type, including its DNS name prefix. The type is not
3435      * URL-encoded. All user-defined metric types have the DNS name
3436      * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
3437      * use a natural hierarchical grouping. For example:
3438      *     "custom.googleapis.com/invoice/paid/amount"
3439      *     "external.googleapis.com/prometheus/up"
3440      *     "appengine.googleapis.com/http/server/response_latencies"
3441      * </pre>
3442      *
3443      * <code>string type = 8;</code>
3444      *
3445      * @param value The type to set.
3446      * @return This builder for chaining.
3447      */
setType(java.lang.String value)3448     public Builder setType(java.lang.String value) {
3449       if (value == null) {
3450         throw new NullPointerException();
3451       }
3452       type_ = value;
3453       bitField0_ |= 0x00000002;
3454       onChanged();
3455       return this;
3456     }
3457     /**
3458      *
3459      *
3460      * <pre>
3461      * The metric type, including its DNS name prefix. The type is not
3462      * URL-encoded. All user-defined metric types have the DNS name
3463      * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
3464      * use a natural hierarchical grouping. For example:
3465      *     "custom.googleapis.com/invoice/paid/amount"
3466      *     "external.googleapis.com/prometheus/up"
3467      *     "appengine.googleapis.com/http/server/response_latencies"
3468      * </pre>
3469      *
3470      * <code>string type = 8;</code>
3471      *
3472      * @return This builder for chaining.
3473      */
clearType()3474     public Builder clearType() {
3475       type_ = getDefaultInstance().getType();
3476       bitField0_ = (bitField0_ & ~0x00000002);
3477       onChanged();
3478       return this;
3479     }
3480     /**
3481      *
3482      *
3483      * <pre>
3484      * The metric type, including its DNS name prefix. The type is not
3485      * URL-encoded. All user-defined metric types have the DNS name
3486      * `custom.googleapis.com` or `external.googleapis.com`. Metric types should
3487      * use a natural hierarchical grouping. For example:
3488      *     "custom.googleapis.com/invoice/paid/amount"
3489      *     "external.googleapis.com/prometheus/up"
3490      *     "appengine.googleapis.com/http/server/response_latencies"
3491      * </pre>
3492      *
3493      * <code>string type = 8;</code>
3494      *
3495      * @param value The bytes for type to set.
3496      * @return This builder for chaining.
3497      */
setTypeBytes(com.google.protobuf.ByteString value)3498     public Builder setTypeBytes(com.google.protobuf.ByteString value) {
3499       if (value == null) {
3500         throw new NullPointerException();
3501       }
3502       checkByteStringIsUtf8(value);
3503       type_ = value;
3504       bitField0_ |= 0x00000002;
3505       onChanged();
3506       return this;
3507     }
3508 
3509     private java.util.List<com.google.api.LabelDescriptor> labels_ =
3510         java.util.Collections.emptyList();
3511 
ensureLabelsIsMutable()3512     private void ensureLabelsIsMutable() {
3513       if (!((bitField0_ & 0x00000004) != 0)) {
3514         labels_ = new java.util.ArrayList<com.google.api.LabelDescriptor>(labels_);
3515         bitField0_ |= 0x00000004;
3516       }
3517     }
3518 
3519     private com.google.protobuf.RepeatedFieldBuilderV3<
3520             com.google.api.LabelDescriptor,
3521             com.google.api.LabelDescriptor.Builder,
3522             com.google.api.LabelDescriptorOrBuilder>
3523         labelsBuilder_;
3524 
3525     /**
3526      *
3527      *
3528      * <pre>
3529      * The set of labels that can be used to describe a specific
3530      * instance of this metric type. For example, the
3531      * `appengine.googleapis.com/http/server/response_latencies` metric
3532      * type has a label for the HTTP response code, `response_code`, so
3533      * you can look at latencies for successful responses or just
3534      * for responses that failed.
3535      * </pre>
3536      *
3537      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3538      */
getLabelsList()3539     public java.util.List<com.google.api.LabelDescriptor> getLabelsList() {
3540       if (labelsBuilder_ == null) {
3541         return java.util.Collections.unmodifiableList(labels_);
3542       } else {
3543         return labelsBuilder_.getMessageList();
3544       }
3545     }
3546     /**
3547      *
3548      *
3549      * <pre>
3550      * The set of labels that can be used to describe a specific
3551      * instance of this metric type. For example, the
3552      * `appengine.googleapis.com/http/server/response_latencies` metric
3553      * type has a label for the HTTP response code, `response_code`, so
3554      * you can look at latencies for successful responses or just
3555      * for responses that failed.
3556      * </pre>
3557      *
3558      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3559      */
getLabelsCount()3560     public int getLabelsCount() {
3561       if (labelsBuilder_ == null) {
3562         return labels_.size();
3563       } else {
3564         return labelsBuilder_.getCount();
3565       }
3566     }
3567     /**
3568      *
3569      *
3570      * <pre>
3571      * The set of labels that can be used to describe a specific
3572      * instance of this metric type. For example, the
3573      * `appengine.googleapis.com/http/server/response_latencies` metric
3574      * type has a label for the HTTP response code, `response_code`, so
3575      * you can look at latencies for successful responses or just
3576      * for responses that failed.
3577      * </pre>
3578      *
3579      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3580      */
getLabels(int index)3581     public com.google.api.LabelDescriptor getLabels(int index) {
3582       if (labelsBuilder_ == null) {
3583         return labels_.get(index);
3584       } else {
3585         return labelsBuilder_.getMessage(index);
3586       }
3587     }
3588     /**
3589      *
3590      *
3591      * <pre>
3592      * The set of labels that can be used to describe a specific
3593      * instance of this metric type. For example, the
3594      * `appengine.googleapis.com/http/server/response_latencies` metric
3595      * type has a label for the HTTP response code, `response_code`, so
3596      * you can look at latencies for successful responses or just
3597      * for responses that failed.
3598      * </pre>
3599      *
3600      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3601      */
setLabels(int index, com.google.api.LabelDescriptor value)3602     public Builder setLabels(int index, com.google.api.LabelDescriptor value) {
3603       if (labelsBuilder_ == null) {
3604         if (value == null) {
3605           throw new NullPointerException();
3606         }
3607         ensureLabelsIsMutable();
3608         labels_.set(index, value);
3609         onChanged();
3610       } else {
3611         labelsBuilder_.setMessage(index, value);
3612       }
3613       return this;
3614     }
3615     /**
3616      *
3617      *
3618      * <pre>
3619      * The set of labels that can be used to describe a specific
3620      * instance of this metric type. For example, the
3621      * `appengine.googleapis.com/http/server/response_latencies` metric
3622      * type has a label for the HTTP response code, `response_code`, so
3623      * you can look at latencies for successful responses or just
3624      * for responses that failed.
3625      * </pre>
3626      *
3627      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3628      */
setLabels(int index, com.google.api.LabelDescriptor.Builder builderForValue)3629     public Builder setLabels(int index, com.google.api.LabelDescriptor.Builder builderForValue) {
3630       if (labelsBuilder_ == null) {
3631         ensureLabelsIsMutable();
3632         labels_.set(index, builderForValue.build());
3633         onChanged();
3634       } else {
3635         labelsBuilder_.setMessage(index, builderForValue.build());
3636       }
3637       return this;
3638     }
3639     /**
3640      *
3641      *
3642      * <pre>
3643      * The set of labels that can be used to describe a specific
3644      * instance of this metric type. For example, the
3645      * `appengine.googleapis.com/http/server/response_latencies` metric
3646      * type has a label for the HTTP response code, `response_code`, so
3647      * you can look at latencies for successful responses or just
3648      * for responses that failed.
3649      * </pre>
3650      *
3651      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3652      */
addLabels(com.google.api.LabelDescriptor value)3653     public Builder addLabels(com.google.api.LabelDescriptor value) {
3654       if (labelsBuilder_ == null) {
3655         if (value == null) {
3656           throw new NullPointerException();
3657         }
3658         ensureLabelsIsMutable();
3659         labels_.add(value);
3660         onChanged();
3661       } else {
3662         labelsBuilder_.addMessage(value);
3663       }
3664       return this;
3665     }
3666     /**
3667      *
3668      *
3669      * <pre>
3670      * The set of labels that can be used to describe a specific
3671      * instance of this metric type. For example, the
3672      * `appengine.googleapis.com/http/server/response_latencies` metric
3673      * type has a label for the HTTP response code, `response_code`, so
3674      * you can look at latencies for successful responses or just
3675      * for responses that failed.
3676      * </pre>
3677      *
3678      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3679      */
addLabels(int index, com.google.api.LabelDescriptor value)3680     public Builder addLabels(int index, com.google.api.LabelDescriptor value) {
3681       if (labelsBuilder_ == null) {
3682         if (value == null) {
3683           throw new NullPointerException();
3684         }
3685         ensureLabelsIsMutable();
3686         labels_.add(index, value);
3687         onChanged();
3688       } else {
3689         labelsBuilder_.addMessage(index, value);
3690       }
3691       return this;
3692     }
3693     /**
3694      *
3695      *
3696      * <pre>
3697      * The set of labels that can be used to describe a specific
3698      * instance of this metric type. For example, the
3699      * `appengine.googleapis.com/http/server/response_latencies` metric
3700      * type has a label for the HTTP response code, `response_code`, so
3701      * you can look at latencies for successful responses or just
3702      * for responses that failed.
3703      * </pre>
3704      *
3705      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3706      */
addLabels(com.google.api.LabelDescriptor.Builder builderForValue)3707     public Builder addLabels(com.google.api.LabelDescriptor.Builder builderForValue) {
3708       if (labelsBuilder_ == null) {
3709         ensureLabelsIsMutable();
3710         labels_.add(builderForValue.build());
3711         onChanged();
3712       } else {
3713         labelsBuilder_.addMessage(builderForValue.build());
3714       }
3715       return this;
3716     }
3717     /**
3718      *
3719      *
3720      * <pre>
3721      * The set of labels that can be used to describe a specific
3722      * instance of this metric type. For example, the
3723      * `appengine.googleapis.com/http/server/response_latencies` metric
3724      * type has a label for the HTTP response code, `response_code`, so
3725      * you can look at latencies for successful responses or just
3726      * for responses that failed.
3727      * </pre>
3728      *
3729      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3730      */
addLabels(int index, com.google.api.LabelDescriptor.Builder builderForValue)3731     public Builder addLabels(int index, com.google.api.LabelDescriptor.Builder builderForValue) {
3732       if (labelsBuilder_ == null) {
3733         ensureLabelsIsMutable();
3734         labels_.add(index, builderForValue.build());
3735         onChanged();
3736       } else {
3737         labelsBuilder_.addMessage(index, builderForValue.build());
3738       }
3739       return this;
3740     }
3741     /**
3742      *
3743      *
3744      * <pre>
3745      * The set of labels that can be used to describe a specific
3746      * instance of this metric type. For example, the
3747      * `appengine.googleapis.com/http/server/response_latencies` metric
3748      * type has a label for the HTTP response code, `response_code`, so
3749      * you can look at latencies for successful responses or just
3750      * for responses that failed.
3751      * </pre>
3752      *
3753      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3754      */
addAllLabels( java.lang.Iterable<? extends com.google.api.LabelDescriptor> values)3755     public Builder addAllLabels(
3756         java.lang.Iterable<? extends com.google.api.LabelDescriptor> values) {
3757       if (labelsBuilder_ == null) {
3758         ensureLabelsIsMutable();
3759         com.google.protobuf.AbstractMessageLite.Builder.addAll(values, labels_);
3760         onChanged();
3761       } else {
3762         labelsBuilder_.addAllMessages(values);
3763       }
3764       return this;
3765     }
3766     /**
3767      *
3768      *
3769      * <pre>
3770      * The set of labels that can be used to describe a specific
3771      * instance of this metric type. For example, the
3772      * `appengine.googleapis.com/http/server/response_latencies` metric
3773      * type has a label for the HTTP response code, `response_code`, so
3774      * you can look at latencies for successful responses or just
3775      * for responses that failed.
3776      * </pre>
3777      *
3778      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3779      */
clearLabels()3780     public Builder clearLabels() {
3781       if (labelsBuilder_ == null) {
3782         labels_ = java.util.Collections.emptyList();
3783         bitField0_ = (bitField0_ & ~0x00000004);
3784         onChanged();
3785       } else {
3786         labelsBuilder_.clear();
3787       }
3788       return this;
3789     }
3790     /**
3791      *
3792      *
3793      * <pre>
3794      * The set of labels that can be used to describe a specific
3795      * instance of this metric type. For example, the
3796      * `appengine.googleapis.com/http/server/response_latencies` metric
3797      * type has a label for the HTTP response code, `response_code`, so
3798      * you can look at latencies for successful responses or just
3799      * for responses that failed.
3800      * </pre>
3801      *
3802      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3803      */
removeLabels(int index)3804     public Builder removeLabels(int index) {
3805       if (labelsBuilder_ == null) {
3806         ensureLabelsIsMutable();
3807         labels_.remove(index);
3808         onChanged();
3809       } else {
3810         labelsBuilder_.remove(index);
3811       }
3812       return this;
3813     }
3814     /**
3815      *
3816      *
3817      * <pre>
3818      * The set of labels that can be used to describe a specific
3819      * instance of this metric type. For example, the
3820      * `appengine.googleapis.com/http/server/response_latencies` metric
3821      * type has a label for the HTTP response code, `response_code`, so
3822      * you can look at latencies for successful responses or just
3823      * for responses that failed.
3824      * </pre>
3825      *
3826      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3827      */
getLabelsBuilder(int index)3828     public com.google.api.LabelDescriptor.Builder getLabelsBuilder(int index) {
3829       return getLabelsFieldBuilder().getBuilder(index);
3830     }
3831     /**
3832      *
3833      *
3834      * <pre>
3835      * The set of labels that can be used to describe a specific
3836      * instance of this metric type. For example, the
3837      * `appengine.googleapis.com/http/server/response_latencies` metric
3838      * type has a label for the HTTP response code, `response_code`, so
3839      * you can look at latencies for successful responses or just
3840      * for responses that failed.
3841      * </pre>
3842      *
3843      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3844      */
getLabelsOrBuilder(int index)3845     public com.google.api.LabelDescriptorOrBuilder getLabelsOrBuilder(int index) {
3846       if (labelsBuilder_ == null) {
3847         return labels_.get(index);
3848       } else {
3849         return labelsBuilder_.getMessageOrBuilder(index);
3850       }
3851     }
3852     /**
3853      *
3854      *
3855      * <pre>
3856      * The set of labels that can be used to describe a specific
3857      * instance of this metric type. For example, the
3858      * `appengine.googleapis.com/http/server/response_latencies` metric
3859      * type has a label for the HTTP response code, `response_code`, so
3860      * you can look at latencies for successful responses or just
3861      * for responses that failed.
3862      * </pre>
3863      *
3864      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3865      */
3866     public java.util.List<? extends com.google.api.LabelDescriptorOrBuilder>
getLabelsOrBuilderList()3867         getLabelsOrBuilderList() {
3868       if (labelsBuilder_ != null) {
3869         return labelsBuilder_.getMessageOrBuilderList();
3870       } else {
3871         return java.util.Collections.unmodifiableList(labels_);
3872       }
3873     }
3874     /**
3875      *
3876      *
3877      * <pre>
3878      * The set of labels that can be used to describe a specific
3879      * instance of this metric type. For example, the
3880      * `appengine.googleapis.com/http/server/response_latencies` metric
3881      * type has a label for the HTTP response code, `response_code`, so
3882      * you can look at latencies for successful responses or just
3883      * for responses that failed.
3884      * </pre>
3885      *
3886      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3887      */
addLabelsBuilder()3888     public com.google.api.LabelDescriptor.Builder addLabelsBuilder() {
3889       return getLabelsFieldBuilder()
3890           .addBuilder(com.google.api.LabelDescriptor.getDefaultInstance());
3891     }
3892     /**
3893      *
3894      *
3895      * <pre>
3896      * The set of labels that can be used to describe a specific
3897      * instance of this metric type. For example, the
3898      * `appengine.googleapis.com/http/server/response_latencies` metric
3899      * type has a label for the HTTP response code, `response_code`, so
3900      * you can look at latencies for successful responses or just
3901      * for responses that failed.
3902      * </pre>
3903      *
3904      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3905      */
addLabelsBuilder(int index)3906     public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) {
3907       return getLabelsFieldBuilder()
3908           .addBuilder(index, com.google.api.LabelDescriptor.getDefaultInstance());
3909     }
3910     /**
3911      *
3912      *
3913      * <pre>
3914      * The set of labels that can be used to describe a specific
3915      * instance of this metric type. For example, the
3916      * `appengine.googleapis.com/http/server/response_latencies` metric
3917      * type has a label for the HTTP response code, `response_code`, so
3918      * you can look at latencies for successful responses or just
3919      * for responses that failed.
3920      * </pre>
3921      *
3922      * <code>repeated .google.api.LabelDescriptor labels = 2;</code>
3923      */
getLabelsBuilderList()3924     public java.util.List<com.google.api.LabelDescriptor.Builder> getLabelsBuilderList() {
3925       return getLabelsFieldBuilder().getBuilderList();
3926     }
3927 
3928     private com.google.protobuf.RepeatedFieldBuilderV3<
3929             com.google.api.LabelDescriptor,
3930             com.google.api.LabelDescriptor.Builder,
3931             com.google.api.LabelDescriptorOrBuilder>
getLabelsFieldBuilder()3932         getLabelsFieldBuilder() {
3933       if (labelsBuilder_ == null) {
3934         labelsBuilder_ =
3935             new com.google.protobuf.RepeatedFieldBuilderV3<
3936                 com.google.api.LabelDescriptor,
3937                 com.google.api.LabelDescriptor.Builder,
3938                 com.google.api.LabelDescriptorOrBuilder>(
3939                 labels_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean());
3940         labels_ = null;
3941       }
3942       return labelsBuilder_;
3943     }
3944 
3945     private int metricKind_ = 0;
3946     /**
3947      *
3948      *
3949      * <pre>
3950      * Whether the metric records instantaneous values, changes to a value, etc.
3951      * Some combinations of `metric_kind` and `value_type` might not be supported.
3952      * </pre>
3953      *
3954      * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
3955      *
3956      * @return The enum numeric value on the wire for metricKind.
3957      */
3958     @java.lang.Override
getMetricKindValue()3959     public int getMetricKindValue() {
3960       return metricKind_;
3961     }
3962     /**
3963      *
3964      *
3965      * <pre>
3966      * Whether the metric records instantaneous values, changes to a value, etc.
3967      * Some combinations of `metric_kind` and `value_type` might not be supported.
3968      * </pre>
3969      *
3970      * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
3971      *
3972      * @param value The enum numeric value on the wire for metricKind to set.
3973      * @return This builder for chaining.
3974      */
setMetricKindValue(int value)3975     public Builder setMetricKindValue(int value) {
3976       metricKind_ = value;
3977       bitField0_ |= 0x00000008;
3978       onChanged();
3979       return this;
3980     }
3981     /**
3982      *
3983      *
3984      * <pre>
3985      * Whether the metric records instantaneous values, changes to a value, etc.
3986      * Some combinations of `metric_kind` and `value_type` might not be supported.
3987      * </pre>
3988      *
3989      * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
3990      *
3991      * @return The metricKind.
3992      */
3993     @java.lang.Override
getMetricKind()3994     public com.google.api.MetricDescriptor.MetricKind getMetricKind() {
3995       com.google.api.MetricDescriptor.MetricKind result =
3996           com.google.api.MetricDescriptor.MetricKind.forNumber(metricKind_);
3997       return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result;
3998     }
3999     /**
4000      *
4001      *
4002      * <pre>
4003      * Whether the metric records instantaneous values, changes to a value, etc.
4004      * Some combinations of `metric_kind` and `value_type` might not be supported.
4005      * </pre>
4006      *
4007      * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
4008      *
4009      * @param value The metricKind to set.
4010      * @return This builder for chaining.
4011      */
setMetricKind(com.google.api.MetricDescriptor.MetricKind value)4012     public Builder setMetricKind(com.google.api.MetricDescriptor.MetricKind value) {
4013       if (value == null) {
4014         throw new NullPointerException();
4015       }
4016       bitField0_ |= 0x00000008;
4017       metricKind_ = value.getNumber();
4018       onChanged();
4019       return this;
4020     }
4021     /**
4022      *
4023      *
4024      * <pre>
4025      * Whether the metric records instantaneous values, changes to a value, etc.
4026      * Some combinations of `metric_kind` and `value_type` might not be supported.
4027      * </pre>
4028      *
4029      * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code>
4030      *
4031      * @return This builder for chaining.
4032      */
clearMetricKind()4033     public Builder clearMetricKind() {
4034       bitField0_ = (bitField0_ & ~0x00000008);
4035       metricKind_ = 0;
4036       onChanged();
4037       return this;
4038     }
4039 
4040     private int valueType_ = 0;
4041     /**
4042      *
4043      *
4044      * <pre>
4045      * Whether the measurement is an integer, a floating-point number, etc.
4046      * Some combinations of `metric_kind` and `value_type` might not be supported.
4047      * </pre>
4048      *
4049      * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
4050      *
4051      * @return The enum numeric value on the wire for valueType.
4052      */
4053     @java.lang.Override
getValueTypeValue()4054     public int getValueTypeValue() {
4055       return valueType_;
4056     }
4057     /**
4058      *
4059      *
4060      * <pre>
4061      * Whether the measurement is an integer, a floating-point number, etc.
4062      * Some combinations of `metric_kind` and `value_type` might not be supported.
4063      * </pre>
4064      *
4065      * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
4066      *
4067      * @param value The enum numeric value on the wire for valueType to set.
4068      * @return This builder for chaining.
4069      */
setValueTypeValue(int value)4070     public Builder setValueTypeValue(int value) {
4071       valueType_ = value;
4072       bitField0_ |= 0x00000010;
4073       onChanged();
4074       return this;
4075     }
4076     /**
4077      *
4078      *
4079      * <pre>
4080      * Whether the measurement is an integer, a floating-point number, etc.
4081      * Some combinations of `metric_kind` and `value_type` might not be supported.
4082      * </pre>
4083      *
4084      * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
4085      *
4086      * @return The valueType.
4087      */
4088     @java.lang.Override
getValueType()4089     public com.google.api.MetricDescriptor.ValueType getValueType() {
4090       com.google.api.MetricDescriptor.ValueType result =
4091           com.google.api.MetricDescriptor.ValueType.forNumber(valueType_);
4092       return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result;
4093     }
4094     /**
4095      *
4096      *
4097      * <pre>
4098      * Whether the measurement is an integer, a floating-point number, etc.
4099      * Some combinations of `metric_kind` and `value_type` might not be supported.
4100      * </pre>
4101      *
4102      * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
4103      *
4104      * @param value The valueType to set.
4105      * @return This builder for chaining.
4106      */
setValueType(com.google.api.MetricDescriptor.ValueType value)4107     public Builder setValueType(com.google.api.MetricDescriptor.ValueType value) {
4108       if (value == null) {
4109         throw new NullPointerException();
4110       }
4111       bitField0_ |= 0x00000010;
4112       valueType_ = value.getNumber();
4113       onChanged();
4114       return this;
4115     }
4116     /**
4117      *
4118      *
4119      * <pre>
4120      * Whether the measurement is an integer, a floating-point number, etc.
4121      * Some combinations of `metric_kind` and `value_type` might not be supported.
4122      * </pre>
4123      *
4124      * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code>
4125      *
4126      * @return This builder for chaining.
4127      */
clearValueType()4128     public Builder clearValueType() {
4129       bitField0_ = (bitField0_ & ~0x00000010);
4130       valueType_ = 0;
4131       onChanged();
4132       return this;
4133     }
4134 
4135     private java.lang.Object unit_ = "";
4136     /**
4137      *
4138      *
4139      * <pre>
4140      * The units in which the metric value is reported. It is only applicable
4141      * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
4142      * defines the representation of the stored metric values.
4143      * Different systems might scale the values to be more easily displayed (so a
4144      * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
4145      * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
4146      * `kBy`, then the value of the metric is always in thousands of bytes, no
4147      * matter how it might be displayed.
4148      * If you want a custom metric to record the exact number of CPU-seconds used
4149      * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
4150      * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
4151      * CPU-seconds, then the value is written as `12005`.
4152      * Alternatively, if you want a custom metric to record data in a more
4153      * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
4154      * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
4155      * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
4156      * The supported units are a subset of [The Unified Code for Units of
4157      * Measure](https://unitsofmeasure.org/ucum.html) standard:
4158      * **Basic units (UNIT)**
4159      * * `bit`   bit
4160      * * `By`    byte
4161      * * `s`     second
4162      * * `min`   minute
4163      * * `h`     hour
4164      * * `d`     day
4165      * * `1`     dimensionless
4166      * **Prefixes (PREFIX)**
4167      * * `k`     kilo    (10^3)
4168      * * `M`     mega    (10^6)
4169      * * `G`     giga    (10^9)
4170      * * `T`     tera    (10^12)
4171      * * `P`     peta    (10^15)
4172      * * `E`     exa     (10^18)
4173      * * `Z`     zetta   (10^21)
4174      * * `Y`     yotta   (10^24)
4175      * * `m`     milli   (10^-3)
4176      * * `u`     micro   (10^-6)
4177      * * `n`     nano    (10^-9)
4178      * * `p`     pico    (10^-12)
4179      * * `f`     femto   (10^-15)
4180      * * `a`     atto    (10^-18)
4181      * * `z`     zepto   (10^-21)
4182      * * `y`     yocto   (10^-24)
4183      * * `Ki`    kibi    (2^10)
4184      * * `Mi`    mebi    (2^20)
4185      * * `Gi`    gibi    (2^30)
4186      * * `Ti`    tebi    (2^40)
4187      * * `Pi`    pebi    (2^50)
4188      * **Grammar**
4189      * The grammar also includes these connectors:
4190      * * `/`    division or ratio (as an infix operator). For examples,
4191      *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
4192      *          have `/s` in a metric `unit`; rates should always be computed at
4193      *          query time from the underlying cumulative or delta value).
4194      * * `.`    multiplication or composition (as an infix operator). For
4195      *          examples, `GBy.d` or `k{watt}.h`.
4196      * The grammar for a unit is as follows:
4197      *     Expression = Component { "." Component } { "/" Component } ;
4198      *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
4199      *               | Annotation
4200      *               | "1"
4201      *               ;
4202      *     Annotation = "{" NAME "}" ;
4203      * Notes:
4204      * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
4205      *    is used alone, then the unit is equivalent to `1`. For examples,
4206      *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
4207      * * `NAME` is a sequence of non-blank printable ASCII characters not
4208      *    containing `{` or `}`.
4209      * * `1` represents a unitary [dimensionless
4210      *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
4211      *    as in `1/s`. It is typically used when none of the basic units are
4212      *    appropriate. For example, "new users per day" can be represented as
4213      *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
4214      *    users). Alternatively, "thousands of page views per day" would be
4215      *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
4216      *    value of `5.3` would mean "5300 page views per day").
4217      * * `%` represents dimensionless value of 1/100, and annotates values giving
4218      *    a percentage (so the metric values are typically in the range of 0..100,
4219      *    and a metric value `3` means "3 percent").
4220      * * `10^2.%` indicates a metric contains a ratio, typically in the range
4221      *    0..1, that will be multiplied by 100 and displayed as a percentage
4222      *    (so a metric value `0.03` means "3 percent").
4223      * </pre>
4224      *
4225      * <code>string unit = 5;</code>
4226      *
4227      * @return The unit.
4228      */
getUnit()4229     public java.lang.String getUnit() {
4230       java.lang.Object ref = unit_;
4231       if (!(ref instanceof java.lang.String)) {
4232         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4233         java.lang.String s = bs.toStringUtf8();
4234         unit_ = s;
4235         return s;
4236       } else {
4237         return (java.lang.String) ref;
4238       }
4239     }
4240     /**
4241      *
4242      *
4243      * <pre>
4244      * The units in which the metric value is reported. It is only applicable
4245      * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
4246      * defines the representation of the stored metric values.
4247      * Different systems might scale the values to be more easily displayed (so a
4248      * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
4249      * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
4250      * `kBy`, then the value of the metric is always in thousands of bytes, no
4251      * matter how it might be displayed.
4252      * If you want a custom metric to record the exact number of CPU-seconds used
4253      * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
4254      * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
4255      * CPU-seconds, then the value is written as `12005`.
4256      * Alternatively, if you want a custom metric to record data in a more
4257      * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
4258      * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
4259      * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
4260      * The supported units are a subset of [The Unified Code for Units of
4261      * Measure](https://unitsofmeasure.org/ucum.html) standard:
4262      * **Basic units (UNIT)**
4263      * * `bit`   bit
4264      * * `By`    byte
4265      * * `s`     second
4266      * * `min`   minute
4267      * * `h`     hour
4268      * * `d`     day
4269      * * `1`     dimensionless
4270      * **Prefixes (PREFIX)**
4271      * * `k`     kilo    (10^3)
4272      * * `M`     mega    (10^6)
4273      * * `G`     giga    (10^9)
4274      * * `T`     tera    (10^12)
4275      * * `P`     peta    (10^15)
4276      * * `E`     exa     (10^18)
4277      * * `Z`     zetta   (10^21)
4278      * * `Y`     yotta   (10^24)
4279      * * `m`     milli   (10^-3)
4280      * * `u`     micro   (10^-6)
4281      * * `n`     nano    (10^-9)
4282      * * `p`     pico    (10^-12)
4283      * * `f`     femto   (10^-15)
4284      * * `a`     atto    (10^-18)
4285      * * `z`     zepto   (10^-21)
4286      * * `y`     yocto   (10^-24)
4287      * * `Ki`    kibi    (2^10)
4288      * * `Mi`    mebi    (2^20)
4289      * * `Gi`    gibi    (2^30)
4290      * * `Ti`    tebi    (2^40)
4291      * * `Pi`    pebi    (2^50)
4292      * **Grammar**
4293      * The grammar also includes these connectors:
4294      * * `/`    division or ratio (as an infix operator). For examples,
4295      *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
4296      *          have `/s` in a metric `unit`; rates should always be computed at
4297      *          query time from the underlying cumulative or delta value).
4298      * * `.`    multiplication or composition (as an infix operator). For
4299      *          examples, `GBy.d` or `k{watt}.h`.
4300      * The grammar for a unit is as follows:
4301      *     Expression = Component { "." Component } { "/" Component } ;
4302      *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
4303      *               | Annotation
4304      *               | "1"
4305      *               ;
4306      *     Annotation = "{" NAME "}" ;
4307      * Notes:
4308      * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
4309      *    is used alone, then the unit is equivalent to `1`. For examples,
4310      *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
4311      * * `NAME` is a sequence of non-blank printable ASCII characters not
4312      *    containing `{` or `}`.
4313      * * `1` represents a unitary [dimensionless
4314      *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
4315      *    as in `1/s`. It is typically used when none of the basic units are
4316      *    appropriate. For example, "new users per day" can be represented as
4317      *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
4318      *    users). Alternatively, "thousands of page views per day" would be
4319      *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
4320      *    value of `5.3` would mean "5300 page views per day").
4321      * * `%` represents dimensionless value of 1/100, and annotates values giving
4322      *    a percentage (so the metric values are typically in the range of 0..100,
4323      *    and a metric value `3` means "3 percent").
4324      * * `10^2.%` indicates a metric contains a ratio, typically in the range
4325      *    0..1, that will be multiplied by 100 and displayed as a percentage
4326      *    (so a metric value `0.03` means "3 percent").
4327      * </pre>
4328      *
4329      * <code>string unit = 5;</code>
4330      *
4331      * @return The bytes for unit.
4332      */
getUnitBytes()4333     public com.google.protobuf.ByteString getUnitBytes() {
4334       java.lang.Object ref = unit_;
4335       if (ref instanceof String) {
4336         com.google.protobuf.ByteString b =
4337             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4338         unit_ = b;
4339         return b;
4340       } else {
4341         return (com.google.protobuf.ByteString) ref;
4342       }
4343     }
4344     /**
4345      *
4346      *
4347      * <pre>
4348      * The units in which the metric value is reported. It is only applicable
4349      * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
4350      * defines the representation of the stored metric values.
4351      * Different systems might scale the values to be more easily displayed (so a
4352      * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
4353      * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
4354      * `kBy`, then the value of the metric is always in thousands of bytes, no
4355      * matter how it might be displayed.
4356      * If you want a custom metric to record the exact number of CPU-seconds used
4357      * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
4358      * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
4359      * CPU-seconds, then the value is written as `12005`.
4360      * Alternatively, if you want a custom metric to record data in a more
4361      * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
4362      * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
4363      * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
4364      * The supported units are a subset of [The Unified Code for Units of
4365      * Measure](https://unitsofmeasure.org/ucum.html) standard:
4366      * **Basic units (UNIT)**
4367      * * `bit`   bit
4368      * * `By`    byte
4369      * * `s`     second
4370      * * `min`   minute
4371      * * `h`     hour
4372      * * `d`     day
4373      * * `1`     dimensionless
4374      * **Prefixes (PREFIX)**
4375      * * `k`     kilo    (10^3)
4376      * * `M`     mega    (10^6)
4377      * * `G`     giga    (10^9)
4378      * * `T`     tera    (10^12)
4379      * * `P`     peta    (10^15)
4380      * * `E`     exa     (10^18)
4381      * * `Z`     zetta   (10^21)
4382      * * `Y`     yotta   (10^24)
4383      * * `m`     milli   (10^-3)
4384      * * `u`     micro   (10^-6)
4385      * * `n`     nano    (10^-9)
4386      * * `p`     pico    (10^-12)
4387      * * `f`     femto   (10^-15)
4388      * * `a`     atto    (10^-18)
4389      * * `z`     zepto   (10^-21)
4390      * * `y`     yocto   (10^-24)
4391      * * `Ki`    kibi    (2^10)
4392      * * `Mi`    mebi    (2^20)
4393      * * `Gi`    gibi    (2^30)
4394      * * `Ti`    tebi    (2^40)
4395      * * `Pi`    pebi    (2^50)
4396      * **Grammar**
4397      * The grammar also includes these connectors:
4398      * * `/`    division or ratio (as an infix operator). For examples,
4399      *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
4400      *          have `/s` in a metric `unit`; rates should always be computed at
4401      *          query time from the underlying cumulative or delta value).
4402      * * `.`    multiplication or composition (as an infix operator). For
4403      *          examples, `GBy.d` or `k{watt}.h`.
4404      * The grammar for a unit is as follows:
4405      *     Expression = Component { "." Component } { "/" Component } ;
4406      *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
4407      *               | Annotation
4408      *               | "1"
4409      *               ;
4410      *     Annotation = "{" NAME "}" ;
4411      * Notes:
4412      * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
4413      *    is used alone, then the unit is equivalent to `1`. For examples,
4414      *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
4415      * * `NAME` is a sequence of non-blank printable ASCII characters not
4416      *    containing `{` or `}`.
4417      * * `1` represents a unitary [dimensionless
4418      *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
4419      *    as in `1/s`. It is typically used when none of the basic units are
4420      *    appropriate. For example, "new users per day" can be represented as
4421      *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
4422      *    users). Alternatively, "thousands of page views per day" would be
4423      *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
4424      *    value of `5.3` would mean "5300 page views per day").
4425      * * `%` represents dimensionless value of 1/100, and annotates values giving
4426      *    a percentage (so the metric values are typically in the range of 0..100,
4427      *    and a metric value `3` means "3 percent").
4428      * * `10^2.%` indicates a metric contains a ratio, typically in the range
4429      *    0..1, that will be multiplied by 100 and displayed as a percentage
4430      *    (so a metric value `0.03` means "3 percent").
4431      * </pre>
4432      *
4433      * <code>string unit = 5;</code>
4434      *
4435      * @param value The unit to set.
4436      * @return This builder for chaining.
4437      */
setUnit(java.lang.String value)4438     public Builder setUnit(java.lang.String value) {
4439       if (value == null) {
4440         throw new NullPointerException();
4441       }
4442       unit_ = value;
4443       bitField0_ |= 0x00000020;
4444       onChanged();
4445       return this;
4446     }
4447     /**
4448      *
4449      *
4450      * <pre>
4451      * The units in which the metric value is reported. It is only applicable
4452      * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
4453      * defines the representation of the stored metric values.
4454      * Different systems might scale the values to be more easily displayed (so a
4455      * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
4456      * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
4457      * `kBy`, then the value of the metric is always in thousands of bytes, no
4458      * matter how it might be displayed.
4459      * If you want a custom metric to record the exact number of CPU-seconds used
4460      * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
4461      * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
4462      * CPU-seconds, then the value is written as `12005`.
4463      * Alternatively, if you want a custom metric to record data in a more
4464      * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
4465      * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
4466      * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
4467      * The supported units are a subset of [The Unified Code for Units of
4468      * Measure](https://unitsofmeasure.org/ucum.html) standard:
4469      * **Basic units (UNIT)**
4470      * * `bit`   bit
4471      * * `By`    byte
4472      * * `s`     second
4473      * * `min`   minute
4474      * * `h`     hour
4475      * * `d`     day
4476      * * `1`     dimensionless
4477      * **Prefixes (PREFIX)**
4478      * * `k`     kilo    (10^3)
4479      * * `M`     mega    (10^6)
4480      * * `G`     giga    (10^9)
4481      * * `T`     tera    (10^12)
4482      * * `P`     peta    (10^15)
4483      * * `E`     exa     (10^18)
4484      * * `Z`     zetta   (10^21)
4485      * * `Y`     yotta   (10^24)
4486      * * `m`     milli   (10^-3)
4487      * * `u`     micro   (10^-6)
4488      * * `n`     nano    (10^-9)
4489      * * `p`     pico    (10^-12)
4490      * * `f`     femto   (10^-15)
4491      * * `a`     atto    (10^-18)
4492      * * `z`     zepto   (10^-21)
4493      * * `y`     yocto   (10^-24)
4494      * * `Ki`    kibi    (2^10)
4495      * * `Mi`    mebi    (2^20)
4496      * * `Gi`    gibi    (2^30)
4497      * * `Ti`    tebi    (2^40)
4498      * * `Pi`    pebi    (2^50)
4499      * **Grammar**
4500      * The grammar also includes these connectors:
4501      * * `/`    division or ratio (as an infix operator). For examples,
4502      *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
4503      *          have `/s` in a metric `unit`; rates should always be computed at
4504      *          query time from the underlying cumulative or delta value).
4505      * * `.`    multiplication or composition (as an infix operator). For
4506      *          examples, `GBy.d` or `k{watt}.h`.
4507      * The grammar for a unit is as follows:
4508      *     Expression = Component { "." Component } { "/" Component } ;
4509      *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
4510      *               | Annotation
4511      *               | "1"
4512      *               ;
4513      *     Annotation = "{" NAME "}" ;
4514      * Notes:
4515      * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
4516      *    is used alone, then the unit is equivalent to `1`. For examples,
4517      *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
4518      * * `NAME` is a sequence of non-blank printable ASCII characters not
4519      *    containing `{` or `}`.
4520      * * `1` represents a unitary [dimensionless
4521      *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
4522      *    as in `1/s`. It is typically used when none of the basic units are
4523      *    appropriate. For example, "new users per day" can be represented as
4524      *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
4525      *    users). Alternatively, "thousands of page views per day" would be
4526      *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
4527      *    value of `5.3` would mean "5300 page views per day").
4528      * * `%` represents dimensionless value of 1/100, and annotates values giving
4529      *    a percentage (so the metric values are typically in the range of 0..100,
4530      *    and a metric value `3` means "3 percent").
4531      * * `10^2.%` indicates a metric contains a ratio, typically in the range
4532      *    0..1, that will be multiplied by 100 and displayed as a percentage
4533      *    (so a metric value `0.03` means "3 percent").
4534      * </pre>
4535      *
4536      * <code>string unit = 5;</code>
4537      *
4538      * @return This builder for chaining.
4539      */
clearUnit()4540     public Builder clearUnit() {
4541       unit_ = getDefaultInstance().getUnit();
4542       bitField0_ = (bitField0_ & ~0x00000020);
4543       onChanged();
4544       return this;
4545     }
4546     /**
4547      *
4548      *
4549      * <pre>
4550      * The units in which the metric value is reported. It is only applicable
4551      * if the `value_type` is `INT64`, `DOUBLE`, or `DISTRIBUTION`. The `unit`
4552      * defines the representation of the stored metric values.
4553      * Different systems might scale the values to be more easily displayed (so a
4554      * value of `0.02kBy` _might_ be displayed as `20By`, and a value of
4555      * `3523kBy` _might_ be displayed as `3.5MBy`). However, if the `unit` is
4556      * `kBy`, then the value of the metric is always in thousands of bytes, no
4557      * matter how it might be displayed.
4558      * If you want a custom metric to record the exact number of CPU-seconds used
4559      * by a job, you can create an `INT64 CUMULATIVE` metric whose `unit` is
4560      * `s{CPU}` (or equivalently `1s{CPU}` or just `s`). If the job uses 12,005
4561      * CPU-seconds, then the value is written as `12005`.
4562      * Alternatively, if you want a custom metric to record data in a more
4563      * granular way, you can create a `DOUBLE CUMULATIVE` metric whose `unit` is
4564      * `ks{CPU}`, and then write the value `12.005` (which is `12005/1000`),
4565      * or use `Kis{CPU}` and write `11.723` (which is `12005/1024`).
4566      * The supported units are a subset of [The Unified Code for Units of
4567      * Measure](https://unitsofmeasure.org/ucum.html) standard:
4568      * **Basic units (UNIT)**
4569      * * `bit`   bit
4570      * * `By`    byte
4571      * * `s`     second
4572      * * `min`   minute
4573      * * `h`     hour
4574      * * `d`     day
4575      * * `1`     dimensionless
4576      * **Prefixes (PREFIX)**
4577      * * `k`     kilo    (10^3)
4578      * * `M`     mega    (10^6)
4579      * * `G`     giga    (10^9)
4580      * * `T`     tera    (10^12)
4581      * * `P`     peta    (10^15)
4582      * * `E`     exa     (10^18)
4583      * * `Z`     zetta   (10^21)
4584      * * `Y`     yotta   (10^24)
4585      * * `m`     milli   (10^-3)
4586      * * `u`     micro   (10^-6)
4587      * * `n`     nano    (10^-9)
4588      * * `p`     pico    (10^-12)
4589      * * `f`     femto   (10^-15)
4590      * * `a`     atto    (10^-18)
4591      * * `z`     zepto   (10^-21)
4592      * * `y`     yocto   (10^-24)
4593      * * `Ki`    kibi    (2^10)
4594      * * `Mi`    mebi    (2^20)
4595      * * `Gi`    gibi    (2^30)
4596      * * `Ti`    tebi    (2^40)
4597      * * `Pi`    pebi    (2^50)
4598      * **Grammar**
4599      * The grammar also includes these connectors:
4600      * * `/`    division or ratio (as an infix operator). For examples,
4601      *          `kBy/{email}` or `MiBy/10ms` (although you should almost never
4602      *          have `/s` in a metric `unit`; rates should always be computed at
4603      *          query time from the underlying cumulative or delta value).
4604      * * `.`    multiplication or composition (as an infix operator). For
4605      *          examples, `GBy.d` or `k{watt}.h`.
4606      * The grammar for a unit is as follows:
4607      *     Expression = Component { "." Component } { "/" Component } ;
4608      *     Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ]
4609      *               | Annotation
4610      *               | "1"
4611      *               ;
4612      *     Annotation = "{" NAME "}" ;
4613      * Notes:
4614      * * `Annotation` is just a comment if it follows a `UNIT`. If the annotation
4615      *    is used alone, then the unit is equivalent to `1`. For examples,
4616      *    `{request}/s == 1/s`, `By{transmitted}/s == By/s`.
4617      * * `NAME` is a sequence of non-blank printable ASCII characters not
4618      *    containing `{` or `}`.
4619      * * `1` represents a unitary [dimensionless
4620      *    unit](https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such
4621      *    as in `1/s`. It is typically used when none of the basic units are
4622      *    appropriate. For example, "new users per day" can be represented as
4623      *    `1/d` or `{new-users}/d` (and a metric value `5` would mean "5 new
4624      *    users). Alternatively, "thousands of page views per day" would be
4625      *    represented as `1000/d` or `k1/d` or `k{page_views}/d` (and a metric
4626      *    value of `5.3` would mean "5300 page views per day").
4627      * * `%` represents dimensionless value of 1/100, and annotates values giving
4628      *    a percentage (so the metric values are typically in the range of 0..100,
4629      *    and a metric value `3` means "3 percent").
4630      * * `10^2.%` indicates a metric contains a ratio, typically in the range
4631      *    0..1, that will be multiplied by 100 and displayed as a percentage
4632      *    (so a metric value `0.03` means "3 percent").
4633      * </pre>
4634      *
4635      * <code>string unit = 5;</code>
4636      *
4637      * @param value The bytes for unit to set.
4638      * @return This builder for chaining.
4639      */
setUnitBytes(com.google.protobuf.ByteString value)4640     public Builder setUnitBytes(com.google.protobuf.ByteString value) {
4641       if (value == null) {
4642         throw new NullPointerException();
4643       }
4644       checkByteStringIsUtf8(value);
4645       unit_ = value;
4646       bitField0_ |= 0x00000020;
4647       onChanged();
4648       return this;
4649     }
4650 
4651     private java.lang.Object description_ = "";
4652     /**
4653      *
4654      *
4655      * <pre>
4656      * A detailed description of the metric, which can be used in documentation.
4657      * </pre>
4658      *
4659      * <code>string description = 6;</code>
4660      *
4661      * @return The description.
4662      */
getDescription()4663     public java.lang.String getDescription() {
4664       java.lang.Object ref = description_;
4665       if (!(ref instanceof java.lang.String)) {
4666         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4667         java.lang.String s = bs.toStringUtf8();
4668         description_ = s;
4669         return s;
4670       } else {
4671         return (java.lang.String) ref;
4672       }
4673     }
4674     /**
4675      *
4676      *
4677      * <pre>
4678      * A detailed description of the metric, which can be used in documentation.
4679      * </pre>
4680      *
4681      * <code>string description = 6;</code>
4682      *
4683      * @return The bytes for description.
4684      */
getDescriptionBytes()4685     public com.google.protobuf.ByteString getDescriptionBytes() {
4686       java.lang.Object ref = description_;
4687       if (ref instanceof String) {
4688         com.google.protobuf.ByteString b =
4689             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4690         description_ = b;
4691         return b;
4692       } else {
4693         return (com.google.protobuf.ByteString) ref;
4694       }
4695     }
4696     /**
4697      *
4698      *
4699      * <pre>
4700      * A detailed description of the metric, which can be used in documentation.
4701      * </pre>
4702      *
4703      * <code>string description = 6;</code>
4704      *
4705      * @param value The description to set.
4706      * @return This builder for chaining.
4707      */
setDescription(java.lang.String value)4708     public Builder setDescription(java.lang.String value) {
4709       if (value == null) {
4710         throw new NullPointerException();
4711       }
4712       description_ = value;
4713       bitField0_ |= 0x00000040;
4714       onChanged();
4715       return this;
4716     }
4717     /**
4718      *
4719      *
4720      * <pre>
4721      * A detailed description of the metric, which can be used in documentation.
4722      * </pre>
4723      *
4724      * <code>string description = 6;</code>
4725      *
4726      * @return This builder for chaining.
4727      */
clearDescription()4728     public Builder clearDescription() {
4729       description_ = getDefaultInstance().getDescription();
4730       bitField0_ = (bitField0_ & ~0x00000040);
4731       onChanged();
4732       return this;
4733     }
4734     /**
4735      *
4736      *
4737      * <pre>
4738      * A detailed description of the metric, which can be used in documentation.
4739      * </pre>
4740      *
4741      * <code>string description = 6;</code>
4742      *
4743      * @param value The bytes for description to set.
4744      * @return This builder for chaining.
4745      */
setDescriptionBytes(com.google.protobuf.ByteString value)4746     public Builder setDescriptionBytes(com.google.protobuf.ByteString value) {
4747       if (value == null) {
4748         throw new NullPointerException();
4749       }
4750       checkByteStringIsUtf8(value);
4751       description_ = value;
4752       bitField0_ |= 0x00000040;
4753       onChanged();
4754       return this;
4755     }
4756 
4757     private java.lang.Object displayName_ = "";
4758     /**
4759      *
4760      *
4761      * <pre>
4762      * A concise name for the metric, which can be displayed in user interfaces.
4763      * Use sentence case without an ending period, for example "Request count".
4764      * This field is optional but it is recommended to be set for any metrics
4765      * associated with user-visible concepts, such as Quota.
4766      * </pre>
4767      *
4768      * <code>string display_name = 7;</code>
4769      *
4770      * @return The displayName.
4771      */
getDisplayName()4772     public java.lang.String getDisplayName() {
4773       java.lang.Object ref = displayName_;
4774       if (!(ref instanceof java.lang.String)) {
4775         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
4776         java.lang.String s = bs.toStringUtf8();
4777         displayName_ = s;
4778         return s;
4779       } else {
4780         return (java.lang.String) ref;
4781       }
4782     }
4783     /**
4784      *
4785      *
4786      * <pre>
4787      * A concise name for the metric, which can be displayed in user interfaces.
4788      * Use sentence case without an ending period, for example "Request count".
4789      * This field is optional but it is recommended to be set for any metrics
4790      * associated with user-visible concepts, such as Quota.
4791      * </pre>
4792      *
4793      * <code>string display_name = 7;</code>
4794      *
4795      * @return The bytes for displayName.
4796      */
getDisplayNameBytes()4797     public com.google.protobuf.ByteString getDisplayNameBytes() {
4798       java.lang.Object ref = displayName_;
4799       if (ref instanceof String) {
4800         com.google.protobuf.ByteString b =
4801             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
4802         displayName_ = b;
4803         return b;
4804       } else {
4805         return (com.google.protobuf.ByteString) ref;
4806       }
4807     }
4808     /**
4809      *
4810      *
4811      * <pre>
4812      * A concise name for the metric, which can be displayed in user interfaces.
4813      * Use sentence case without an ending period, for example "Request count".
4814      * This field is optional but it is recommended to be set for any metrics
4815      * associated with user-visible concepts, such as Quota.
4816      * </pre>
4817      *
4818      * <code>string display_name = 7;</code>
4819      *
4820      * @param value The displayName to set.
4821      * @return This builder for chaining.
4822      */
setDisplayName(java.lang.String value)4823     public Builder setDisplayName(java.lang.String value) {
4824       if (value == null) {
4825         throw new NullPointerException();
4826       }
4827       displayName_ = value;
4828       bitField0_ |= 0x00000080;
4829       onChanged();
4830       return this;
4831     }
4832     /**
4833      *
4834      *
4835      * <pre>
4836      * A concise name for the metric, which can be displayed in user interfaces.
4837      * Use sentence case without an ending period, for example "Request count".
4838      * This field is optional but it is recommended to be set for any metrics
4839      * associated with user-visible concepts, such as Quota.
4840      * </pre>
4841      *
4842      * <code>string display_name = 7;</code>
4843      *
4844      * @return This builder for chaining.
4845      */
clearDisplayName()4846     public Builder clearDisplayName() {
4847       displayName_ = getDefaultInstance().getDisplayName();
4848       bitField0_ = (bitField0_ & ~0x00000080);
4849       onChanged();
4850       return this;
4851     }
4852     /**
4853      *
4854      *
4855      * <pre>
4856      * A concise name for the metric, which can be displayed in user interfaces.
4857      * Use sentence case without an ending period, for example "Request count".
4858      * This field is optional but it is recommended to be set for any metrics
4859      * associated with user-visible concepts, such as Quota.
4860      * </pre>
4861      *
4862      * <code>string display_name = 7;</code>
4863      *
4864      * @param value The bytes for displayName to set.
4865      * @return This builder for chaining.
4866      */
setDisplayNameBytes(com.google.protobuf.ByteString value)4867     public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
4868       if (value == null) {
4869         throw new NullPointerException();
4870       }
4871       checkByteStringIsUtf8(value);
4872       displayName_ = value;
4873       bitField0_ |= 0x00000080;
4874       onChanged();
4875       return this;
4876     }
4877 
4878     private com.google.api.MetricDescriptor.MetricDescriptorMetadata metadata_;
4879     private com.google.protobuf.SingleFieldBuilderV3<
4880             com.google.api.MetricDescriptor.MetricDescriptorMetadata,
4881             com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder,
4882             com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder>
4883         metadataBuilder_;
4884     /**
4885      *
4886      *
4887      * <pre>
4888      * Optional. Metadata which can be used to guide usage of the metric.
4889      * </pre>
4890      *
4891      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
4892      *
4893      * @return Whether the metadata field is set.
4894      */
hasMetadata()4895     public boolean hasMetadata() {
4896       return ((bitField0_ & 0x00000100) != 0);
4897     }
4898     /**
4899      *
4900      *
4901      * <pre>
4902      * Optional. Metadata which can be used to guide usage of the metric.
4903      * </pre>
4904      *
4905      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
4906      *
4907      * @return The metadata.
4908      */
getMetadata()4909     public com.google.api.MetricDescriptor.MetricDescriptorMetadata getMetadata() {
4910       if (metadataBuilder_ == null) {
4911         return metadata_ == null
4912             ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()
4913             : metadata_;
4914       } else {
4915         return metadataBuilder_.getMessage();
4916       }
4917     }
4918     /**
4919      *
4920      *
4921      * <pre>
4922      * Optional. Metadata which can be used to guide usage of the metric.
4923      * </pre>
4924      *
4925      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
4926      */
setMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value)4927     public Builder setMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) {
4928       if (metadataBuilder_ == null) {
4929         if (value == null) {
4930           throw new NullPointerException();
4931         }
4932         metadata_ = value;
4933       } else {
4934         metadataBuilder_.setMessage(value);
4935       }
4936       bitField0_ |= 0x00000100;
4937       onChanged();
4938       return this;
4939     }
4940     /**
4941      *
4942      *
4943      * <pre>
4944      * Optional. Metadata which can be used to guide usage of the metric.
4945      * </pre>
4946      *
4947      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
4948      */
setMetadata( com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder builderForValue)4949     public Builder setMetadata(
4950         com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder builderForValue) {
4951       if (metadataBuilder_ == null) {
4952         metadata_ = builderForValue.build();
4953       } else {
4954         metadataBuilder_.setMessage(builderForValue.build());
4955       }
4956       bitField0_ |= 0x00000100;
4957       onChanged();
4958       return this;
4959     }
4960     /**
4961      *
4962      *
4963      * <pre>
4964      * Optional. Metadata which can be used to guide usage of the metric.
4965      * </pre>
4966      *
4967      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
4968      */
mergeMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value)4969     public Builder mergeMetadata(com.google.api.MetricDescriptor.MetricDescriptorMetadata value) {
4970       if (metadataBuilder_ == null) {
4971         if (((bitField0_ & 0x00000100) != 0)
4972             && metadata_ != null
4973             && metadata_
4974                 != com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()) {
4975           getMetadataBuilder().mergeFrom(value);
4976         } else {
4977           metadata_ = value;
4978         }
4979       } else {
4980         metadataBuilder_.mergeFrom(value);
4981       }
4982       bitField0_ |= 0x00000100;
4983       onChanged();
4984       return this;
4985     }
4986     /**
4987      *
4988      *
4989      * <pre>
4990      * Optional. Metadata which can be used to guide usage of the metric.
4991      * </pre>
4992      *
4993      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
4994      */
clearMetadata()4995     public Builder clearMetadata() {
4996       bitField0_ = (bitField0_ & ~0x00000100);
4997       metadata_ = null;
4998       if (metadataBuilder_ != null) {
4999         metadataBuilder_.dispose();
5000         metadataBuilder_ = null;
5001       }
5002       onChanged();
5003       return this;
5004     }
5005     /**
5006      *
5007      *
5008      * <pre>
5009      * Optional. Metadata which can be used to guide usage of the metric.
5010      * </pre>
5011      *
5012      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
5013      */
getMetadataBuilder()5014     public com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder getMetadataBuilder() {
5015       bitField0_ |= 0x00000100;
5016       onChanged();
5017       return getMetadataFieldBuilder().getBuilder();
5018     }
5019     /**
5020      *
5021      *
5022      * <pre>
5023      * Optional. Metadata which can be used to guide usage of the metric.
5024      * </pre>
5025      *
5026      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
5027      */
5028     public com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder
getMetadataOrBuilder()5029         getMetadataOrBuilder() {
5030       if (metadataBuilder_ != null) {
5031         return metadataBuilder_.getMessageOrBuilder();
5032       } else {
5033         return metadata_ == null
5034             ? com.google.api.MetricDescriptor.MetricDescriptorMetadata.getDefaultInstance()
5035             : metadata_;
5036       }
5037     }
5038     /**
5039      *
5040      *
5041      * <pre>
5042      * Optional. Metadata which can be used to guide usage of the metric.
5043      * </pre>
5044      *
5045      * <code>.google.api.MetricDescriptor.MetricDescriptorMetadata metadata = 10;</code>
5046      */
5047     private com.google.protobuf.SingleFieldBuilderV3<
5048             com.google.api.MetricDescriptor.MetricDescriptorMetadata,
5049             com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder,
5050             com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder>
getMetadataFieldBuilder()5051         getMetadataFieldBuilder() {
5052       if (metadataBuilder_ == null) {
5053         metadataBuilder_ =
5054             new com.google.protobuf.SingleFieldBuilderV3<
5055                 com.google.api.MetricDescriptor.MetricDescriptorMetadata,
5056                 com.google.api.MetricDescriptor.MetricDescriptorMetadata.Builder,
5057                 com.google.api.MetricDescriptor.MetricDescriptorMetadataOrBuilder>(
5058                 getMetadata(), getParentForChildren(), isClean());
5059         metadata_ = null;
5060       }
5061       return metadataBuilder_;
5062     }
5063 
5064     private int launchStage_ = 0;
5065     /**
5066      *
5067      *
5068      * <pre>
5069      * Optional. The launch stage of the metric definition.
5070      * </pre>
5071      *
5072      * <code>.google.api.LaunchStage launch_stage = 12;</code>
5073      *
5074      * @return The enum numeric value on the wire for launchStage.
5075      */
5076     @java.lang.Override
getLaunchStageValue()5077     public int getLaunchStageValue() {
5078       return launchStage_;
5079     }
5080     /**
5081      *
5082      *
5083      * <pre>
5084      * Optional. The launch stage of the metric definition.
5085      * </pre>
5086      *
5087      * <code>.google.api.LaunchStage launch_stage = 12;</code>
5088      *
5089      * @param value The enum numeric value on the wire for launchStage to set.
5090      * @return This builder for chaining.
5091      */
setLaunchStageValue(int value)5092     public Builder setLaunchStageValue(int value) {
5093       launchStage_ = value;
5094       bitField0_ |= 0x00000200;
5095       onChanged();
5096       return this;
5097     }
5098     /**
5099      *
5100      *
5101      * <pre>
5102      * Optional. The launch stage of the metric definition.
5103      * </pre>
5104      *
5105      * <code>.google.api.LaunchStage launch_stage = 12;</code>
5106      *
5107      * @return The launchStage.
5108      */
5109     @java.lang.Override
getLaunchStage()5110     public com.google.api.LaunchStage getLaunchStage() {
5111       com.google.api.LaunchStage result = com.google.api.LaunchStage.forNumber(launchStage_);
5112       return result == null ? com.google.api.LaunchStage.UNRECOGNIZED : result;
5113     }
5114     /**
5115      *
5116      *
5117      * <pre>
5118      * Optional. The launch stage of the metric definition.
5119      * </pre>
5120      *
5121      * <code>.google.api.LaunchStage launch_stage = 12;</code>
5122      *
5123      * @param value The launchStage to set.
5124      * @return This builder for chaining.
5125      */
setLaunchStage(com.google.api.LaunchStage value)5126     public Builder setLaunchStage(com.google.api.LaunchStage value) {
5127       if (value == null) {
5128         throw new NullPointerException();
5129       }
5130       bitField0_ |= 0x00000200;
5131       launchStage_ = value.getNumber();
5132       onChanged();
5133       return this;
5134     }
5135     /**
5136      *
5137      *
5138      * <pre>
5139      * Optional. The launch stage of the metric definition.
5140      * </pre>
5141      *
5142      * <code>.google.api.LaunchStage launch_stage = 12;</code>
5143      *
5144      * @return This builder for chaining.
5145      */
clearLaunchStage()5146     public Builder clearLaunchStage() {
5147       bitField0_ = (bitField0_ & ~0x00000200);
5148       launchStage_ = 0;
5149       onChanged();
5150       return this;
5151     }
5152 
5153     private com.google.protobuf.LazyStringList monitoredResourceTypes_ =
5154         com.google.protobuf.LazyStringArrayList.EMPTY;
5155 
ensureMonitoredResourceTypesIsMutable()5156     private void ensureMonitoredResourceTypesIsMutable() {
5157       if (!((bitField0_ & 0x00000400) != 0)) {
5158         monitoredResourceTypes_ =
5159             new com.google.protobuf.LazyStringArrayList(monitoredResourceTypes_);
5160         bitField0_ |= 0x00000400;
5161       }
5162     }
5163     /**
5164      *
5165      *
5166      * <pre>
5167      * Read-only. If present, then a [time
5168      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5169      * a metric type and a
5170      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5171      * is associated with this metric type can only be associated with one of the
5172      * monitored resource types listed here.
5173      * </pre>
5174      *
5175      * <code>repeated string monitored_resource_types = 13;</code>
5176      *
5177      * @return A list containing the monitoredResourceTypes.
5178      */
getMonitoredResourceTypesList()5179     public com.google.protobuf.ProtocolStringList getMonitoredResourceTypesList() {
5180       return monitoredResourceTypes_.getUnmodifiableView();
5181     }
5182     /**
5183      *
5184      *
5185      * <pre>
5186      * Read-only. If present, then a [time
5187      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5188      * a metric type and a
5189      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5190      * is associated with this metric type can only be associated with one of the
5191      * monitored resource types listed here.
5192      * </pre>
5193      *
5194      * <code>repeated string monitored_resource_types = 13;</code>
5195      *
5196      * @return The count of monitoredResourceTypes.
5197      */
getMonitoredResourceTypesCount()5198     public int getMonitoredResourceTypesCount() {
5199       return monitoredResourceTypes_.size();
5200     }
5201     /**
5202      *
5203      *
5204      * <pre>
5205      * Read-only. If present, then a [time
5206      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5207      * a metric type and a
5208      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5209      * is associated with this metric type can only be associated with one of the
5210      * monitored resource types listed here.
5211      * </pre>
5212      *
5213      * <code>repeated string monitored_resource_types = 13;</code>
5214      *
5215      * @param index The index of the element to return.
5216      * @return The monitoredResourceTypes at the given index.
5217      */
getMonitoredResourceTypes(int index)5218     public java.lang.String getMonitoredResourceTypes(int index) {
5219       return monitoredResourceTypes_.get(index);
5220     }
5221     /**
5222      *
5223      *
5224      * <pre>
5225      * Read-only. If present, then a [time
5226      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5227      * a metric type and a
5228      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5229      * is associated with this metric type can only be associated with one of the
5230      * monitored resource types listed here.
5231      * </pre>
5232      *
5233      * <code>repeated string monitored_resource_types = 13;</code>
5234      *
5235      * @param index The index of the value to return.
5236      * @return The bytes of the monitoredResourceTypes at the given index.
5237      */
getMonitoredResourceTypesBytes(int index)5238     public com.google.protobuf.ByteString getMonitoredResourceTypesBytes(int index) {
5239       return monitoredResourceTypes_.getByteString(index);
5240     }
5241     /**
5242      *
5243      *
5244      * <pre>
5245      * Read-only. If present, then a [time
5246      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5247      * a metric type and a
5248      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5249      * is associated with this metric type can only be associated with one of the
5250      * monitored resource types listed here.
5251      * </pre>
5252      *
5253      * <code>repeated string monitored_resource_types = 13;</code>
5254      *
5255      * @param index The index to set the value at.
5256      * @param value The monitoredResourceTypes to set.
5257      * @return This builder for chaining.
5258      */
setMonitoredResourceTypes(int index, java.lang.String value)5259     public Builder setMonitoredResourceTypes(int index, java.lang.String value) {
5260       if (value == null) {
5261         throw new NullPointerException();
5262       }
5263       ensureMonitoredResourceTypesIsMutable();
5264       monitoredResourceTypes_.set(index, value);
5265       onChanged();
5266       return this;
5267     }
5268     /**
5269      *
5270      *
5271      * <pre>
5272      * Read-only. If present, then a [time
5273      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5274      * a metric type and a
5275      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5276      * is associated with this metric type can only be associated with one of the
5277      * monitored resource types listed here.
5278      * </pre>
5279      *
5280      * <code>repeated string monitored_resource_types = 13;</code>
5281      *
5282      * @param value The monitoredResourceTypes to add.
5283      * @return This builder for chaining.
5284      */
addMonitoredResourceTypes(java.lang.String value)5285     public Builder addMonitoredResourceTypes(java.lang.String value) {
5286       if (value == null) {
5287         throw new NullPointerException();
5288       }
5289       ensureMonitoredResourceTypesIsMutable();
5290       monitoredResourceTypes_.add(value);
5291       onChanged();
5292       return this;
5293     }
5294     /**
5295      *
5296      *
5297      * <pre>
5298      * Read-only. If present, then a [time
5299      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5300      * a metric type and a
5301      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5302      * is associated with this metric type can only be associated with one of the
5303      * monitored resource types listed here.
5304      * </pre>
5305      *
5306      * <code>repeated string monitored_resource_types = 13;</code>
5307      *
5308      * @param values The monitoredResourceTypes to add.
5309      * @return This builder for chaining.
5310      */
addAllMonitoredResourceTypes(java.lang.Iterable<java.lang.String> values)5311     public Builder addAllMonitoredResourceTypes(java.lang.Iterable<java.lang.String> values) {
5312       ensureMonitoredResourceTypesIsMutable();
5313       com.google.protobuf.AbstractMessageLite.Builder.addAll(values, monitoredResourceTypes_);
5314       onChanged();
5315       return this;
5316     }
5317     /**
5318      *
5319      *
5320      * <pre>
5321      * Read-only. If present, then a [time
5322      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5323      * a metric type and a
5324      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5325      * is associated with this metric type can only be associated with one of the
5326      * monitored resource types listed here.
5327      * </pre>
5328      *
5329      * <code>repeated string monitored_resource_types = 13;</code>
5330      *
5331      * @return This builder for chaining.
5332      */
clearMonitoredResourceTypes()5333     public Builder clearMonitoredResourceTypes() {
5334       monitoredResourceTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY;
5335       bitField0_ = (bitField0_ & ~0x00000400);
5336       onChanged();
5337       return this;
5338     }
5339     /**
5340      *
5341      *
5342      * <pre>
5343      * Read-only. If present, then a [time
5344      * series][google.monitoring.v3.TimeSeries], which is identified partially by
5345      * a metric type and a
5346      * [MonitoredResourceDescriptor][google.api.MonitoredResourceDescriptor], that
5347      * is associated with this metric type can only be associated with one of the
5348      * monitored resource types listed here.
5349      * </pre>
5350      *
5351      * <code>repeated string monitored_resource_types = 13;</code>
5352      *
5353      * @param value The bytes of the monitoredResourceTypes to add.
5354      * @return This builder for chaining.
5355      */
addMonitoredResourceTypesBytes(com.google.protobuf.ByteString value)5356     public Builder addMonitoredResourceTypesBytes(com.google.protobuf.ByteString value) {
5357       if (value == null) {
5358         throw new NullPointerException();
5359       }
5360       checkByteStringIsUtf8(value);
5361       ensureMonitoredResourceTypesIsMutable();
5362       monitoredResourceTypes_.add(value);
5363       onChanged();
5364       return this;
5365     }
5366 
5367     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)5368     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
5369       return super.setUnknownFields(unknownFields);
5370     }
5371 
5372     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)5373     public final Builder mergeUnknownFields(
5374         final com.google.protobuf.UnknownFieldSet unknownFields) {
5375       return super.mergeUnknownFields(unknownFields);
5376     }
5377 
5378     // @@protoc_insertion_point(builder_scope:google.api.MetricDescriptor)
5379   }
5380 
5381   // @@protoc_insertion_point(class_scope:google.api.MetricDescriptor)
5382   private static final com.google.api.MetricDescriptor DEFAULT_INSTANCE;
5383 
5384   static {
5385     DEFAULT_INSTANCE = new com.google.api.MetricDescriptor();
5386   }
5387 
getDefaultInstance()5388   public static com.google.api.MetricDescriptor getDefaultInstance() {
5389     return DEFAULT_INSTANCE;
5390   }
5391 
5392   private static final com.google.protobuf.Parser<MetricDescriptor> PARSER =
5393       new com.google.protobuf.AbstractParser<MetricDescriptor>() {
5394         @java.lang.Override
5395         public MetricDescriptor parsePartialFrom(
5396             com.google.protobuf.CodedInputStream input,
5397             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
5398             throws com.google.protobuf.InvalidProtocolBufferException {
5399           Builder builder = newBuilder();
5400           try {
5401             builder.mergeFrom(input, extensionRegistry);
5402           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
5403             throw e.setUnfinishedMessage(builder.buildPartial());
5404           } catch (com.google.protobuf.UninitializedMessageException e) {
5405             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
5406           } catch (java.io.IOException e) {
5407             throw new com.google.protobuf.InvalidProtocolBufferException(e)
5408                 .setUnfinishedMessage(builder.buildPartial());
5409           }
5410           return builder.buildPartial();
5411         }
5412       };
5413 
parser()5414   public static com.google.protobuf.Parser<MetricDescriptor> parser() {
5415     return PARSER;
5416   }
5417 
5418   @java.lang.Override
getParserForType()5419   public com.google.protobuf.Parser<MetricDescriptor> getParserForType() {
5420     return PARSER;
5421   }
5422 
5423   @java.lang.Override
getDefaultInstanceForType()5424   public com.google.api.MetricDescriptor getDefaultInstanceForType() {
5425     return DEFAULT_INSTANCE;
5426   }
5427 }
5428