• 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/analytics/data/v1beta/data.proto
18 
19 package com.google.analytics.data.v1beta;
20 
21 /**
22  *
23  *
24  * <pre>
25  * The quantitative measurements of a report. For example, the metric
26  * `eventCount` is the total number of events. Requests are allowed up to 10
27  * metrics.
28  * </pre>
29  *
30  * Protobuf type {@code google.analytics.data.v1beta.Metric}
31  */
32 public final class Metric extends com.google.protobuf.GeneratedMessageV3
33     implements
34     // @@protoc_insertion_point(message_implements:google.analytics.data.v1beta.Metric)
35     MetricOrBuilder {
36   private static final long serialVersionUID = 0L;
37   // Use Metric.newBuilder() to construct.
Metric(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)38   private Metric(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
39     super(builder);
40   }
41 
Metric()42   private Metric() {
43     name_ = "";
44     expression_ = "";
45   }
46 
47   @java.lang.Override
48   @SuppressWarnings({"unused"})
newInstance(UnusedPrivateParameter unused)49   protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
50     return new Metric();
51   }
52 
53   @java.lang.Override
getUnknownFields()54   public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
55     return this.unknownFields;
56   }
57 
getDescriptor()58   public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
59     return com.google.analytics.data.v1beta.ReportingApiProto
60         .internal_static_google_analytics_data_v1beta_Metric_descriptor;
61   }
62 
63   @java.lang.Override
64   protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()65       internalGetFieldAccessorTable() {
66     return com.google.analytics.data.v1beta.ReportingApiProto
67         .internal_static_google_analytics_data_v1beta_Metric_fieldAccessorTable
68         .ensureFieldAccessorsInitialized(
69             com.google.analytics.data.v1beta.Metric.class,
70             com.google.analytics.data.v1beta.Metric.Builder.class);
71   }
72 
73   public static final int NAME_FIELD_NUMBER = 1;
74 
75   @SuppressWarnings("serial")
76   private volatile java.lang.Object name_ = "";
77   /**
78    *
79    *
80    * <pre>
81    * The name of the metric. See the [API
82    * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
83    * for the list of metric names.
84    * If `expression` is specified, `name` can be any string that you would like
85    * within the allowed character set. For example if `expression` is
86    * `screenPageViews/sessions`, you could call that metric's name =
87    * `viewsPerSession`. Metric names that you choose must match the regular
88    * expression `^[a-zA-Z0-9_]$`.
89    * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
90    * `expression`.
91    * </pre>
92    *
93    * <code>string name = 1;</code>
94    *
95    * @return The name.
96    */
97   @java.lang.Override
getName()98   public java.lang.String getName() {
99     java.lang.Object ref = name_;
100     if (ref instanceof java.lang.String) {
101       return (java.lang.String) ref;
102     } else {
103       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
104       java.lang.String s = bs.toStringUtf8();
105       name_ = s;
106       return s;
107     }
108   }
109   /**
110    *
111    *
112    * <pre>
113    * The name of the metric. See the [API
114    * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
115    * for the list of metric names.
116    * If `expression` is specified, `name` can be any string that you would like
117    * within the allowed character set. For example if `expression` is
118    * `screenPageViews/sessions`, you could call that metric's name =
119    * `viewsPerSession`. Metric names that you choose must match the regular
120    * expression `^[a-zA-Z0-9_]$`.
121    * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
122    * `expression`.
123    * </pre>
124    *
125    * <code>string name = 1;</code>
126    *
127    * @return The bytes for name.
128    */
129   @java.lang.Override
getNameBytes()130   public com.google.protobuf.ByteString getNameBytes() {
131     java.lang.Object ref = name_;
132     if (ref instanceof java.lang.String) {
133       com.google.protobuf.ByteString b =
134           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
135       name_ = b;
136       return b;
137     } else {
138       return (com.google.protobuf.ByteString) ref;
139     }
140   }
141 
142   public static final int EXPRESSION_FIELD_NUMBER = 2;
143 
144   @SuppressWarnings("serial")
145   private volatile java.lang.Object expression_ = "";
146   /**
147    *
148    *
149    * <pre>
150    * A mathematical expression for derived metrics. For example, the metric
151    * Event count per user is `eventCount/totalUsers`.
152    * </pre>
153    *
154    * <code>string expression = 2;</code>
155    *
156    * @return The expression.
157    */
158   @java.lang.Override
getExpression()159   public java.lang.String getExpression() {
160     java.lang.Object ref = expression_;
161     if (ref instanceof java.lang.String) {
162       return (java.lang.String) ref;
163     } else {
164       com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
165       java.lang.String s = bs.toStringUtf8();
166       expression_ = s;
167       return s;
168     }
169   }
170   /**
171    *
172    *
173    * <pre>
174    * A mathematical expression for derived metrics. For example, the metric
175    * Event count per user is `eventCount/totalUsers`.
176    * </pre>
177    *
178    * <code>string expression = 2;</code>
179    *
180    * @return The bytes for expression.
181    */
182   @java.lang.Override
getExpressionBytes()183   public com.google.protobuf.ByteString getExpressionBytes() {
184     java.lang.Object ref = expression_;
185     if (ref instanceof java.lang.String) {
186       com.google.protobuf.ByteString b =
187           com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
188       expression_ = b;
189       return b;
190     } else {
191       return (com.google.protobuf.ByteString) ref;
192     }
193   }
194 
195   public static final int INVISIBLE_FIELD_NUMBER = 3;
196   private boolean invisible_ = false;
197   /**
198    *
199    *
200    * <pre>
201    * Indicates if a metric is invisible in the report response. If a metric is
202    * invisible, the metric will not produce a column in the response, but can be
203    * used in `metricFilter`, `orderBys`, or a metric `expression`.
204    * </pre>
205    *
206    * <code>bool invisible = 3;</code>
207    *
208    * @return The invisible.
209    */
210   @java.lang.Override
getInvisible()211   public boolean getInvisible() {
212     return invisible_;
213   }
214 
215   private byte memoizedIsInitialized = -1;
216 
217   @java.lang.Override
isInitialized()218   public final boolean isInitialized() {
219     byte isInitialized = memoizedIsInitialized;
220     if (isInitialized == 1) return true;
221     if (isInitialized == 0) return false;
222 
223     memoizedIsInitialized = 1;
224     return true;
225   }
226 
227   @java.lang.Override
writeTo(com.google.protobuf.CodedOutputStream output)228   public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
229     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
230       com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
231     }
232     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(expression_)) {
233       com.google.protobuf.GeneratedMessageV3.writeString(output, 2, expression_);
234     }
235     if (invisible_ != false) {
236       output.writeBool(3, invisible_);
237     }
238     getUnknownFields().writeTo(output);
239   }
240 
241   @java.lang.Override
getSerializedSize()242   public int getSerializedSize() {
243     int size = memoizedSize;
244     if (size != -1) return size;
245 
246     size = 0;
247     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
248       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
249     }
250     if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(expression_)) {
251       size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, expression_);
252     }
253     if (invisible_ != false) {
254       size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, invisible_);
255     }
256     size += getUnknownFields().getSerializedSize();
257     memoizedSize = size;
258     return size;
259   }
260 
261   @java.lang.Override
equals(final java.lang.Object obj)262   public boolean equals(final java.lang.Object obj) {
263     if (obj == this) {
264       return true;
265     }
266     if (!(obj instanceof com.google.analytics.data.v1beta.Metric)) {
267       return super.equals(obj);
268     }
269     com.google.analytics.data.v1beta.Metric other = (com.google.analytics.data.v1beta.Metric) obj;
270 
271     if (!getName().equals(other.getName())) return false;
272     if (!getExpression().equals(other.getExpression())) return false;
273     if (getInvisible() != other.getInvisible()) return false;
274     if (!getUnknownFields().equals(other.getUnknownFields())) return false;
275     return true;
276   }
277 
278   @java.lang.Override
hashCode()279   public int hashCode() {
280     if (memoizedHashCode != 0) {
281       return memoizedHashCode;
282     }
283     int hash = 41;
284     hash = (19 * hash) + getDescriptor().hashCode();
285     hash = (37 * hash) + NAME_FIELD_NUMBER;
286     hash = (53 * hash) + getName().hashCode();
287     hash = (37 * hash) + EXPRESSION_FIELD_NUMBER;
288     hash = (53 * hash) + getExpression().hashCode();
289     hash = (37 * hash) + INVISIBLE_FIELD_NUMBER;
290     hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getInvisible());
291     hash = (29 * hash) + getUnknownFields().hashCode();
292     memoizedHashCode = hash;
293     return hash;
294   }
295 
parseFrom(java.nio.ByteBuffer data)296   public static com.google.analytics.data.v1beta.Metric parseFrom(java.nio.ByteBuffer data)
297       throws com.google.protobuf.InvalidProtocolBufferException {
298     return PARSER.parseFrom(data);
299   }
300 
parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)301   public static com.google.analytics.data.v1beta.Metric parseFrom(
302       java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
303       throws com.google.protobuf.InvalidProtocolBufferException {
304     return PARSER.parseFrom(data, extensionRegistry);
305   }
306 
parseFrom( com.google.protobuf.ByteString data)307   public static com.google.analytics.data.v1beta.Metric parseFrom(
308       com.google.protobuf.ByteString data)
309       throws com.google.protobuf.InvalidProtocolBufferException {
310     return PARSER.parseFrom(data);
311   }
312 
parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)313   public static com.google.analytics.data.v1beta.Metric parseFrom(
314       com.google.protobuf.ByteString data,
315       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
316       throws com.google.protobuf.InvalidProtocolBufferException {
317     return PARSER.parseFrom(data, extensionRegistry);
318   }
319 
parseFrom(byte[] data)320   public static com.google.analytics.data.v1beta.Metric parseFrom(byte[] data)
321       throws com.google.protobuf.InvalidProtocolBufferException {
322     return PARSER.parseFrom(data);
323   }
324 
parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)325   public static com.google.analytics.data.v1beta.Metric parseFrom(
326       byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
327       throws com.google.protobuf.InvalidProtocolBufferException {
328     return PARSER.parseFrom(data, extensionRegistry);
329   }
330 
parseFrom(java.io.InputStream input)331   public static com.google.analytics.data.v1beta.Metric parseFrom(java.io.InputStream input)
332       throws java.io.IOException {
333     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
334   }
335 
parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)336   public static com.google.analytics.data.v1beta.Metric parseFrom(
337       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
338       throws java.io.IOException {
339     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
340         PARSER, input, extensionRegistry);
341   }
342 
parseDelimitedFrom( java.io.InputStream input)343   public static com.google.analytics.data.v1beta.Metric parseDelimitedFrom(
344       java.io.InputStream input) throws java.io.IOException {
345     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
346   }
347 
parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)348   public static com.google.analytics.data.v1beta.Metric parseDelimitedFrom(
349       java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
350       throws java.io.IOException {
351     return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
352         PARSER, input, extensionRegistry);
353   }
354 
parseFrom( com.google.protobuf.CodedInputStream input)355   public static com.google.analytics.data.v1beta.Metric parseFrom(
356       com.google.protobuf.CodedInputStream input) throws java.io.IOException {
357     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
358   }
359 
parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)360   public static com.google.analytics.data.v1beta.Metric parseFrom(
361       com.google.protobuf.CodedInputStream input,
362       com.google.protobuf.ExtensionRegistryLite extensionRegistry)
363       throws java.io.IOException {
364     return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
365         PARSER, input, extensionRegistry);
366   }
367 
368   @java.lang.Override
newBuilderForType()369   public Builder newBuilderForType() {
370     return newBuilder();
371   }
372 
newBuilder()373   public static Builder newBuilder() {
374     return DEFAULT_INSTANCE.toBuilder();
375   }
376 
newBuilder(com.google.analytics.data.v1beta.Metric prototype)377   public static Builder newBuilder(com.google.analytics.data.v1beta.Metric prototype) {
378     return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
379   }
380 
381   @java.lang.Override
toBuilder()382   public Builder toBuilder() {
383     return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
384   }
385 
386   @java.lang.Override
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)387   protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
388     Builder builder = new Builder(parent);
389     return builder;
390   }
391   /**
392    *
393    *
394    * <pre>
395    * The quantitative measurements of a report. For example, the metric
396    * `eventCount` is the total number of events. Requests are allowed up to 10
397    * metrics.
398    * </pre>
399    *
400    * Protobuf type {@code google.analytics.data.v1beta.Metric}
401    */
402   public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
403       implements
404       // @@protoc_insertion_point(builder_implements:google.analytics.data.v1beta.Metric)
405       com.google.analytics.data.v1beta.MetricOrBuilder {
getDescriptor()406     public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
407       return com.google.analytics.data.v1beta.ReportingApiProto
408           .internal_static_google_analytics_data_v1beta_Metric_descriptor;
409     }
410 
411     @java.lang.Override
412     protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()413         internalGetFieldAccessorTable() {
414       return com.google.analytics.data.v1beta.ReportingApiProto
415           .internal_static_google_analytics_data_v1beta_Metric_fieldAccessorTable
416           .ensureFieldAccessorsInitialized(
417               com.google.analytics.data.v1beta.Metric.class,
418               com.google.analytics.data.v1beta.Metric.Builder.class);
419     }
420 
421     // Construct using com.google.analytics.data.v1beta.Metric.newBuilder()
Builder()422     private Builder() {}
423 
Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)424     private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
425       super(parent);
426     }
427 
428     @java.lang.Override
clear()429     public Builder clear() {
430       super.clear();
431       bitField0_ = 0;
432       name_ = "";
433       expression_ = "";
434       invisible_ = false;
435       return this;
436     }
437 
438     @java.lang.Override
getDescriptorForType()439     public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
440       return com.google.analytics.data.v1beta.ReportingApiProto
441           .internal_static_google_analytics_data_v1beta_Metric_descriptor;
442     }
443 
444     @java.lang.Override
getDefaultInstanceForType()445     public com.google.analytics.data.v1beta.Metric getDefaultInstanceForType() {
446       return com.google.analytics.data.v1beta.Metric.getDefaultInstance();
447     }
448 
449     @java.lang.Override
build()450     public com.google.analytics.data.v1beta.Metric build() {
451       com.google.analytics.data.v1beta.Metric result = buildPartial();
452       if (!result.isInitialized()) {
453         throw newUninitializedMessageException(result);
454       }
455       return result;
456     }
457 
458     @java.lang.Override
buildPartial()459     public com.google.analytics.data.v1beta.Metric buildPartial() {
460       com.google.analytics.data.v1beta.Metric result =
461           new com.google.analytics.data.v1beta.Metric(this);
462       if (bitField0_ != 0) {
463         buildPartial0(result);
464       }
465       onBuilt();
466       return result;
467     }
468 
buildPartial0(com.google.analytics.data.v1beta.Metric result)469     private void buildPartial0(com.google.analytics.data.v1beta.Metric result) {
470       int from_bitField0_ = bitField0_;
471       if (((from_bitField0_ & 0x00000001) != 0)) {
472         result.name_ = name_;
473       }
474       if (((from_bitField0_ & 0x00000002) != 0)) {
475         result.expression_ = expression_;
476       }
477       if (((from_bitField0_ & 0x00000004) != 0)) {
478         result.invisible_ = invisible_;
479       }
480     }
481 
482     @java.lang.Override
clone()483     public Builder clone() {
484       return super.clone();
485     }
486 
487     @java.lang.Override
setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)488     public Builder setField(
489         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
490       return super.setField(field, value);
491     }
492 
493     @java.lang.Override
clearField(com.google.protobuf.Descriptors.FieldDescriptor field)494     public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
495       return super.clearField(field);
496     }
497 
498     @java.lang.Override
clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)499     public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
500       return super.clearOneof(oneof);
501     }
502 
503     @java.lang.Override
setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)504     public Builder setRepeatedField(
505         com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
506       return super.setRepeatedField(field, index, value);
507     }
508 
509     @java.lang.Override
addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)510     public Builder addRepeatedField(
511         com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
512       return super.addRepeatedField(field, value);
513     }
514 
515     @java.lang.Override
mergeFrom(com.google.protobuf.Message other)516     public Builder mergeFrom(com.google.protobuf.Message other) {
517       if (other instanceof com.google.analytics.data.v1beta.Metric) {
518         return mergeFrom((com.google.analytics.data.v1beta.Metric) other);
519       } else {
520         super.mergeFrom(other);
521         return this;
522       }
523     }
524 
mergeFrom(com.google.analytics.data.v1beta.Metric other)525     public Builder mergeFrom(com.google.analytics.data.v1beta.Metric other) {
526       if (other == com.google.analytics.data.v1beta.Metric.getDefaultInstance()) return this;
527       if (!other.getName().isEmpty()) {
528         name_ = other.name_;
529         bitField0_ |= 0x00000001;
530         onChanged();
531       }
532       if (!other.getExpression().isEmpty()) {
533         expression_ = other.expression_;
534         bitField0_ |= 0x00000002;
535         onChanged();
536       }
537       if (other.getInvisible() != false) {
538         setInvisible(other.getInvisible());
539       }
540       this.mergeUnknownFields(other.getUnknownFields());
541       onChanged();
542       return this;
543     }
544 
545     @java.lang.Override
isInitialized()546     public final boolean isInitialized() {
547       return true;
548     }
549 
550     @java.lang.Override
mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)551     public Builder mergeFrom(
552         com.google.protobuf.CodedInputStream input,
553         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
554         throws java.io.IOException {
555       if (extensionRegistry == null) {
556         throw new java.lang.NullPointerException();
557       }
558       try {
559         boolean done = false;
560         while (!done) {
561           int tag = input.readTag();
562           switch (tag) {
563             case 0:
564               done = true;
565               break;
566             case 10:
567               {
568                 name_ = input.readStringRequireUtf8();
569                 bitField0_ |= 0x00000001;
570                 break;
571               } // case 10
572             case 18:
573               {
574                 expression_ = input.readStringRequireUtf8();
575                 bitField0_ |= 0x00000002;
576                 break;
577               } // case 18
578             case 24:
579               {
580                 invisible_ = input.readBool();
581                 bitField0_ |= 0x00000004;
582                 break;
583               } // case 24
584             default:
585               {
586                 if (!super.parseUnknownField(input, extensionRegistry, tag)) {
587                   done = true; // was an endgroup tag
588                 }
589                 break;
590               } // default:
591           } // switch (tag)
592         } // while (!done)
593       } catch (com.google.protobuf.InvalidProtocolBufferException e) {
594         throw e.unwrapIOException();
595       } finally {
596         onChanged();
597       } // finally
598       return this;
599     }
600 
601     private int bitField0_;
602 
603     private java.lang.Object name_ = "";
604     /**
605      *
606      *
607      * <pre>
608      * The name of the metric. See the [API
609      * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
610      * for the list of metric names.
611      * If `expression` is specified, `name` can be any string that you would like
612      * within the allowed character set. For example if `expression` is
613      * `screenPageViews/sessions`, you could call that metric's name =
614      * `viewsPerSession`. Metric names that you choose must match the regular
615      * expression `^[a-zA-Z0-9_]$`.
616      * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
617      * `expression`.
618      * </pre>
619      *
620      * <code>string name = 1;</code>
621      *
622      * @return The name.
623      */
getName()624     public java.lang.String getName() {
625       java.lang.Object ref = name_;
626       if (!(ref instanceof java.lang.String)) {
627         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
628         java.lang.String s = bs.toStringUtf8();
629         name_ = s;
630         return s;
631       } else {
632         return (java.lang.String) ref;
633       }
634     }
635     /**
636      *
637      *
638      * <pre>
639      * The name of the metric. See the [API
640      * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
641      * for the list of metric names.
642      * If `expression` is specified, `name` can be any string that you would like
643      * within the allowed character set. For example if `expression` is
644      * `screenPageViews/sessions`, you could call that metric's name =
645      * `viewsPerSession`. Metric names that you choose must match the regular
646      * expression `^[a-zA-Z0-9_]$`.
647      * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
648      * `expression`.
649      * </pre>
650      *
651      * <code>string name = 1;</code>
652      *
653      * @return The bytes for name.
654      */
getNameBytes()655     public com.google.protobuf.ByteString getNameBytes() {
656       java.lang.Object ref = name_;
657       if (ref instanceof String) {
658         com.google.protobuf.ByteString b =
659             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
660         name_ = b;
661         return b;
662       } else {
663         return (com.google.protobuf.ByteString) ref;
664       }
665     }
666     /**
667      *
668      *
669      * <pre>
670      * The name of the metric. See the [API
671      * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
672      * for the list of metric names.
673      * If `expression` is specified, `name` can be any string that you would like
674      * within the allowed character set. For example if `expression` is
675      * `screenPageViews/sessions`, you could call that metric's name =
676      * `viewsPerSession`. Metric names that you choose must match the regular
677      * expression `^[a-zA-Z0-9_]$`.
678      * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
679      * `expression`.
680      * </pre>
681      *
682      * <code>string name = 1;</code>
683      *
684      * @param value The name to set.
685      * @return This builder for chaining.
686      */
setName(java.lang.String value)687     public Builder setName(java.lang.String value) {
688       if (value == null) {
689         throw new NullPointerException();
690       }
691       name_ = value;
692       bitField0_ |= 0x00000001;
693       onChanged();
694       return this;
695     }
696     /**
697      *
698      *
699      * <pre>
700      * The name of the metric. See the [API
701      * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
702      * for the list of metric names.
703      * If `expression` is specified, `name` can be any string that you would like
704      * within the allowed character set. For example if `expression` is
705      * `screenPageViews/sessions`, you could call that metric's name =
706      * `viewsPerSession`. Metric names that you choose must match the regular
707      * expression `^[a-zA-Z0-9_]$`.
708      * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
709      * `expression`.
710      * </pre>
711      *
712      * <code>string name = 1;</code>
713      *
714      * @return This builder for chaining.
715      */
clearName()716     public Builder clearName() {
717       name_ = getDefaultInstance().getName();
718       bitField0_ = (bitField0_ & ~0x00000001);
719       onChanged();
720       return this;
721     }
722     /**
723      *
724      *
725      * <pre>
726      * The name of the metric. See the [API
727      * Metrics](https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema#metrics)
728      * for the list of metric names.
729      * If `expression` is specified, `name` can be any string that you would like
730      * within the allowed character set. For example if `expression` is
731      * `screenPageViews/sessions`, you could call that metric's name =
732      * `viewsPerSession`. Metric names that you choose must match the regular
733      * expression `^[a-zA-Z0-9_]$`.
734      * Metrics are referenced by `name` in `metricFilter`, `orderBys`, and metric
735      * `expression`.
736      * </pre>
737      *
738      * <code>string name = 1;</code>
739      *
740      * @param value The bytes for name to set.
741      * @return This builder for chaining.
742      */
setNameBytes(com.google.protobuf.ByteString value)743     public Builder setNameBytes(com.google.protobuf.ByteString value) {
744       if (value == null) {
745         throw new NullPointerException();
746       }
747       checkByteStringIsUtf8(value);
748       name_ = value;
749       bitField0_ |= 0x00000001;
750       onChanged();
751       return this;
752     }
753 
754     private java.lang.Object expression_ = "";
755     /**
756      *
757      *
758      * <pre>
759      * A mathematical expression for derived metrics. For example, the metric
760      * Event count per user is `eventCount/totalUsers`.
761      * </pre>
762      *
763      * <code>string expression = 2;</code>
764      *
765      * @return The expression.
766      */
getExpression()767     public java.lang.String getExpression() {
768       java.lang.Object ref = expression_;
769       if (!(ref instanceof java.lang.String)) {
770         com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
771         java.lang.String s = bs.toStringUtf8();
772         expression_ = s;
773         return s;
774       } else {
775         return (java.lang.String) ref;
776       }
777     }
778     /**
779      *
780      *
781      * <pre>
782      * A mathematical expression for derived metrics. For example, the metric
783      * Event count per user is `eventCount/totalUsers`.
784      * </pre>
785      *
786      * <code>string expression = 2;</code>
787      *
788      * @return The bytes for expression.
789      */
getExpressionBytes()790     public com.google.protobuf.ByteString getExpressionBytes() {
791       java.lang.Object ref = expression_;
792       if (ref instanceof String) {
793         com.google.protobuf.ByteString b =
794             com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
795         expression_ = b;
796         return b;
797       } else {
798         return (com.google.protobuf.ByteString) ref;
799       }
800     }
801     /**
802      *
803      *
804      * <pre>
805      * A mathematical expression for derived metrics. For example, the metric
806      * Event count per user is `eventCount/totalUsers`.
807      * </pre>
808      *
809      * <code>string expression = 2;</code>
810      *
811      * @param value The expression to set.
812      * @return This builder for chaining.
813      */
setExpression(java.lang.String value)814     public Builder setExpression(java.lang.String value) {
815       if (value == null) {
816         throw new NullPointerException();
817       }
818       expression_ = value;
819       bitField0_ |= 0x00000002;
820       onChanged();
821       return this;
822     }
823     /**
824      *
825      *
826      * <pre>
827      * A mathematical expression for derived metrics. For example, the metric
828      * Event count per user is `eventCount/totalUsers`.
829      * </pre>
830      *
831      * <code>string expression = 2;</code>
832      *
833      * @return This builder for chaining.
834      */
clearExpression()835     public Builder clearExpression() {
836       expression_ = getDefaultInstance().getExpression();
837       bitField0_ = (bitField0_ & ~0x00000002);
838       onChanged();
839       return this;
840     }
841     /**
842      *
843      *
844      * <pre>
845      * A mathematical expression for derived metrics. For example, the metric
846      * Event count per user is `eventCount/totalUsers`.
847      * </pre>
848      *
849      * <code>string expression = 2;</code>
850      *
851      * @param value The bytes for expression to set.
852      * @return This builder for chaining.
853      */
setExpressionBytes(com.google.protobuf.ByteString value)854     public Builder setExpressionBytes(com.google.protobuf.ByteString value) {
855       if (value == null) {
856         throw new NullPointerException();
857       }
858       checkByteStringIsUtf8(value);
859       expression_ = value;
860       bitField0_ |= 0x00000002;
861       onChanged();
862       return this;
863     }
864 
865     private boolean invisible_;
866     /**
867      *
868      *
869      * <pre>
870      * Indicates if a metric is invisible in the report response. If a metric is
871      * invisible, the metric will not produce a column in the response, but can be
872      * used in `metricFilter`, `orderBys`, or a metric `expression`.
873      * </pre>
874      *
875      * <code>bool invisible = 3;</code>
876      *
877      * @return The invisible.
878      */
879     @java.lang.Override
getInvisible()880     public boolean getInvisible() {
881       return invisible_;
882     }
883     /**
884      *
885      *
886      * <pre>
887      * Indicates if a metric is invisible in the report response. If a metric is
888      * invisible, the metric will not produce a column in the response, but can be
889      * used in `metricFilter`, `orderBys`, or a metric `expression`.
890      * </pre>
891      *
892      * <code>bool invisible = 3;</code>
893      *
894      * @param value The invisible to set.
895      * @return This builder for chaining.
896      */
setInvisible(boolean value)897     public Builder setInvisible(boolean value) {
898 
899       invisible_ = value;
900       bitField0_ |= 0x00000004;
901       onChanged();
902       return this;
903     }
904     /**
905      *
906      *
907      * <pre>
908      * Indicates if a metric is invisible in the report response. If a metric is
909      * invisible, the metric will not produce a column in the response, but can be
910      * used in `metricFilter`, `orderBys`, or a metric `expression`.
911      * </pre>
912      *
913      * <code>bool invisible = 3;</code>
914      *
915      * @return This builder for chaining.
916      */
clearInvisible()917     public Builder clearInvisible() {
918       bitField0_ = (bitField0_ & ~0x00000004);
919       invisible_ = false;
920       onChanged();
921       return this;
922     }
923 
924     @java.lang.Override
setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)925     public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
926       return super.setUnknownFields(unknownFields);
927     }
928 
929     @java.lang.Override
mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)930     public final Builder mergeUnknownFields(
931         final com.google.protobuf.UnknownFieldSet unknownFields) {
932       return super.mergeUnknownFields(unknownFields);
933     }
934 
935     // @@protoc_insertion_point(builder_scope:google.analytics.data.v1beta.Metric)
936   }
937 
938   // @@protoc_insertion_point(class_scope:google.analytics.data.v1beta.Metric)
939   private static final com.google.analytics.data.v1beta.Metric DEFAULT_INSTANCE;
940 
941   static {
942     DEFAULT_INSTANCE = new com.google.analytics.data.v1beta.Metric();
943   }
944 
getDefaultInstance()945   public static com.google.analytics.data.v1beta.Metric getDefaultInstance() {
946     return DEFAULT_INSTANCE;
947   }
948 
949   private static final com.google.protobuf.Parser<Metric> PARSER =
950       new com.google.protobuf.AbstractParser<Metric>() {
951         @java.lang.Override
952         public Metric parsePartialFrom(
953             com.google.protobuf.CodedInputStream input,
954             com.google.protobuf.ExtensionRegistryLite extensionRegistry)
955             throws com.google.protobuf.InvalidProtocolBufferException {
956           Builder builder = newBuilder();
957           try {
958             builder.mergeFrom(input, extensionRegistry);
959           } catch (com.google.protobuf.InvalidProtocolBufferException e) {
960             throw e.setUnfinishedMessage(builder.buildPartial());
961           } catch (com.google.protobuf.UninitializedMessageException e) {
962             throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
963           } catch (java.io.IOException e) {
964             throw new com.google.protobuf.InvalidProtocolBufferException(e)
965                 .setUnfinishedMessage(builder.buildPartial());
966           }
967           return builder.buildPartial();
968         }
969       };
970 
parser()971   public static com.google.protobuf.Parser<Metric> parser() {
972     return PARSER;
973   }
974 
975   @java.lang.Override
getParserForType()976   public com.google.protobuf.Parser<Metric> getParserForType() {
977     return PARSER;
978   }
979 
980   @java.lang.Override
getDefaultInstanceForType()981   public com.google.analytics.data.v1beta.Metric getDefaultInstanceForType() {
982     return DEFAULT_INSTANCE;
983   }
984 }
985