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