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/cloud/asset/v1/asset_service.proto 18 19 package com.google.cloud.asset.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Specifications of BigQuery partitioned table as export destination. 26 * </pre> 27 * 28 * Protobuf type {@code google.cloud.asset.v1.PartitionSpec} 29 */ 30 public final class PartitionSpec extends com.google.protobuf.GeneratedMessageV3 31 implements 32 // @@protoc_insertion_point(message_implements:google.cloud.asset.v1.PartitionSpec) 33 PartitionSpecOrBuilder { 34 private static final long serialVersionUID = 0L; 35 // Use PartitionSpec.newBuilder() to construct. PartitionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)36 private PartitionSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 37 super(builder); 38 } 39 PartitionSpec()40 private PartitionSpec() { 41 partitionKey_ = 0; 42 } 43 44 @java.lang.Override 45 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)46 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 47 return new PartitionSpec(); 48 } 49 50 @java.lang.Override getUnknownFields()51 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 52 return this.unknownFields; 53 } 54 getDescriptor()55 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 56 return com.google.cloud.asset.v1.AssetServiceProto 57 .internal_static_google_cloud_asset_v1_PartitionSpec_descriptor; 58 } 59 60 @java.lang.Override 61 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()62 internalGetFieldAccessorTable() { 63 return com.google.cloud.asset.v1.AssetServiceProto 64 .internal_static_google_cloud_asset_v1_PartitionSpec_fieldAccessorTable 65 .ensureFieldAccessorsInitialized( 66 com.google.cloud.asset.v1.PartitionSpec.class, 67 com.google.cloud.asset.v1.PartitionSpec.Builder.class); 68 } 69 70 /** 71 * 72 * 73 * <pre> 74 * This enum is used to determine the partition key column when exporting 75 * assets to BigQuery partitioned table(s). Note that, if the partition key is 76 * a timestamp column, the actual partition is based on its date value 77 * (expressed in UTC. see details in 78 * https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables). 79 * </pre> 80 * 81 * Protobuf enum {@code google.cloud.asset.v1.PartitionSpec.PartitionKey} 82 */ 83 public enum PartitionKey implements com.google.protobuf.ProtocolMessageEnum { 84 /** 85 * 86 * 87 * <pre> 88 * Unspecified partition key. If used, it means using non-partitioned table. 89 * </pre> 90 * 91 * <code>PARTITION_KEY_UNSPECIFIED = 0;</code> 92 */ 93 PARTITION_KEY_UNSPECIFIED(0), 94 /** 95 * 96 * 97 * <pre> 98 * The time when the snapshot is taken. If specified as partition key, the 99 * result table(s) is partitoned by the additional timestamp column, 100 * readTime. If [read_time] in ExportAssetsRequest is specified, the 101 * readTime column's value will be the same as it. Otherwise, its value will 102 * be the current time that is used to take the snapshot. 103 * </pre> 104 * 105 * <code>READ_TIME = 1;</code> 106 */ 107 READ_TIME(1), 108 /** 109 * 110 * 111 * <pre> 112 * The time when the request is received and started to be processed. If 113 * specified as partition key, the result table(s) is partitoned by the 114 * requestTime column, an additional timestamp column representing when the 115 * request was received. 116 * </pre> 117 * 118 * <code>REQUEST_TIME = 2;</code> 119 */ 120 REQUEST_TIME(2), 121 UNRECOGNIZED(-1), 122 ; 123 124 /** 125 * 126 * 127 * <pre> 128 * Unspecified partition key. If used, it means using non-partitioned table. 129 * </pre> 130 * 131 * <code>PARTITION_KEY_UNSPECIFIED = 0;</code> 132 */ 133 public static final int PARTITION_KEY_UNSPECIFIED_VALUE = 0; 134 /** 135 * 136 * 137 * <pre> 138 * The time when the snapshot is taken. If specified as partition key, the 139 * result table(s) is partitoned by the additional timestamp column, 140 * readTime. If [read_time] in ExportAssetsRequest is specified, the 141 * readTime column's value will be the same as it. Otherwise, its value will 142 * be the current time that is used to take the snapshot. 143 * </pre> 144 * 145 * <code>READ_TIME = 1;</code> 146 */ 147 public static final int READ_TIME_VALUE = 1; 148 /** 149 * 150 * 151 * <pre> 152 * The time when the request is received and started to be processed. If 153 * specified as partition key, the result table(s) is partitoned by the 154 * requestTime column, an additional timestamp column representing when the 155 * request was received. 156 * </pre> 157 * 158 * <code>REQUEST_TIME = 2;</code> 159 */ 160 public static final int REQUEST_TIME_VALUE = 2; 161 getNumber()162 public final int getNumber() { 163 if (this == UNRECOGNIZED) { 164 throw new java.lang.IllegalArgumentException( 165 "Can't get the number of an unknown enum value."); 166 } 167 return value; 168 } 169 170 /** 171 * @param value The numeric wire value of the corresponding enum entry. 172 * @return The enum associated with the given numeric wire value. 173 * @deprecated Use {@link #forNumber(int)} instead. 174 */ 175 @java.lang.Deprecated valueOf(int value)176 public static PartitionKey valueOf(int value) { 177 return forNumber(value); 178 } 179 180 /** 181 * @param value The numeric wire value of the corresponding enum entry. 182 * @return The enum associated with the given numeric wire value. 183 */ forNumber(int value)184 public static PartitionKey forNumber(int value) { 185 switch (value) { 186 case 0: 187 return PARTITION_KEY_UNSPECIFIED; 188 case 1: 189 return READ_TIME; 190 case 2: 191 return REQUEST_TIME; 192 default: 193 return null; 194 } 195 } 196 internalGetValueMap()197 public static com.google.protobuf.Internal.EnumLiteMap<PartitionKey> internalGetValueMap() { 198 return internalValueMap; 199 } 200 201 private static final com.google.protobuf.Internal.EnumLiteMap<PartitionKey> internalValueMap = 202 new com.google.protobuf.Internal.EnumLiteMap<PartitionKey>() { 203 public PartitionKey findValueByNumber(int number) { 204 return PartitionKey.forNumber(number); 205 } 206 }; 207 getValueDescriptor()208 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 209 if (this == UNRECOGNIZED) { 210 throw new java.lang.IllegalStateException( 211 "Can't get the descriptor of an unrecognized enum value."); 212 } 213 return getDescriptor().getValues().get(ordinal()); 214 } 215 getDescriptorForType()216 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 217 return getDescriptor(); 218 } 219 getDescriptor()220 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 221 return com.google.cloud.asset.v1.PartitionSpec.getDescriptor().getEnumTypes().get(0); 222 } 223 224 private static final PartitionKey[] VALUES = values(); 225 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)226 public static PartitionKey valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 227 if (desc.getType() != getDescriptor()) { 228 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 229 } 230 if (desc.getIndex() == -1) { 231 return UNRECOGNIZED; 232 } 233 return VALUES[desc.getIndex()]; 234 } 235 236 private final int value; 237 PartitionKey(int value)238 private PartitionKey(int value) { 239 this.value = value; 240 } 241 242 // @@protoc_insertion_point(enum_scope:google.cloud.asset.v1.PartitionSpec.PartitionKey) 243 } 244 245 public static final int PARTITION_KEY_FIELD_NUMBER = 1; 246 private int partitionKey_ = 0; 247 /** 248 * 249 * 250 * <pre> 251 * The partition key for BigQuery partitioned table. 252 * </pre> 253 * 254 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 255 * 256 * @return The enum numeric value on the wire for partitionKey. 257 */ 258 @java.lang.Override getPartitionKeyValue()259 public int getPartitionKeyValue() { 260 return partitionKey_; 261 } 262 /** 263 * 264 * 265 * <pre> 266 * The partition key for BigQuery partitioned table. 267 * </pre> 268 * 269 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 270 * 271 * @return The partitionKey. 272 */ 273 @java.lang.Override getPartitionKey()274 public com.google.cloud.asset.v1.PartitionSpec.PartitionKey getPartitionKey() { 275 com.google.cloud.asset.v1.PartitionSpec.PartitionKey result = 276 com.google.cloud.asset.v1.PartitionSpec.PartitionKey.forNumber(partitionKey_); 277 return result == null 278 ? com.google.cloud.asset.v1.PartitionSpec.PartitionKey.UNRECOGNIZED 279 : result; 280 } 281 282 private byte memoizedIsInitialized = -1; 283 284 @java.lang.Override isInitialized()285 public final boolean isInitialized() { 286 byte isInitialized = memoizedIsInitialized; 287 if (isInitialized == 1) return true; 288 if (isInitialized == 0) return false; 289 290 memoizedIsInitialized = 1; 291 return true; 292 } 293 294 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)295 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 296 if (partitionKey_ 297 != com.google.cloud.asset.v1.PartitionSpec.PartitionKey.PARTITION_KEY_UNSPECIFIED 298 .getNumber()) { 299 output.writeEnum(1, partitionKey_); 300 } 301 getUnknownFields().writeTo(output); 302 } 303 304 @java.lang.Override getSerializedSize()305 public int getSerializedSize() { 306 int size = memoizedSize; 307 if (size != -1) return size; 308 309 size = 0; 310 if (partitionKey_ 311 != com.google.cloud.asset.v1.PartitionSpec.PartitionKey.PARTITION_KEY_UNSPECIFIED 312 .getNumber()) { 313 size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, partitionKey_); 314 } 315 size += getUnknownFields().getSerializedSize(); 316 memoizedSize = size; 317 return size; 318 } 319 320 @java.lang.Override equals(final java.lang.Object obj)321 public boolean equals(final java.lang.Object obj) { 322 if (obj == this) { 323 return true; 324 } 325 if (!(obj instanceof com.google.cloud.asset.v1.PartitionSpec)) { 326 return super.equals(obj); 327 } 328 com.google.cloud.asset.v1.PartitionSpec other = (com.google.cloud.asset.v1.PartitionSpec) obj; 329 330 if (partitionKey_ != other.partitionKey_) return false; 331 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 332 return true; 333 } 334 335 @java.lang.Override hashCode()336 public int hashCode() { 337 if (memoizedHashCode != 0) { 338 return memoizedHashCode; 339 } 340 int hash = 41; 341 hash = (19 * hash) + getDescriptor().hashCode(); 342 hash = (37 * hash) + PARTITION_KEY_FIELD_NUMBER; 343 hash = (53 * hash) + partitionKey_; 344 hash = (29 * hash) + getUnknownFields().hashCode(); 345 memoizedHashCode = hash; 346 return hash; 347 } 348 parseFrom(java.nio.ByteBuffer data)349 public static com.google.cloud.asset.v1.PartitionSpec parseFrom(java.nio.ByteBuffer data) 350 throws com.google.protobuf.InvalidProtocolBufferException { 351 return PARSER.parseFrom(data); 352 } 353 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)354 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 355 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 356 throws com.google.protobuf.InvalidProtocolBufferException { 357 return PARSER.parseFrom(data, extensionRegistry); 358 } 359 parseFrom( com.google.protobuf.ByteString data)360 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 361 com.google.protobuf.ByteString data) 362 throws com.google.protobuf.InvalidProtocolBufferException { 363 return PARSER.parseFrom(data); 364 } 365 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)366 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 367 com.google.protobuf.ByteString data, 368 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 369 throws com.google.protobuf.InvalidProtocolBufferException { 370 return PARSER.parseFrom(data, extensionRegistry); 371 } 372 parseFrom(byte[] data)373 public static com.google.cloud.asset.v1.PartitionSpec parseFrom(byte[] data) 374 throws com.google.protobuf.InvalidProtocolBufferException { 375 return PARSER.parseFrom(data); 376 } 377 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)378 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 379 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 380 throws com.google.protobuf.InvalidProtocolBufferException { 381 return PARSER.parseFrom(data, extensionRegistry); 382 } 383 parseFrom(java.io.InputStream input)384 public static com.google.cloud.asset.v1.PartitionSpec parseFrom(java.io.InputStream input) 385 throws java.io.IOException { 386 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 387 } 388 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)389 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 390 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 391 throws java.io.IOException { 392 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 393 PARSER, input, extensionRegistry); 394 } 395 parseDelimitedFrom( java.io.InputStream input)396 public static com.google.cloud.asset.v1.PartitionSpec parseDelimitedFrom( 397 java.io.InputStream input) throws java.io.IOException { 398 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 399 } 400 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)401 public static com.google.cloud.asset.v1.PartitionSpec parseDelimitedFrom( 402 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 403 throws java.io.IOException { 404 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 405 PARSER, input, extensionRegistry); 406 } 407 parseFrom( com.google.protobuf.CodedInputStream input)408 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 409 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 410 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 411 } 412 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)413 public static com.google.cloud.asset.v1.PartitionSpec parseFrom( 414 com.google.protobuf.CodedInputStream input, 415 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 416 throws java.io.IOException { 417 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 418 PARSER, input, extensionRegistry); 419 } 420 421 @java.lang.Override newBuilderForType()422 public Builder newBuilderForType() { 423 return newBuilder(); 424 } 425 newBuilder()426 public static Builder newBuilder() { 427 return DEFAULT_INSTANCE.toBuilder(); 428 } 429 newBuilder(com.google.cloud.asset.v1.PartitionSpec prototype)430 public static Builder newBuilder(com.google.cloud.asset.v1.PartitionSpec prototype) { 431 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 432 } 433 434 @java.lang.Override toBuilder()435 public Builder toBuilder() { 436 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 437 } 438 439 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)440 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 441 Builder builder = new Builder(parent); 442 return builder; 443 } 444 /** 445 * 446 * 447 * <pre> 448 * Specifications of BigQuery partitioned table as export destination. 449 * </pre> 450 * 451 * Protobuf type {@code google.cloud.asset.v1.PartitionSpec} 452 */ 453 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 454 implements 455 // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1.PartitionSpec) 456 com.google.cloud.asset.v1.PartitionSpecOrBuilder { getDescriptor()457 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 458 return com.google.cloud.asset.v1.AssetServiceProto 459 .internal_static_google_cloud_asset_v1_PartitionSpec_descriptor; 460 } 461 462 @java.lang.Override 463 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()464 internalGetFieldAccessorTable() { 465 return com.google.cloud.asset.v1.AssetServiceProto 466 .internal_static_google_cloud_asset_v1_PartitionSpec_fieldAccessorTable 467 .ensureFieldAccessorsInitialized( 468 com.google.cloud.asset.v1.PartitionSpec.class, 469 com.google.cloud.asset.v1.PartitionSpec.Builder.class); 470 } 471 472 // Construct using com.google.cloud.asset.v1.PartitionSpec.newBuilder() Builder()473 private Builder() {} 474 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)475 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 476 super(parent); 477 } 478 479 @java.lang.Override clear()480 public Builder clear() { 481 super.clear(); 482 bitField0_ = 0; 483 partitionKey_ = 0; 484 return this; 485 } 486 487 @java.lang.Override getDescriptorForType()488 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 489 return com.google.cloud.asset.v1.AssetServiceProto 490 .internal_static_google_cloud_asset_v1_PartitionSpec_descriptor; 491 } 492 493 @java.lang.Override getDefaultInstanceForType()494 public com.google.cloud.asset.v1.PartitionSpec getDefaultInstanceForType() { 495 return com.google.cloud.asset.v1.PartitionSpec.getDefaultInstance(); 496 } 497 498 @java.lang.Override build()499 public com.google.cloud.asset.v1.PartitionSpec build() { 500 com.google.cloud.asset.v1.PartitionSpec result = buildPartial(); 501 if (!result.isInitialized()) { 502 throw newUninitializedMessageException(result); 503 } 504 return result; 505 } 506 507 @java.lang.Override buildPartial()508 public com.google.cloud.asset.v1.PartitionSpec buildPartial() { 509 com.google.cloud.asset.v1.PartitionSpec result = 510 new com.google.cloud.asset.v1.PartitionSpec(this); 511 if (bitField0_ != 0) { 512 buildPartial0(result); 513 } 514 onBuilt(); 515 return result; 516 } 517 buildPartial0(com.google.cloud.asset.v1.PartitionSpec result)518 private void buildPartial0(com.google.cloud.asset.v1.PartitionSpec result) { 519 int from_bitField0_ = bitField0_; 520 if (((from_bitField0_ & 0x00000001) != 0)) { 521 result.partitionKey_ = partitionKey_; 522 } 523 } 524 525 @java.lang.Override clone()526 public Builder clone() { 527 return super.clone(); 528 } 529 530 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)531 public Builder setField( 532 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 533 return super.setField(field, value); 534 } 535 536 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)537 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 538 return super.clearField(field); 539 } 540 541 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)542 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 543 return super.clearOneof(oneof); 544 } 545 546 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)547 public Builder setRepeatedField( 548 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 549 return super.setRepeatedField(field, index, value); 550 } 551 552 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)553 public Builder addRepeatedField( 554 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 555 return super.addRepeatedField(field, value); 556 } 557 558 @java.lang.Override mergeFrom(com.google.protobuf.Message other)559 public Builder mergeFrom(com.google.protobuf.Message other) { 560 if (other instanceof com.google.cloud.asset.v1.PartitionSpec) { 561 return mergeFrom((com.google.cloud.asset.v1.PartitionSpec) other); 562 } else { 563 super.mergeFrom(other); 564 return this; 565 } 566 } 567 mergeFrom(com.google.cloud.asset.v1.PartitionSpec other)568 public Builder mergeFrom(com.google.cloud.asset.v1.PartitionSpec other) { 569 if (other == com.google.cloud.asset.v1.PartitionSpec.getDefaultInstance()) return this; 570 if (other.partitionKey_ != 0) { 571 setPartitionKeyValue(other.getPartitionKeyValue()); 572 } 573 this.mergeUnknownFields(other.getUnknownFields()); 574 onChanged(); 575 return this; 576 } 577 578 @java.lang.Override isInitialized()579 public final boolean isInitialized() { 580 return true; 581 } 582 583 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)584 public Builder mergeFrom( 585 com.google.protobuf.CodedInputStream input, 586 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 587 throws java.io.IOException { 588 if (extensionRegistry == null) { 589 throw new java.lang.NullPointerException(); 590 } 591 try { 592 boolean done = false; 593 while (!done) { 594 int tag = input.readTag(); 595 switch (tag) { 596 case 0: 597 done = true; 598 break; 599 case 8: 600 { 601 partitionKey_ = input.readEnum(); 602 bitField0_ |= 0x00000001; 603 break; 604 } // case 8 605 default: 606 { 607 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 608 done = true; // was an endgroup tag 609 } 610 break; 611 } // default: 612 } // switch (tag) 613 } // while (!done) 614 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 615 throw e.unwrapIOException(); 616 } finally { 617 onChanged(); 618 } // finally 619 return this; 620 } 621 622 private int bitField0_; 623 624 private int partitionKey_ = 0; 625 /** 626 * 627 * 628 * <pre> 629 * The partition key for BigQuery partitioned table. 630 * </pre> 631 * 632 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 633 * 634 * @return The enum numeric value on the wire for partitionKey. 635 */ 636 @java.lang.Override getPartitionKeyValue()637 public int getPartitionKeyValue() { 638 return partitionKey_; 639 } 640 /** 641 * 642 * 643 * <pre> 644 * The partition key for BigQuery partitioned table. 645 * </pre> 646 * 647 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 648 * 649 * @param value The enum numeric value on the wire for partitionKey to set. 650 * @return This builder for chaining. 651 */ setPartitionKeyValue(int value)652 public Builder setPartitionKeyValue(int value) { 653 partitionKey_ = value; 654 bitField0_ |= 0x00000001; 655 onChanged(); 656 return this; 657 } 658 /** 659 * 660 * 661 * <pre> 662 * The partition key for BigQuery partitioned table. 663 * </pre> 664 * 665 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 666 * 667 * @return The partitionKey. 668 */ 669 @java.lang.Override getPartitionKey()670 public com.google.cloud.asset.v1.PartitionSpec.PartitionKey getPartitionKey() { 671 com.google.cloud.asset.v1.PartitionSpec.PartitionKey result = 672 com.google.cloud.asset.v1.PartitionSpec.PartitionKey.forNumber(partitionKey_); 673 return result == null 674 ? com.google.cloud.asset.v1.PartitionSpec.PartitionKey.UNRECOGNIZED 675 : result; 676 } 677 /** 678 * 679 * 680 * <pre> 681 * The partition key for BigQuery partitioned table. 682 * </pre> 683 * 684 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 685 * 686 * @param value The partitionKey to set. 687 * @return This builder for chaining. 688 */ setPartitionKey(com.google.cloud.asset.v1.PartitionSpec.PartitionKey value)689 public Builder setPartitionKey(com.google.cloud.asset.v1.PartitionSpec.PartitionKey value) { 690 if (value == null) { 691 throw new NullPointerException(); 692 } 693 bitField0_ |= 0x00000001; 694 partitionKey_ = value.getNumber(); 695 onChanged(); 696 return this; 697 } 698 /** 699 * 700 * 701 * <pre> 702 * The partition key for BigQuery partitioned table. 703 * </pre> 704 * 705 * <code>.google.cloud.asset.v1.PartitionSpec.PartitionKey partition_key = 1;</code> 706 * 707 * @return This builder for chaining. 708 */ clearPartitionKey()709 public Builder clearPartitionKey() { 710 bitField0_ = (bitField0_ & ~0x00000001); 711 partitionKey_ = 0; 712 onChanged(); 713 return this; 714 } 715 716 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)717 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 718 return super.setUnknownFields(unknownFields); 719 } 720 721 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)722 public final Builder mergeUnknownFields( 723 final com.google.protobuf.UnknownFieldSet unknownFields) { 724 return super.mergeUnknownFields(unknownFields); 725 } 726 727 // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1.PartitionSpec) 728 } 729 730 // @@protoc_insertion_point(class_scope:google.cloud.asset.v1.PartitionSpec) 731 private static final com.google.cloud.asset.v1.PartitionSpec DEFAULT_INSTANCE; 732 733 static { 734 DEFAULT_INSTANCE = new com.google.cloud.asset.v1.PartitionSpec(); 735 } 736 getDefaultInstance()737 public static com.google.cloud.asset.v1.PartitionSpec getDefaultInstance() { 738 return DEFAULT_INSTANCE; 739 } 740 741 private static final com.google.protobuf.Parser<PartitionSpec> PARSER = 742 new com.google.protobuf.AbstractParser<PartitionSpec>() { 743 @java.lang.Override 744 public PartitionSpec parsePartialFrom( 745 com.google.protobuf.CodedInputStream input, 746 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 747 throws com.google.protobuf.InvalidProtocolBufferException { 748 Builder builder = newBuilder(); 749 try { 750 builder.mergeFrom(input, extensionRegistry); 751 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 752 throw e.setUnfinishedMessage(builder.buildPartial()); 753 } catch (com.google.protobuf.UninitializedMessageException e) { 754 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 755 } catch (java.io.IOException e) { 756 throw new com.google.protobuf.InvalidProtocolBufferException(e) 757 .setUnfinishedMessage(builder.buildPartial()); 758 } 759 return builder.buildPartial(); 760 } 761 }; 762 parser()763 public static com.google.protobuf.Parser<PartitionSpec> parser() { 764 return PARSER; 765 } 766 767 @java.lang.Override getParserForType()768 public com.google.protobuf.Parser<PartitionSpec> getParserForType() { 769 return PARSER; 770 } 771 772 @java.lang.Override getDefaultInstanceForType()773 public com.google.cloud.asset.v1.PartitionSpec getDefaultInstanceForType() { 774 return DEFAULT_INSTANCE; 775 } 776 } 777