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 * Configures the extended reporting date range for a cohort report. Specifies 26 * an offset duration to follow the cohorts over. 27 * </pre> 28 * 29 * Protobuf type {@code google.analytics.data.v1beta.CohortsRange} 30 */ 31 public final class CohortsRange extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.analytics.data.v1beta.CohortsRange) 34 CohortsRangeOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use CohortsRange.newBuilder() to construct. CohortsRange(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private CohortsRange(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 CohortsRange()41 private CohortsRange() { 42 granularity_ = 0; 43 } 44 45 @java.lang.Override 46 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)47 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 48 return new CohortsRange(); 49 } 50 51 @java.lang.Override getUnknownFields()52 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 53 return this.unknownFields; 54 } 55 getDescriptor()56 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 57 return com.google.analytics.data.v1beta.ReportingApiProto 58 .internal_static_google_analytics_data_v1beta_CohortsRange_descriptor; 59 } 60 61 @java.lang.Override 62 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()63 internalGetFieldAccessorTable() { 64 return com.google.analytics.data.v1beta.ReportingApiProto 65 .internal_static_google_analytics_data_v1beta_CohortsRange_fieldAccessorTable 66 .ensureFieldAccessorsInitialized( 67 com.google.analytics.data.v1beta.CohortsRange.class, 68 com.google.analytics.data.v1beta.CohortsRange.Builder.class); 69 } 70 71 /** 72 * 73 * 74 * <pre> 75 * The granularity used to interpret the `startOffset` and `endOffset` for the 76 * extended reporting date range for a cohort report. 77 * </pre> 78 * 79 * Protobuf enum {@code google.analytics.data.v1beta.CohortsRange.Granularity} 80 */ 81 public enum Granularity implements com.google.protobuf.ProtocolMessageEnum { 82 /** 83 * 84 * 85 * <pre> 86 * Should never be specified. 87 * </pre> 88 * 89 * <code>GRANULARITY_UNSPECIFIED = 0;</code> 90 */ 91 GRANULARITY_UNSPECIFIED(0), 92 /** 93 * 94 * 95 * <pre> 96 * Daily granularity. Commonly used if the cohort's `dateRange` is a single 97 * day and the request contains `cohortNthDay`. 98 * </pre> 99 * 100 * <code>DAILY = 1;</code> 101 */ 102 DAILY(1), 103 /** 104 * 105 * 106 * <pre> 107 * Weekly granularity. Commonly used if the cohort's `dateRange` is a week 108 * in duration (starting on Sunday and ending on Saturday) and the request 109 * contains `cohortNthWeek`. 110 * </pre> 111 * 112 * <code>WEEKLY = 2;</code> 113 */ 114 WEEKLY(2), 115 /** 116 * 117 * 118 * <pre> 119 * Monthly granularity. Commonly used if the cohort's `dateRange` is a month 120 * in duration and the request contains `cohortNthMonth`. 121 * </pre> 122 * 123 * <code>MONTHLY = 3;</code> 124 */ 125 MONTHLY(3), 126 UNRECOGNIZED(-1), 127 ; 128 129 /** 130 * 131 * 132 * <pre> 133 * Should never be specified. 134 * </pre> 135 * 136 * <code>GRANULARITY_UNSPECIFIED = 0;</code> 137 */ 138 public static final int GRANULARITY_UNSPECIFIED_VALUE = 0; 139 /** 140 * 141 * 142 * <pre> 143 * Daily granularity. Commonly used if the cohort's `dateRange` is a single 144 * day and the request contains `cohortNthDay`. 145 * </pre> 146 * 147 * <code>DAILY = 1;</code> 148 */ 149 public static final int DAILY_VALUE = 1; 150 /** 151 * 152 * 153 * <pre> 154 * Weekly granularity. Commonly used if the cohort's `dateRange` is a week 155 * in duration (starting on Sunday and ending on Saturday) and the request 156 * contains `cohortNthWeek`. 157 * </pre> 158 * 159 * <code>WEEKLY = 2;</code> 160 */ 161 public static final int WEEKLY_VALUE = 2; 162 /** 163 * 164 * 165 * <pre> 166 * Monthly granularity. Commonly used if the cohort's `dateRange` is a month 167 * in duration and the request contains `cohortNthMonth`. 168 * </pre> 169 * 170 * <code>MONTHLY = 3;</code> 171 */ 172 public static final int MONTHLY_VALUE = 3; 173 getNumber()174 public final int getNumber() { 175 if (this == UNRECOGNIZED) { 176 throw new java.lang.IllegalArgumentException( 177 "Can't get the number of an unknown enum value."); 178 } 179 return value; 180 } 181 182 /** 183 * @param value The numeric wire value of the corresponding enum entry. 184 * @return The enum associated with the given numeric wire value. 185 * @deprecated Use {@link #forNumber(int)} instead. 186 */ 187 @java.lang.Deprecated valueOf(int value)188 public static Granularity valueOf(int value) { 189 return forNumber(value); 190 } 191 192 /** 193 * @param value The numeric wire value of the corresponding enum entry. 194 * @return The enum associated with the given numeric wire value. 195 */ forNumber(int value)196 public static Granularity forNumber(int value) { 197 switch (value) { 198 case 0: 199 return GRANULARITY_UNSPECIFIED; 200 case 1: 201 return DAILY; 202 case 2: 203 return WEEKLY; 204 case 3: 205 return MONTHLY; 206 default: 207 return null; 208 } 209 } 210 internalGetValueMap()211 public static com.google.protobuf.Internal.EnumLiteMap<Granularity> internalGetValueMap() { 212 return internalValueMap; 213 } 214 215 private static final com.google.protobuf.Internal.EnumLiteMap<Granularity> internalValueMap = 216 new com.google.protobuf.Internal.EnumLiteMap<Granularity>() { 217 public Granularity findValueByNumber(int number) { 218 return Granularity.forNumber(number); 219 } 220 }; 221 getValueDescriptor()222 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 223 if (this == UNRECOGNIZED) { 224 throw new java.lang.IllegalStateException( 225 "Can't get the descriptor of an unrecognized enum value."); 226 } 227 return getDescriptor().getValues().get(ordinal()); 228 } 229 getDescriptorForType()230 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 231 return getDescriptor(); 232 } 233 getDescriptor()234 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 235 return com.google.analytics.data.v1beta.CohortsRange.getDescriptor().getEnumTypes().get(0); 236 } 237 238 private static final Granularity[] VALUES = values(); 239 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)240 public static Granularity valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 241 if (desc.getType() != getDescriptor()) { 242 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 243 } 244 if (desc.getIndex() == -1) { 245 return UNRECOGNIZED; 246 } 247 return VALUES[desc.getIndex()]; 248 } 249 250 private final int value; 251 Granularity(int value)252 private Granularity(int value) { 253 this.value = value; 254 } 255 256 // @@protoc_insertion_point(enum_scope:google.analytics.data.v1beta.CohortsRange.Granularity) 257 } 258 259 public static final int GRANULARITY_FIELD_NUMBER = 1; 260 private int granularity_ = 0; 261 /** 262 * 263 * 264 * <pre> 265 * Required. The granularity used to interpret the `startOffset` and 266 * `endOffset` for the extended reporting date range for a cohort report. 267 * </pre> 268 * 269 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 270 * 271 * @return The enum numeric value on the wire for granularity. 272 */ 273 @java.lang.Override getGranularityValue()274 public int getGranularityValue() { 275 return granularity_; 276 } 277 /** 278 * 279 * 280 * <pre> 281 * Required. The granularity used to interpret the `startOffset` and 282 * `endOffset` for the extended reporting date range for a cohort report. 283 * </pre> 284 * 285 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 286 * 287 * @return The granularity. 288 */ 289 @java.lang.Override getGranularity()290 public com.google.analytics.data.v1beta.CohortsRange.Granularity getGranularity() { 291 com.google.analytics.data.v1beta.CohortsRange.Granularity result = 292 com.google.analytics.data.v1beta.CohortsRange.Granularity.forNumber(granularity_); 293 return result == null 294 ? com.google.analytics.data.v1beta.CohortsRange.Granularity.UNRECOGNIZED 295 : result; 296 } 297 298 public static final int START_OFFSET_FIELD_NUMBER = 2; 299 private int startOffset_ = 0; 300 /** 301 * 302 * 303 * <pre> 304 * `startOffset` specifies the start date of the extended reporting date range 305 * for a cohort report. `startOffset` is commonly set to 0 so that reports 306 * contain data from the acquisition of the cohort forward. 307 * If `granularity` is `DAILY`, the `startDate` of the extended reporting date 308 * range is `startDate` of the cohort plus `startOffset` days. 309 * If `granularity` is `WEEKLY`, the `startDate` of the extended reporting 310 * date range is `startDate` of the cohort plus `startOffset * 7` days. 311 * If `granularity` is `MONTHLY`, the `startDate` of the extended reporting 312 * date range is `startDate` of the cohort plus `startOffset * 30` days. 313 * </pre> 314 * 315 * <code>int32 start_offset = 2;</code> 316 * 317 * @return The startOffset. 318 */ 319 @java.lang.Override getStartOffset()320 public int getStartOffset() { 321 return startOffset_; 322 } 323 324 public static final int END_OFFSET_FIELD_NUMBER = 3; 325 private int endOffset_ = 0; 326 /** 327 * 328 * 329 * <pre> 330 * Required. `endOffset` specifies the end date of the extended reporting date 331 * range for a cohort report. `endOffset` can be any positive integer but is 332 * commonly set to 5 to 10 so that reports contain data on the cohort for the 333 * next several granularity time periods. 334 * If `granularity` is `DAILY`, the `endDate` of the extended reporting date 335 * range is `endDate` of the cohort plus `endOffset` days. 336 * If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date 337 * range is `endDate` of the cohort plus `endOffset * 7` days. 338 * If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date 339 * range is `endDate` of the cohort plus `endOffset * 30` days. 340 * </pre> 341 * 342 * <code>int32 end_offset = 3;</code> 343 * 344 * @return The endOffset. 345 */ 346 @java.lang.Override getEndOffset()347 public int getEndOffset() { 348 return endOffset_; 349 } 350 351 private byte memoizedIsInitialized = -1; 352 353 @java.lang.Override isInitialized()354 public final boolean isInitialized() { 355 byte isInitialized = memoizedIsInitialized; 356 if (isInitialized == 1) return true; 357 if (isInitialized == 0) return false; 358 359 memoizedIsInitialized = 1; 360 return true; 361 } 362 363 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)364 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 365 if (granularity_ 366 != com.google.analytics.data.v1beta.CohortsRange.Granularity.GRANULARITY_UNSPECIFIED 367 .getNumber()) { 368 output.writeEnum(1, granularity_); 369 } 370 if (startOffset_ != 0) { 371 output.writeInt32(2, startOffset_); 372 } 373 if (endOffset_ != 0) { 374 output.writeInt32(3, endOffset_); 375 } 376 getUnknownFields().writeTo(output); 377 } 378 379 @java.lang.Override getSerializedSize()380 public int getSerializedSize() { 381 int size = memoizedSize; 382 if (size != -1) return size; 383 384 size = 0; 385 if (granularity_ 386 != com.google.analytics.data.v1beta.CohortsRange.Granularity.GRANULARITY_UNSPECIFIED 387 .getNumber()) { 388 size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, granularity_); 389 } 390 if (startOffset_ != 0) { 391 size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, startOffset_); 392 } 393 if (endOffset_ != 0) { 394 size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, endOffset_); 395 } 396 size += getUnknownFields().getSerializedSize(); 397 memoizedSize = size; 398 return size; 399 } 400 401 @java.lang.Override equals(final java.lang.Object obj)402 public boolean equals(final java.lang.Object obj) { 403 if (obj == this) { 404 return true; 405 } 406 if (!(obj instanceof com.google.analytics.data.v1beta.CohortsRange)) { 407 return super.equals(obj); 408 } 409 com.google.analytics.data.v1beta.CohortsRange other = 410 (com.google.analytics.data.v1beta.CohortsRange) obj; 411 412 if (granularity_ != other.granularity_) return false; 413 if (getStartOffset() != other.getStartOffset()) return false; 414 if (getEndOffset() != other.getEndOffset()) return false; 415 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 416 return true; 417 } 418 419 @java.lang.Override hashCode()420 public int hashCode() { 421 if (memoizedHashCode != 0) { 422 return memoizedHashCode; 423 } 424 int hash = 41; 425 hash = (19 * hash) + getDescriptor().hashCode(); 426 hash = (37 * hash) + GRANULARITY_FIELD_NUMBER; 427 hash = (53 * hash) + granularity_; 428 hash = (37 * hash) + START_OFFSET_FIELD_NUMBER; 429 hash = (53 * hash) + getStartOffset(); 430 hash = (37 * hash) + END_OFFSET_FIELD_NUMBER; 431 hash = (53 * hash) + getEndOffset(); 432 hash = (29 * hash) + getUnknownFields().hashCode(); 433 memoizedHashCode = hash; 434 return hash; 435 } 436 parseFrom(java.nio.ByteBuffer data)437 public static com.google.analytics.data.v1beta.CohortsRange parseFrom(java.nio.ByteBuffer data) 438 throws com.google.protobuf.InvalidProtocolBufferException { 439 return PARSER.parseFrom(data); 440 } 441 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)442 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 443 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 444 throws com.google.protobuf.InvalidProtocolBufferException { 445 return PARSER.parseFrom(data, extensionRegistry); 446 } 447 parseFrom( com.google.protobuf.ByteString data)448 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 449 com.google.protobuf.ByteString data) 450 throws com.google.protobuf.InvalidProtocolBufferException { 451 return PARSER.parseFrom(data); 452 } 453 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)454 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 455 com.google.protobuf.ByteString data, 456 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 457 throws com.google.protobuf.InvalidProtocolBufferException { 458 return PARSER.parseFrom(data, extensionRegistry); 459 } 460 parseFrom(byte[] data)461 public static com.google.analytics.data.v1beta.CohortsRange parseFrom(byte[] data) 462 throws com.google.protobuf.InvalidProtocolBufferException { 463 return PARSER.parseFrom(data); 464 } 465 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)466 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 467 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 468 throws com.google.protobuf.InvalidProtocolBufferException { 469 return PARSER.parseFrom(data, extensionRegistry); 470 } 471 parseFrom(java.io.InputStream input)472 public static com.google.analytics.data.v1beta.CohortsRange parseFrom(java.io.InputStream input) 473 throws java.io.IOException { 474 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 475 } 476 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)477 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 478 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 479 throws java.io.IOException { 480 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 481 PARSER, input, extensionRegistry); 482 } 483 parseDelimitedFrom( java.io.InputStream input)484 public static com.google.analytics.data.v1beta.CohortsRange parseDelimitedFrom( 485 java.io.InputStream input) throws java.io.IOException { 486 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 487 } 488 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)489 public static com.google.analytics.data.v1beta.CohortsRange parseDelimitedFrom( 490 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 491 throws java.io.IOException { 492 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 493 PARSER, input, extensionRegistry); 494 } 495 parseFrom( com.google.protobuf.CodedInputStream input)496 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 497 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 498 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 499 } 500 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)501 public static com.google.analytics.data.v1beta.CohortsRange parseFrom( 502 com.google.protobuf.CodedInputStream input, 503 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 504 throws java.io.IOException { 505 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 506 PARSER, input, extensionRegistry); 507 } 508 509 @java.lang.Override newBuilderForType()510 public Builder newBuilderForType() { 511 return newBuilder(); 512 } 513 newBuilder()514 public static Builder newBuilder() { 515 return DEFAULT_INSTANCE.toBuilder(); 516 } 517 newBuilder(com.google.analytics.data.v1beta.CohortsRange prototype)518 public static Builder newBuilder(com.google.analytics.data.v1beta.CohortsRange prototype) { 519 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 520 } 521 522 @java.lang.Override toBuilder()523 public Builder toBuilder() { 524 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 525 } 526 527 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)528 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 529 Builder builder = new Builder(parent); 530 return builder; 531 } 532 /** 533 * 534 * 535 * <pre> 536 * Configures the extended reporting date range for a cohort report. Specifies 537 * an offset duration to follow the cohorts over. 538 * </pre> 539 * 540 * Protobuf type {@code google.analytics.data.v1beta.CohortsRange} 541 */ 542 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 543 implements 544 // @@protoc_insertion_point(builder_implements:google.analytics.data.v1beta.CohortsRange) 545 com.google.analytics.data.v1beta.CohortsRangeOrBuilder { getDescriptor()546 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 547 return com.google.analytics.data.v1beta.ReportingApiProto 548 .internal_static_google_analytics_data_v1beta_CohortsRange_descriptor; 549 } 550 551 @java.lang.Override 552 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()553 internalGetFieldAccessorTable() { 554 return com.google.analytics.data.v1beta.ReportingApiProto 555 .internal_static_google_analytics_data_v1beta_CohortsRange_fieldAccessorTable 556 .ensureFieldAccessorsInitialized( 557 com.google.analytics.data.v1beta.CohortsRange.class, 558 com.google.analytics.data.v1beta.CohortsRange.Builder.class); 559 } 560 561 // Construct using com.google.analytics.data.v1beta.CohortsRange.newBuilder() Builder()562 private Builder() {} 563 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)564 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 565 super(parent); 566 } 567 568 @java.lang.Override clear()569 public Builder clear() { 570 super.clear(); 571 bitField0_ = 0; 572 granularity_ = 0; 573 startOffset_ = 0; 574 endOffset_ = 0; 575 return this; 576 } 577 578 @java.lang.Override getDescriptorForType()579 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 580 return com.google.analytics.data.v1beta.ReportingApiProto 581 .internal_static_google_analytics_data_v1beta_CohortsRange_descriptor; 582 } 583 584 @java.lang.Override getDefaultInstanceForType()585 public com.google.analytics.data.v1beta.CohortsRange getDefaultInstanceForType() { 586 return com.google.analytics.data.v1beta.CohortsRange.getDefaultInstance(); 587 } 588 589 @java.lang.Override build()590 public com.google.analytics.data.v1beta.CohortsRange build() { 591 com.google.analytics.data.v1beta.CohortsRange result = buildPartial(); 592 if (!result.isInitialized()) { 593 throw newUninitializedMessageException(result); 594 } 595 return result; 596 } 597 598 @java.lang.Override buildPartial()599 public com.google.analytics.data.v1beta.CohortsRange buildPartial() { 600 com.google.analytics.data.v1beta.CohortsRange result = 601 new com.google.analytics.data.v1beta.CohortsRange(this); 602 if (bitField0_ != 0) { 603 buildPartial0(result); 604 } 605 onBuilt(); 606 return result; 607 } 608 buildPartial0(com.google.analytics.data.v1beta.CohortsRange result)609 private void buildPartial0(com.google.analytics.data.v1beta.CohortsRange result) { 610 int from_bitField0_ = bitField0_; 611 if (((from_bitField0_ & 0x00000001) != 0)) { 612 result.granularity_ = granularity_; 613 } 614 if (((from_bitField0_ & 0x00000002) != 0)) { 615 result.startOffset_ = startOffset_; 616 } 617 if (((from_bitField0_ & 0x00000004) != 0)) { 618 result.endOffset_ = endOffset_; 619 } 620 } 621 622 @java.lang.Override clone()623 public Builder clone() { 624 return super.clone(); 625 } 626 627 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)628 public Builder setField( 629 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 630 return super.setField(field, value); 631 } 632 633 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)634 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 635 return super.clearField(field); 636 } 637 638 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)639 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 640 return super.clearOneof(oneof); 641 } 642 643 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)644 public Builder setRepeatedField( 645 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 646 return super.setRepeatedField(field, index, value); 647 } 648 649 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)650 public Builder addRepeatedField( 651 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 652 return super.addRepeatedField(field, value); 653 } 654 655 @java.lang.Override mergeFrom(com.google.protobuf.Message other)656 public Builder mergeFrom(com.google.protobuf.Message other) { 657 if (other instanceof com.google.analytics.data.v1beta.CohortsRange) { 658 return mergeFrom((com.google.analytics.data.v1beta.CohortsRange) other); 659 } else { 660 super.mergeFrom(other); 661 return this; 662 } 663 } 664 mergeFrom(com.google.analytics.data.v1beta.CohortsRange other)665 public Builder mergeFrom(com.google.analytics.data.v1beta.CohortsRange other) { 666 if (other == com.google.analytics.data.v1beta.CohortsRange.getDefaultInstance()) return this; 667 if (other.granularity_ != 0) { 668 setGranularityValue(other.getGranularityValue()); 669 } 670 if (other.getStartOffset() != 0) { 671 setStartOffset(other.getStartOffset()); 672 } 673 if (other.getEndOffset() != 0) { 674 setEndOffset(other.getEndOffset()); 675 } 676 this.mergeUnknownFields(other.getUnknownFields()); 677 onChanged(); 678 return this; 679 } 680 681 @java.lang.Override isInitialized()682 public final boolean isInitialized() { 683 return true; 684 } 685 686 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)687 public Builder mergeFrom( 688 com.google.protobuf.CodedInputStream input, 689 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 690 throws java.io.IOException { 691 if (extensionRegistry == null) { 692 throw new java.lang.NullPointerException(); 693 } 694 try { 695 boolean done = false; 696 while (!done) { 697 int tag = input.readTag(); 698 switch (tag) { 699 case 0: 700 done = true; 701 break; 702 case 8: 703 { 704 granularity_ = input.readEnum(); 705 bitField0_ |= 0x00000001; 706 break; 707 } // case 8 708 case 16: 709 { 710 startOffset_ = input.readInt32(); 711 bitField0_ |= 0x00000002; 712 break; 713 } // case 16 714 case 24: 715 { 716 endOffset_ = input.readInt32(); 717 bitField0_ |= 0x00000004; 718 break; 719 } // case 24 720 default: 721 { 722 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 723 done = true; // was an endgroup tag 724 } 725 break; 726 } // default: 727 } // switch (tag) 728 } // while (!done) 729 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 730 throw e.unwrapIOException(); 731 } finally { 732 onChanged(); 733 } // finally 734 return this; 735 } 736 737 private int bitField0_; 738 739 private int granularity_ = 0; 740 /** 741 * 742 * 743 * <pre> 744 * Required. The granularity used to interpret the `startOffset` and 745 * `endOffset` for the extended reporting date range for a cohort report. 746 * </pre> 747 * 748 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 749 * 750 * @return The enum numeric value on the wire for granularity. 751 */ 752 @java.lang.Override getGranularityValue()753 public int getGranularityValue() { 754 return granularity_; 755 } 756 /** 757 * 758 * 759 * <pre> 760 * Required. The granularity used to interpret the `startOffset` and 761 * `endOffset` for the extended reporting date range for a cohort report. 762 * </pre> 763 * 764 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 765 * 766 * @param value The enum numeric value on the wire for granularity to set. 767 * @return This builder for chaining. 768 */ setGranularityValue(int value)769 public Builder setGranularityValue(int value) { 770 granularity_ = value; 771 bitField0_ |= 0x00000001; 772 onChanged(); 773 return this; 774 } 775 /** 776 * 777 * 778 * <pre> 779 * Required. The granularity used to interpret the `startOffset` and 780 * `endOffset` for the extended reporting date range for a cohort report. 781 * </pre> 782 * 783 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 784 * 785 * @return The granularity. 786 */ 787 @java.lang.Override getGranularity()788 public com.google.analytics.data.v1beta.CohortsRange.Granularity getGranularity() { 789 com.google.analytics.data.v1beta.CohortsRange.Granularity result = 790 com.google.analytics.data.v1beta.CohortsRange.Granularity.forNumber(granularity_); 791 return result == null 792 ? com.google.analytics.data.v1beta.CohortsRange.Granularity.UNRECOGNIZED 793 : result; 794 } 795 /** 796 * 797 * 798 * <pre> 799 * Required. The granularity used to interpret the `startOffset` and 800 * `endOffset` for the extended reporting date range for a cohort report. 801 * </pre> 802 * 803 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 804 * 805 * @param value The granularity to set. 806 * @return This builder for chaining. 807 */ setGranularity(com.google.analytics.data.v1beta.CohortsRange.Granularity value)808 public Builder setGranularity(com.google.analytics.data.v1beta.CohortsRange.Granularity value) { 809 if (value == null) { 810 throw new NullPointerException(); 811 } 812 bitField0_ |= 0x00000001; 813 granularity_ = value.getNumber(); 814 onChanged(); 815 return this; 816 } 817 /** 818 * 819 * 820 * <pre> 821 * Required. The granularity used to interpret the `startOffset` and 822 * `endOffset` for the extended reporting date range for a cohort report. 823 * </pre> 824 * 825 * <code>.google.analytics.data.v1beta.CohortsRange.Granularity granularity = 1;</code> 826 * 827 * @return This builder for chaining. 828 */ clearGranularity()829 public Builder clearGranularity() { 830 bitField0_ = (bitField0_ & ~0x00000001); 831 granularity_ = 0; 832 onChanged(); 833 return this; 834 } 835 836 private int startOffset_; 837 /** 838 * 839 * 840 * <pre> 841 * `startOffset` specifies the start date of the extended reporting date range 842 * for a cohort report. `startOffset` is commonly set to 0 so that reports 843 * contain data from the acquisition of the cohort forward. 844 * If `granularity` is `DAILY`, the `startDate` of the extended reporting date 845 * range is `startDate` of the cohort plus `startOffset` days. 846 * If `granularity` is `WEEKLY`, the `startDate` of the extended reporting 847 * date range is `startDate` of the cohort plus `startOffset * 7` days. 848 * If `granularity` is `MONTHLY`, the `startDate` of the extended reporting 849 * date range is `startDate` of the cohort plus `startOffset * 30` days. 850 * </pre> 851 * 852 * <code>int32 start_offset = 2;</code> 853 * 854 * @return The startOffset. 855 */ 856 @java.lang.Override getStartOffset()857 public int getStartOffset() { 858 return startOffset_; 859 } 860 /** 861 * 862 * 863 * <pre> 864 * `startOffset` specifies the start date of the extended reporting date range 865 * for a cohort report. `startOffset` is commonly set to 0 so that reports 866 * contain data from the acquisition of the cohort forward. 867 * If `granularity` is `DAILY`, the `startDate` of the extended reporting date 868 * range is `startDate` of the cohort plus `startOffset` days. 869 * If `granularity` is `WEEKLY`, the `startDate` of the extended reporting 870 * date range is `startDate` of the cohort plus `startOffset * 7` days. 871 * If `granularity` is `MONTHLY`, the `startDate` of the extended reporting 872 * date range is `startDate` of the cohort plus `startOffset * 30` days. 873 * </pre> 874 * 875 * <code>int32 start_offset = 2;</code> 876 * 877 * @param value The startOffset to set. 878 * @return This builder for chaining. 879 */ setStartOffset(int value)880 public Builder setStartOffset(int value) { 881 882 startOffset_ = value; 883 bitField0_ |= 0x00000002; 884 onChanged(); 885 return this; 886 } 887 /** 888 * 889 * 890 * <pre> 891 * `startOffset` specifies the start date of the extended reporting date range 892 * for a cohort report. `startOffset` is commonly set to 0 so that reports 893 * contain data from the acquisition of the cohort forward. 894 * If `granularity` is `DAILY`, the `startDate` of the extended reporting date 895 * range is `startDate` of the cohort plus `startOffset` days. 896 * If `granularity` is `WEEKLY`, the `startDate` of the extended reporting 897 * date range is `startDate` of the cohort plus `startOffset * 7` days. 898 * If `granularity` is `MONTHLY`, the `startDate` of the extended reporting 899 * date range is `startDate` of the cohort plus `startOffset * 30` days. 900 * </pre> 901 * 902 * <code>int32 start_offset = 2;</code> 903 * 904 * @return This builder for chaining. 905 */ clearStartOffset()906 public Builder clearStartOffset() { 907 bitField0_ = (bitField0_ & ~0x00000002); 908 startOffset_ = 0; 909 onChanged(); 910 return this; 911 } 912 913 private int endOffset_; 914 /** 915 * 916 * 917 * <pre> 918 * Required. `endOffset` specifies the end date of the extended reporting date 919 * range for a cohort report. `endOffset` can be any positive integer but is 920 * commonly set to 5 to 10 so that reports contain data on the cohort for the 921 * next several granularity time periods. 922 * If `granularity` is `DAILY`, the `endDate` of the extended reporting date 923 * range is `endDate` of the cohort plus `endOffset` days. 924 * If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date 925 * range is `endDate` of the cohort plus `endOffset * 7` days. 926 * If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date 927 * range is `endDate` of the cohort plus `endOffset * 30` days. 928 * </pre> 929 * 930 * <code>int32 end_offset = 3;</code> 931 * 932 * @return The endOffset. 933 */ 934 @java.lang.Override getEndOffset()935 public int getEndOffset() { 936 return endOffset_; 937 } 938 /** 939 * 940 * 941 * <pre> 942 * Required. `endOffset` specifies the end date of the extended reporting date 943 * range for a cohort report. `endOffset` can be any positive integer but is 944 * commonly set to 5 to 10 so that reports contain data on the cohort for the 945 * next several granularity time periods. 946 * If `granularity` is `DAILY`, the `endDate` of the extended reporting date 947 * range is `endDate` of the cohort plus `endOffset` days. 948 * If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date 949 * range is `endDate` of the cohort plus `endOffset * 7` days. 950 * If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date 951 * range is `endDate` of the cohort plus `endOffset * 30` days. 952 * </pre> 953 * 954 * <code>int32 end_offset = 3;</code> 955 * 956 * @param value The endOffset to set. 957 * @return This builder for chaining. 958 */ setEndOffset(int value)959 public Builder setEndOffset(int value) { 960 961 endOffset_ = value; 962 bitField0_ |= 0x00000004; 963 onChanged(); 964 return this; 965 } 966 /** 967 * 968 * 969 * <pre> 970 * Required. `endOffset` specifies the end date of the extended reporting date 971 * range for a cohort report. `endOffset` can be any positive integer but is 972 * commonly set to 5 to 10 so that reports contain data on the cohort for the 973 * next several granularity time periods. 974 * If `granularity` is `DAILY`, the `endDate` of the extended reporting date 975 * range is `endDate` of the cohort plus `endOffset` days. 976 * If `granularity` is `WEEKLY`, the `endDate` of the extended reporting date 977 * range is `endDate` of the cohort plus `endOffset * 7` days. 978 * If `granularity` is `MONTHLY`, the `endDate` of the extended reporting date 979 * range is `endDate` of the cohort plus `endOffset * 30` days. 980 * </pre> 981 * 982 * <code>int32 end_offset = 3;</code> 983 * 984 * @return This builder for chaining. 985 */ clearEndOffset()986 public Builder clearEndOffset() { 987 bitField0_ = (bitField0_ & ~0x00000004); 988 endOffset_ = 0; 989 onChanged(); 990 return this; 991 } 992 993 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)994 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 995 return super.setUnknownFields(unknownFields); 996 } 997 998 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)999 public final Builder mergeUnknownFields( 1000 final com.google.protobuf.UnknownFieldSet unknownFields) { 1001 return super.mergeUnknownFields(unknownFields); 1002 } 1003 1004 // @@protoc_insertion_point(builder_scope:google.analytics.data.v1beta.CohortsRange) 1005 } 1006 1007 // @@protoc_insertion_point(class_scope:google.analytics.data.v1beta.CohortsRange) 1008 private static final com.google.analytics.data.v1beta.CohortsRange DEFAULT_INSTANCE; 1009 1010 static { 1011 DEFAULT_INSTANCE = new com.google.analytics.data.v1beta.CohortsRange(); 1012 } 1013 getDefaultInstance()1014 public static com.google.analytics.data.v1beta.CohortsRange getDefaultInstance() { 1015 return DEFAULT_INSTANCE; 1016 } 1017 1018 private static final com.google.protobuf.Parser<CohortsRange> PARSER = 1019 new com.google.protobuf.AbstractParser<CohortsRange>() { 1020 @java.lang.Override 1021 public CohortsRange parsePartialFrom( 1022 com.google.protobuf.CodedInputStream input, 1023 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1024 throws com.google.protobuf.InvalidProtocolBufferException { 1025 Builder builder = newBuilder(); 1026 try { 1027 builder.mergeFrom(input, extensionRegistry); 1028 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1029 throw e.setUnfinishedMessage(builder.buildPartial()); 1030 } catch (com.google.protobuf.UninitializedMessageException e) { 1031 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1032 } catch (java.io.IOException e) { 1033 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1034 .setUnfinishedMessage(builder.buildPartial()); 1035 } 1036 return builder.buildPartial(); 1037 } 1038 }; 1039 parser()1040 public static com.google.protobuf.Parser<CohortsRange> parser() { 1041 return PARSER; 1042 } 1043 1044 @java.lang.Override getParserForType()1045 public com.google.protobuf.Parser<CohortsRange> getParserForType() { 1046 return PARSER; 1047 } 1048 1049 @java.lang.Override getDefaultInstanceForType()1050 public com.google.analytics.data.v1beta.CohortsRange getDefaultInstanceForType() { 1051 return DEFAULT_INSTANCE; 1052 } 1053 } 1054