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