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/appengine/v1/firewall.proto 18 19 package com.google.appengine.v1.firewall; 20 21 /** 22 * 23 * 24 * <pre> 25 * A single firewall rule that is evaluated against incoming traffic 26 * and provides an action to take on matched requests. 27 * </pre> 28 * 29 * Protobuf type {@code google.appengine.v1.FirewallRule} 30 */ 31 public final class FirewallRule extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.appengine.v1.FirewallRule) 34 FirewallRuleOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use FirewallRule.newBuilder() to construct. FirewallRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private FirewallRule(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 FirewallRule()41 private FirewallRule() { 42 action_ = 0; 43 sourceRange_ = ""; 44 description_ = ""; 45 } 46 47 @java.lang.Override 48 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)49 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 50 return new FirewallRule(); 51 } 52 53 @java.lang.Override getUnknownFields()54 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 55 return this.unknownFields; 56 } 57 getDescriptor()58 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 59 return com.google.appengine.v1.firewall.FirewallProto 60 .internal_static_google_appengine_v1_FirewallRule_descriptor; 61 } 62 63 @java.lang.Override 64 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()65 internalGetFieldAccessorTable() { 66 return com.google.appengine.v1.firewall.FirewallProto 67 .internal_static_google_appengine_v1_FirewallRule_fieldAccessorTable 68 .ensureFieldAccessorsInitialized( 69 com.google.appengine.v1.firewall.FirewallRule.class, 70 com.google.appengine.v1.firewall.FirewallRule.Builder.class); 71 } 72 73 /** 74 * 75 * 76 * <pre> 77 * Available actions to take on matching requests. 78 * </pre> 79 * 80 * Protobuf enum {@code google.appengine.v1.FirewallRule.Action} 81 */ 82 public enum Action implements com.google.protobuf.ProtocolMessageEnum { 83 /** <code>UNSPECIFIED_ACTION = 0;</code> */ 84 UNSPECIFIED_ACTION(0), 85 /** 86 * 87 * 88 * <pre> 89 * Matching requests are allowed. 90 * </pre> 91 * 92 * <code>ALLOW = 1;</code> 93 */ 94 ALLOW(1), 95 /** 96 * 97 * 98 * <pre> 99 * Matching requests are denied. 100 * </pre> 101 * 102 * <code>DENY = 2;</code> 103 */ 104 DENY(2), 105 UNRECOGNIZED(-1), 106 ; 107 108 /** <code>UNSPECIFIED_ACTION = 0;</code> */ 109 public static final int UNSPECIFIED_ACTION_VALUE = 0; 110 /** 111 * 112 * 113 * <pre> 114 * Matching requests are allowed. 115 * </pre> 116 * 117 * <code>ALLOW = 1;</code> 118 */ 119 public static final int ALLOW_VALUE = 1; 120 /** 121 * 122 * 123 * <pre> 124 * Matching requests are denied. 125 * </pre> 126 * 127 * <code>DENY = 2;</code> 128 */ 129 public static final int DENY_VALUE = 2; 130 getNumber()131 public final int getNumber() { 132 if (this == UNRECOGNIZED) { 133 throw new java.lang.IllegalArgumentException( 134 "Can't get the number of an unknown enum value."); 135 } 136 return value; 137 } 138 139 /** 140 * @param value The numeric wire value of the corresponding enum entry. 141 * @return The enum associated with the given numeric wire value. 142 * @deprecated Use {@link #forNumber(int)} instead. 143 */ 144 @java.lang.Deprecated valueOf(int value)145 public static Action valueOf(int value) { 146 return forNumber(value); 147 } 148 149 /** 150 * @param value The numeric wire value of the corresponding enum entry. 151 * @return The enum associated with the given numeric wire value. 152 */ forNumber(int value)153 public static Action forNumber(int value) { 154 switch (value) { 155 case 0: 156 return UNSPECIFIED_ACTION; 157 case 1: 158 return ALLOW; 159 case 2: 160 return DENY; 161 default: 162 return null; 163 } 164 } 165 internalGetValueMap()166 public static com.google.protobuf.Internal.EnumLiteMap<Action> internalGetValueMap() { 167 return internalValueMap; 168 } 169 170 private static final com.google.protobuf.Internal.EnumLiteMap<Action> internalValueMap = 171 new com.google.protobuf.Internal.EnumLiteMap<Action>() { 172 public Action findValueByNumber(int number) { 173 return Action.forNumber(number); 174 } 175 }; 176 getValueDescriptor()177 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 178 if (this == UNRECOGNIZED) { 179 throw new java.lang.IllegalStateException( 180 "Can't get the descriptor of an unrecognized enum value."); 181 } 182 return getDescriptor().getValues().get(ordinal()); 183 } 184 getDescriptorForType()185 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 186 return getDescriptor(); 187 } 188 getDescriptor()189 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 190 return com.google.appengine.v1.firewall.FirewallRule.getDescriptor().getEnumTypes().get(0); 191 } 192 193 private static final Action[] VALUES = values(); 194 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)195 public static Action valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 196 if (desc.getType() != getDescriptor()) { 197 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 198 } 199 if (desc.getIndex() == -1) { 200 return UNRECOGNIZED; 201 } 202 return VALUES[desc.getIndex()]; 203 } 204 205 private final int value; 206 Action(int value)207 private Action(int value) { 208 this.value = value; 209 } 210 211 // @@protoc_insertion_point(enum_scope:google.appengine.v1.FirewallRule.Action) 212 } 213 214 public static final int PRIORITY_FIELD_NUMBER = 1; 215 private int priority_ = 0; 216 /** 217 * 218 * 219 * <pre> 220 * A positive integer between [1, Int32.MaxValue-1] that defines the order of 221 * rule evaluation. Rules with the lowest priority are evaluated first. 222 * A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic 223 * when no previous rule matches. Only the action of this rule can be modified 224 * by the user. 225 * </pre> 226 * 227 * <code>int32 priority = 1;</code> 228 * 229 * @return The priority. 230 */ 231 @java.lang.Override getPriority()232 public int getPriority() { 233 return priority_; 234 } 235 236 public static final int ACTION_FIELD_NUMBER = 2; 237 private int action_ = 0; 238 /** 239 * 240 * 241 * <pre> 242 * The action to take on matched requests. 243 * </pre> 244 * 245 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 246 * 247 * @return The enum numeric value on the wire for action. 248 */ 249 @java.lang.Override getActionValue()250 public int getActionValue() { 251 return action_; 252 } 253 /** 254 * 255 * 256 * <pre> 257 * The action to take on matched requests. 258 * </pre> 259 * 260 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 261 * 262 * @return The action. 263 */ 264 @java.lang.Override getAction()265 public com.google.appengine.v1.firewall.FirewallRule.Action getAction() { 266 com.google.appengine.v1.firewall.FirewallRule.Action result = 267 com.google.appengine.v1.firewall.FirewallRule.Action.forNumber(action_); 268 return result == null 269 ? com.google.appengine.v1.firewall.FirewallRule.Action.UNRECOGNIZED 270 : result; 271 } 272 273 public static final int SOURCE_RANGE_FIELD_NUMBER = 3; 274 275 @SuppressWarnings("serial") 276 private volatile java.lang.Object sourceRange_ = ""; 277 /** 278 * 279 * 280 * <pre> 281 * IP address or range, defined using CIDR notation, of requests that this 282 * rule applies to. You can use the wildcard character "*" to match all IPs 283 * equivalent to "0/0" and "::/0" together. 284 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 285 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 286 * <p>Truncation will be silently performed on addresses which are not 287 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 288 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 289 * as the same address as `2001:db8::/32`. 290 * </pre> 291 * 292 * <code>string source_range = 3;</code> 293 * 294 * @return The sourceRange. 295 */ 296 @java.lang.Override getSourceRange()297 public java.lang.String getSourceRange() { 298 java.lang.Object ref = sourceRange_; 299 if (ref instanceof java.lang.String) { 300 return (java.lang.String) ref; 301 } else { 302 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 303 java.lang.String s = bs.toStringUtf8(); 304 sourceRange_ = s; 305 return s; 306 } 307 } 308 /** 309 * 310 * 311 * <pre> 312 * IP address or range, defined using CIDR notation, of requests that this 313 * rule applies to. You can use the wildcard character "*" to match all IPs 314 * equivalent to "0/0" and "::/0" together. 315 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 316 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 317 * <p>Truncation will be silently performed on addresses which are not 318 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 319 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 320 * as the same address as `2001:db8::/32`. 321 * </pre> 322 * 323 * <code>string source_range = 3;</code> 324 * 325 * @return The bytes for sourceRange. 326 */ 327 @java.lang.Override getSourceRangeBytes()328 public com.google.protobuf.ByteString getSourceRangeBytes() { 329 java.lang.Object ref = sourceRange_; 330 if (ref instanceof java.lang.String) { 331 com.google.protobuf.ByteString b = 332 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 333 sourceRange_ = b; 334 return b; 335 } else { 336 return (com.google.protobuf.ByteString) ref; 337 } 338 } 339 340 public static final int DESCRIPTION_FIELD_NUMBER = 4; 341 342 @SuppressWarnings("serial") 343 private volatile java.lang.Object description_ = ""; 344 /** 345 * 346 * 347 * <pre> 348 * An optional string description of this rule. 349 * This field has a maximum length of 100 characters. 350 * </pre> 351 * 352 * <code>string description = 4;</code> 353 * 354 * @return The description. 355 */ 356 @java.lang.Override getDescription()357 public java.lang.String getDescription() { 358 java.lang.Object ref = description_; 359 if (ref instanceof java.lang.String) { 360 return (java.lang.String) ref; 361 } else { 362 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 363 java.lang.String s = bs.toStringUtf8(); 364 description_ = s; 365 return s; 366 } 367 } 368 /** 369 * 370 * 371 * <pre> 372 * An optional string description of this rule. 373 * This field has a maximum length of 100 characters. 374 * </pre> 375 * 376 * <code>string description = 4;</code> 377 * 378 * @return The bytes for description. 379 */ 380 @java.lang.Override getDescriptionBytes()381 public com.google.protobuf.ByteString getDescriptionBytes() { 382 java.lang.Object ref = description_; 383 if (ref instanceof java.lang.String) { 384 com.google.protobuf.ByteString b = 385 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 386 description_ = b; 387 return b; 388 } else { 389 return (com.google.protobuf.ByteString) ref; 390 } 391 } 392 393 private byte memoizedIsInitialized = -1; 394 395 @java.lang.Override isInitialized()396 public final boolean isInitialized() { 397 byte isInitialized = memoizedIsInitialized; 398 if (isInitialized == 1) return true; 399 if (isInitialized == 0) return false; 400 401 memoizedIsInitialized = 1; 402 return true; 403 } 404 405 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)406 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 407 if (priority_ != 0) { 408 output.writeInt32(1, priority_); 409 } 410 if (action_ 411 != com.google.appengine.v1.firewall.FirewallRule.Action.UNSPECIFIED_ACTION.getNumber()) { 412 output.writeEnum(2, action_); 413 } 414 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceRange_)) { 415 com.google.protobuf.GeneratedMessageV3.writeString(output, 3, sourceRange_); 416 } 417 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 418 com.google.protobuf.GeneratedMessageV3.writeString(output, 4, description_); 419 } 420 getUnknownFields().writeTo(output); 421 } 422 423 @java.lang.Override getSerializedSize()424 public int getSerializedSize() { 425 int size = memoizedSize; 426 if (size != -1) return size; 427 428 size = 0; 429 if (priority_ != 0) { 430 size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, priority_); 431 } 432 if (action_ 433 != com.google.appengine.v1.firewall.FirewallRule.Action.UNSPECIFIED_ACTION.getNumber()) { 434 size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, action_); 435 } 436 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(sourceRange_)) { 437 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, sourceRange_); 438 } 439 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(description_)) { 440 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, description_); 441 } 442 size += getUnknownFields().getSerializedSize(); 443 memoizedSize = size; 444 return size; 445 } 446 447 @java.lang.Override equals(final java.lang.Object obj)448 public boolean equals(final java.lang.Object obj) { 449 if (obj == this) { 450 return true; 451 } 452 if (!(obj instanceof com.google.appengine.v1.firewall.FirewallRule)) { 453 return super.equals(obj); 454 } 455 com.google.appengine.v1.firewall.FirewallRule other = 456 (com.google.appengine.v1.firewall.FirewallRule) obj; 457 458 if (getPriority() != other.getPriority()) return false; 459 if (action_ != other.action_) return false; 460 if (!getSourceRange().equals(other.getSourceRange())) return false; 461 if (!getDescription().equals(other.getDescription())) return false; 462 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 463 return true; 464 } 465 466 @java.lang.Override hashCode()467 public int hashCode() { 468 if (memoizedHashCode != 0) { 469 return memoizedHashCode; 470 } 471 int hash = 41; 472 hash = (19 * hash) + getDescriptor().hashCode(); 473 hash = (37 * hash) + PRIORITY_FIELD_NUMBER; 474 hash = (53 * hash) + getPriority(); 475 hash = (37 * hash) + ACTION_FIELD_NUMBER; 476 hash = (53 * hash) + action_; 477 hash = (37 * hash) + SOURCE_RANGE_FIELD_NUMBER; 478 hash = (53 * hash) + getSourceRange().hashCode(); 479 hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; 480 hash = (53 * hash) + getDescription().hashCode(); 481 hash = (29 * hash) + getUnknownFields().hashCode(); 482 memoizedHashCode = hash; 483 return hash; 484 } 485 parseFrom(java.nio.ByteBuffer data)486 public static com.google.appengine.v1.firewall.FirewallRule parseFrom(java.nio.ByteBuffer data) 487 throws com.google.protobuf.InvalidProtocolBufferException { 488 return PARSER.parseFrom(data); 489 } 490 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)491 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 492 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 493 throws com.google.protobuf.InvalidProtocolBufferException { 494 return PARSER.parseFrom(data, extensionRegistry); 495 } 496 parseFrom( com.google.protobuf.ByteString data)497 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 498 com.google.protobuf.ByteString data) 499 throws com.google.protobuf.InvalidProtocolBufferException { 500 return PARSER.parseFrom(data); 501 } 502 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)503 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 504 com.google.protobuf.ByteString data, 505 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 506 throws com.google.protobuf.InvalidProtocolBufferException { 507 return PARSER.parseFrom(data, extensionRegistry); 508 } 509 parseFrom(byte[] data)510 public static com.google.appengine.v1.firewall.FirewallRule parseFrom(byte[] data) 511 throws com.google.protobuf.InvalidProtocolBufferException { 512 return PARSER.parseFrom(data); 513 } 514 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)515 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 516 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 517 throws com.google.protobuf.InvalidProtocolBufferException { 518 return PARSER.parseFrom(data, extensionRegistry); 519 } 520 parseFrom(java.io.InputStream input)521 public static com.google.appengine.v1.firewall.FirewallRule parseFrom(java.io.InputStream input) 522 throws java.io.IOException { 523 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 524 } 525 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)526 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 527 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 528 throws java.io.IOException { 529 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 530 PARSER, input, extensionRegistry); 531 } 532 parseDelimitedFrom( java.io.InputStream input)533 public static com.google.appengine.v1.firewall.FirewallRule parseDelimitedFrom( 534 java.io.InputStream input) throws java.io.IOException { 535 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 536 } 537 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)538 public static com.google.appengine.v1.firewall.FirewallRule parseDelimitedFrom( 539 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 540 throws java.io.IOException { 541 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 542 PARSER, input, extensionRegistry); 543 } 544 parseFrom( com.google.protobuf.CodedInputStream input)545 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 546 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 547 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 548 } 549 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)550 public static com.google.appengine.v1.firewall.FirewallRule parseFrom( 551 com.google.protobuf.CodedInputStream input, 552 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 553 throws java.io.IOException { 554 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 555 PARSER, input, extensionRegistry); 556 } 557 558 @java.lang.Override newBuilderForType()559 public Builder newBuilderForType() { 560 return newBuilder(); 561 } 562 newBuilder()563 public static Builder newBuilder() { 564 return DEFAULT_INSTANCE.toBuilder(); 565 } 566 newBuilder(com.google.appengine.v1.firewall.FirewallRule prototype)567 public static Builder newBuilder(com.google.appengine.v1.firewall.FirewallRule prototype) { 568 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 569 } 570 571 @java.lang.Override toBuilder()572 public Builder toBuilder() { 573 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 574 } 575 576 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)577 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 578 Builder builder = new Builder(parent); 579 return builder; 580 } 581 /** 582 * 583 * 584 * <pre> 585 * A single firewall rule that is evaluated against incoming traffic 586 * and provides an action to take on matched requests. 587 * </pre> 588 * 589 * Protobuf type {@code google.appengine.v1.FirewallRule} 590 */ 591 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 592 implements 593 // @@protoc_insertion_point(builder_implements:google.appengine.v1.FirewallRule) 594 com.google.appengine.v1.firewall.FirewallRuleOrBuilder { getDescriptor()595 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 596 return com.google.appengine.v1.firewall.FirewallProto 597 .internal_static_google_appengine_v1_FirewallRule_descriptor; 598 } 599 600 @java.lang.Override 601 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()602 internalGetFieldAccessorTable() { 603 return com.google.appengine.v1.firewall.FirewallProto 604 .internal_static_google_appengine_v1_FirewallRule_fieldAccessorTable 605 .ensureFieldAccessorsInitialized( 606 com.google.appengine.v1.firewall.FirewallRule.class, 607 com.google.appengine.v1.firewall.FirewallRule.Builder.class); 608 } 609 610 // Construct using com.google.appengine.v1.firewall.FirewallRule.newBuilder() Builder()611 private Builder() {} 612 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)613 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 614 super(parent); 615 } 616 617 @java.lang.Override clear()618 public Builder clear() { 619 super.clear(); 620 bitField0_ = 0; 621 priority_ = 0; 622 action_ = 0; 623 sourceRange_ = ""; 624 description_ = ""; 625 return this; 626 } 627 628 @java.lang.Override getDescriptorForType()629 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 630 return com.google.appengine.v1.firewall.FirewallProto 631 .internal_static_google_appengine_v1_FirewallRule_descriptor; 632 } 633 634 @java.lang.Override getDefaultInstanceForType()635 public com.google.appengine.v1.firewall.FirewallRule getDefaultInstanceForType() { 636 return com.google.appengine.v1.firewall.FirewallRule.getDefaultInstance(); 637 } 638 639 @java.lang.Override build()640 public com.google.appengine.v1.firewall.FirewallRule build() { 641 com.google.appengine.v1.firewall.FirewallRule result = buildPartial(); 642 if (!result.isInitialized()) { 643 throw newUninitializedMessageException(result); 644 } 645 return result; 646 } 647 648 @java.lang.Override buildPartial()649 public com.google.appengine.v1.firewall.FirewallRule buildPartial() { 650 com.google.appengine.v1.firewall.FirewallRule result = 651 new com.google.appengine.v1.firewall.FirewallRule(this); 652 if (bitField0_ != 0) { 653 buildPartial0(result); 654 } 655 onBuilt(); 656 return result; 657 } 658 buildPartial0(com.google.appengine.v1.firewall.FirewallRule result)659 private void buildPartial0(com.google.appengine.v1.firewall.FirewallRule result) { 660 int from_bitField0_ = bitField0_; 661 if (((from_bitField0_ & 0x00000001) != 0)) { 662 result.priority_ = priority_; 663 } 664 if (((from_bitField0_ & 0x00000002) != 0)) { 665 result.action_ = action_; 666 } 667 if (((from_bitField0_ & 0x00000004) != 0)) { 668 result.sourceRange_ = sourceRange_; 669 } 670 if (((from_bitField0_ & 0x00000008) != 0)) { 671 result.description_ = description_; 672 } 673 } 674 675 @java.lang.Override clone()676 public Builder clone() { 677 return super.clone(); 678 } 679 680 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)681 public Builder setField( 682 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 683 return super.setField(field, value); 684 } 685 686 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)687 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 688 return super.clearField(field); 689 } 690 691 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)692 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 693 return super.clearOneof(oneof); 694 } 695 696 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)697 public Builder setRepeatedField( 698 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 699 return super.setRepeatedField(field, index, value); 700 } 701 702 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)703 public Builder addRepeatedField( 704 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 705 return super.addRepeatedField(field, value); 706 } 707 708 @java.lang.Override mergeFrom(com.google.protobuf.Message other)709 public Builder mergeFrom(com.google.protobuf.Message other) { 710 if (other instanceof com.google.appengine.v1.firewall.FirewallRule) { 711 return mergeFrom((com.google.appengine.v1.firewall.FirewallRule) other); 712 } else { 713 super.mergeFrom(other); 714 return this; 715 } 716 } 717 mergeFrom(com.google.appengine.v1.firewall.FirewallRule other)718 public Builder mergeFrom(com.google.appengine.v1.firewall.FirewallRule other) { 719 if (other == com.google.appengine.v1.firewall.FirewallRule.getDefaultInstance()) return this; 720 if (other.getPriority() != 0) { 721 setPriority(other.getPriority()); 722 } 723 if (other.action_ != 0) { 724 setActionValue(other.getActionValue()); 725 } 726 if (!other.getSourceRange().isEmpty()) { 727 sourceRange_ = other.sourceRange_; 728 bitField0_ |= 0x00000004; 729 onChanged(); 730 } 731 if (!other.getDescription().isEmpty()) { 732 description_ = other.description_; 733 bitField0_ |= 0x00000008; 734 onChanged(); 735 } 736 this.mergeUnknownFields(other.getUnknownFields()); 737 onChanged(); 738 return this; 739 } 740 741 @java.lang.Override isInitialized()742 public final boolean isInitialized() { 743 return true; 744 } 745 746 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)747 public Builder mergeFrom( 748 com.google.protobuf.CodedInputStream input, 749 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 750 throws java.io.IOException { 751 if (extensionRegistry == null) { 752 throw new java.lang.NullPointerException(); 753 } 754 try { 755 boolean done = false; 756 while (!done) { 757 int tag = input.readTag(); 758 switch (tag) { 759 case 0: 760 done = true; 761 break; 762 case 8: 763 { 764 priority_ = input.readInt32(); 765 bitField0_ |= 0x00000001; 766 break; 767 } // case 8 768 case 16: 769 { 770 action_ = input.readEnum(); 771 bitField0_ |= 0x00000002; 772 break; 773 } // case 16 774 case 26: 775 { 776 sourceRange_ = input.readStringRequireUtf8(); 777 bitField0_ |= 0x00000004; 778 break; 779 } // case 26 780 case 34: 781 { 782 description_ = input.readStringRequireUtf8(); 783 bitField0_ |= 0x00000008; 784 break; 785 } // case 34 786 default: 787 { 788 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 789 done = true; // was an endgroup tag 790 } 791 break; 792 } // default: 793 } // switch (tag) 794 } // while (!done) 795 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 796 throw e.unwrapIOException(); 797 } finally { 798 onChanged(); 799 } // finally 800 return this; 801 } 802 803 private int bitField0_; 804 805 private int priority_; 806 /** 807 * 808 * 809 * <pre> 810 * A positive integer between [1, Int32.MaxValue-1] that defines the order of 811 * rule evaluation. Rules with the lowest priority are evaluated first. 812 * A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic 813 * when no previous rule matches. Only the action of this rule can be modified 814 * by the user. 815 * </pre> 816 * 817 * <code>int32 priority = 1;</code> 818 * 819 * @return The priority. 820 */ 821 @java.lang.Override getPriority()822 public int getPriority() { 823 return priority_; 824 } 825 /** 826 * 827 * 828 * <pre> 829 * A positive integer between [1, Int32.MaxValue-1] that defines the order of 830 * rule evaluation. Rules with the lowest priority are evaluated first. 831 * A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic 832 * when no previous rule matches. Only the action of this rule can be modified 833 * by the user. 834 * </pre> 835 * 836 * <code>int32 priority = 1;</code> 837 * 838 * @param value The priority to set. 839 * @return This builder for chaining. 840 */ setPriority(int value)841 public Builder setPriority(int value) { 842 843 priority_ = value; 844 bitField0_ |= 0x00000001; 845 onChanged(); 846 return this; 847 } 848 /** 849 * 850 * 851 * <pre> 852 * A positive integer between [1, Int32.MaxValue-1] that defines the order of 853 * rule evaluation. Rules with the lowest priority are evaluated first. 854 * A default rule at priority Int32.MaxValue matches all IPv4 and IPv6 traffic 855 * when no previous rule matches. Only the action of this rule can be modified 856 * by the user. 857 * </pre> 858 * 859 * <code>int32 priority = 1;</code> 860 * 861 * @return This builder for chaining. 862 */ clearPriority()863 public Builder clearPriority() { 864 bitField0_ = (bitField0_ & ~0x00000001); 865 priority_ = 0; 866 onChanged(); 867 return this; 868 } 869 870 private int action_ = 0; 871 /** 872 * 873 * 874 * <pre> 875 * The action to take on matched requests. 876 * </pre> 877 * 878 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 879 * 880 * @return The enum numeric value on the wire for action. 881 */ 882 @java.lang.Override getActionValue()883 public int getActionValue() { 884 return action_; 885 } 886 /** 887 * 888 * 889 * <pre> 890 * The action to take on matched requests. 891 * </pre> 892 * 893 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 894 * 895 * @param value The enum numeric value on the wire for action to set. 896 * @return This builder for chaining. 897 */ setActionValue(int value)898 public Builder setActionValue(int value) { 899 action_ = value; 900 bitField0_ |= 0x00000002; 901 onChanged(); 902 return this; 903 } 904 /** 905 * 906 * 907 * <pre> 908 * The action to take on matched requests. 909 * </pre> 910 * 911 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 912 * 913 * @return The action. 914 */ 915 @java.lang.Override getAction()916 public com.google.appengine.v1.firewall.FirewallRule.Action getAction() { 917 com.google.appengine.v1.firewall.FirewallRule.Action result = 918 com.google.appengine.v1.firewall.FirewallRule.Action.forNumber(action_); 919 return result == null 920 ? com.google.appengine.v1.firewall.FirewallRule.Action.UNRECOGNIZED 921 : result; 922 } 923 /** 924 * 925 * 926 * <pre> 927 * The action to take on matched requests. 928 * </pre> 929 * 930 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 931 * 932 * @param value The action to set. 933 * @return This builder for chaining. 934 */ setAction(com.google.appengine.v1.firewall.FirewallRule.Action value)935 public Builder setAction(com.google.appengine.v1.firewall.FirewallRule.Action value) { 936 if (value == null) { 937 throw new NullPointerException(); 938 } 939 bitField0_ |= 0x00000002; 940 action_ = value.getNumber(); 941 onChanged(); 942 return this; 943 } 944 /** 945 * 946 * 947 * <pre> 948 * The action to take on matched requests. 949 * </pre> 950 * 951 * <code>.google.appengine.v1.FirewallRule.Action action = 2;</code> 952 * 953 * @return This builder for chaining. 954 */ clearAction()955 public Builder clearAction() { 956 bitField0_ = (bitField0_ & ~0x00000002); 957 action_ = 0; 958 onChanged(); 959 return this; 960 } 961 962 private java.lang.Object sourceRange_ = ""; 963 /** 964 * 965 * 966 * <pre> 967 * IP address or range, defined using CIDR notation, of requests that this 968 * rule applies to. You can use the wildcard character "*" to match all IPs 969 * equivalent to "0/0" and "::/0" together. 970 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 971 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 972 * <p>Truncation will be silently performed on addresses which are not 973 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 974 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 975 * as the same address as `2001:db8::/32`. 976 * </pre> 977 * 978 * <code>string source_range = 3;</code> 979 * 980 * @return The sourceRange. 981 */ getSourceRange()982 public java.lang.String getSourceRange() { 983 java.lang.Object ref = sourceRange_; 984 if (!(ref instanceof java.lang.String)) { 985 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 986 java.lang.String s = bs.toStringUtf8(); 987 sourceRange_ = s; 988 return s; 989 } else { 990 return (java.lang.String) ref; 991 } 992 } 993 /** 994 * 995 * 996 * <pre> 997 * IP address or range, defined using CIDR notation, of requests that this 998 * rule applies to. You can use the wildcard character "*" to match all IPs 999 * equivalent to "0/0" and "::/0" together. 1000 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 1001 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 1002 * <p>Truncation will be silently performed on addresses which are not 1003 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 1004 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 1005 * as the same address as `2001:db8::/32`. 1006 * </pre> 1007 * 1008 * <code>string source_range = 3;</code> 1009 * 1010 * @return The bytes for sourceRange. 1011 */ getSourceRangeBytes()1012 public com.google.protobuf.ByteString getSourceRangeBytes() { 1013 java.lang.Object ref = sourceRange_; 1014 if (ref instanceof String) { 1015 com.google.protobuf.ByteString b = 1016 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1017 sourceRange_ = b; 1018 return b; 1019 } else { 1020 return (com.google.protobuf.ByteString) ref; 1021 } 1022 } 1023 /** 1024 * 1025 * 1026 * <pre> 1027 * IP address or range, defined using CIDR notation, of requests that this 1028 * rule applies to. You can use the wildcard character "*" to match all IPs 1029 * equivalent to "0/0" and "::/0" together. 1030 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 1031 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 1032 * <p>Truncation will be silently performed on addresses which are not 1033 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 1034 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 1035 * as the same address as `2001:db8::/32`. 1036 * </pre> 1037 * 1038 * <code>string source_range = 3;</code> 1039 * 1040 * @param value The sourceRange to set. 1041 * @return This builder for chaining. 1042 */ setSourceRange(java.lang.String value)1043 public Builder setSourceRange(java.lang.String value) { 1044 if (value == null) { 1045 throw new NullPointerException(); 1046 } 1047 sourceRange_ = value; 1048 bitField0_ |= 0x00000004; 1049 onChanged(); 1050 return this; 1051 } 1052 /** 1053 * 1054 * 1055 * <pre> 1056 * IP address or range, defined using CIDR notation, of requests that this 1057 * rule applies to. You can use the wildcard character "*" to match all IPs 1058 * equivalent to "0/0" and "::/0" together. 1059 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 1060 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 1061 * <p>Truncation will be silently performed on addresses which are not 1062 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 1063 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 1064 * as the same address as `2001:db8::/32`. 1065 * </pre> 1066 * 1067 * <code>string source_range = 3;</code> 1068 * 1069 * @return This builder for chaining. 1070 */ clearSourceRange()1071 public Builder clearSourceRange() { 1072 sourceRange_ = getDefaultInstance().getSourceRange(); 1073 bitField0_ = (bitField0_ & ~0x00000004); 1074 onChanged(); 1075 return this; 1076 } 1077 /** 1078 * 1079 * 1080 * <pre> 1081 * IP address or range, defined using CIDR notation, of requests that this 1082 * rule applies to. You can use the wildcard character "*" to match all IPs 1083 * equivalent to "0/0" and "::/0" together. 1084 * Examples: `192.168.1.1` or `192.168.0.0/16` or `2001:db8::/32` 1085 * or `2001:0db8:0000:0042:0000:8a2e:0370:7334`. 1086 * <p>Truncation will be silently performed on addresses which are not 1087 * properly truncated. For example, `1.2.3.4/24` is accepted as the same 1088 * address as `1.2.3.0/24`. Similarly, for IPv6, `2001:db8::1/32` is accepted 1089 * as the same address as `2001:db8::/32`. 1090 * </pre> 1091 * 1092 * <code>string source_range = 3;</code> 1093 * 1094 * @param value The bytes for sourceRange to set. 1095 * @return This builder for chaining. 1096 */ setSourceRangeBytes(com.google.protobuf.ByteString value)1097 public Builder setSourceRangeBytes(com.google.protobuf.ByteString value) { 1098 if (value == null) { 1099 throw new NullPointerException(); 1100 } 1101 checkByteStringIsUtf8(value); 1102 sourceRange_ = value; 1103 bitField0_ |= 0x00000004; 1104 onChanged(); 1105 return this; 1106 } 1107 1108 private java.lang.Object description_ = ""; 1109 /** 1110 * 1111 * 1112 * <pre> 1113 * An optional string description of this rule. 1114 * This field has a maximum length of 100 characters. 1115 * </pre> 1116 * 1117 * <code>string description = 4;</code> 1118 * 1119 * @return The description. 1120 */ getDescription()1121 public java.lang.String getDescription() { 1122 java.lang.Object ref = description_; 1123 if (!(ref instanceof java.lang.String)) { 1124 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1125 java.lang.String s = bs.toStringUtf8(); 1126 description_ = s; 1127 return s; 1128 } else { 1129 return (java.lang.String) ref; 1130 } 1131 } 1132 /** 1133 * 1134 * 1135 * <pre> 1136 * An optional string description of this rule. 1137 * This field has a maximum length of 100 characters. 1138 * </pre> 1139 * 1140 * <code>string description = 4;</code> 1141 * 1142 * @return The bytes for description. 1143 */ getDescriptionBytes()1144 public com.google.protobuf.ByteString getDescriptionBytes() { 1145 java.lang.Object ref = description_; 1146 if (ref instanceof String) { 1147 com.google.protobuf.ByteString b = 1148 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1149 description_ = b; 1150 return b; 1151 } else { 1152 return (com.google.protobuf.ByteString) ref; 1153 } 1154 } 1155 /** 1156 * 1157 * 1158 * <pre> 1159 * An optional string description of this rule. 1160 * This field has a maximum length of 100 characters. 1161 * </pre> 1162 * 1163 * <code>string description = 4;</code> 1164 * 1165 * @param value The description to set. 1166 * @return This builder for chaining. 1167 */ setDescription(java.lang.String value)1168 public Builder setDescription(java.lang.String value) { 1169 if (value == null) { 1170 throw new NullPointerException(); 1171 } 1172 description_ = value; 1173 bitField0_ |= 0x00000008; 1174 onChanged(); 1175 return this; 1176 } 1177 /** 1178 * 1179 * 1180 * <pre> 1181 * An optional string description of this rule. 1182 * This field has a maximum length of 100 characters. 1183 * </pre> 1184 * 1185 * <code>string description = 4;</code> 1186 * 1187 * @return This builder for chaining. 1188 */ clearDescription()1189 public Builder clearDescription() { 1190 description_ = getDefaultInstance().getDescription(); 1191 bitField0_ = (bitField0_ & ~0x00000008); 1192 onChanged(); 1193 return this; 1194 } 1195 /** 1196 * 1197 * 1198 * <pre> 1199 * An optional string description of this rule. 1200 * This field has a maximum length of 100 characters. 1201 * </pre> 1202 * 1203 * <code>string description = 4;</code> 1204 * 1205 * @param value The bytes for description to set. 1206 * @return This builder for chaining. 1207 */ setDescriptionBytes(com.google.protobuf.ByteString value)1208 public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { 1209 if (value == null) { 1210 throw new NullPointerException(); 1211 } 1212 checkByteStringIsUtf8(value); 1213 description_ = value; 1214 bitField0_ |= 0x00000008; 1215 onChanged(); 1216 return this; 1217 } 1218 1219 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1220 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1221 return super.setUnknownFields(unknownFields); 1222 } 1223 1224 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1225 public final Builder mergeUnknownFields( 1226 final com.google.protobuf.UnknownFieldSet unknownFields) { 1227 return super.mergeUnknownFields(unknownFields); 1228 } 1229 1230 // @@protoc_insertion_point(builder_scope:google.appengine.v1.FirewallRule) 1231 } 1232 1233 // @@protoc_insertion_point(class_scope:google.appengine.v1.FirewallRule) 1234 private static final com.google.appengine.v1.firewall.FirewallRule DEFAULT_INSTANCE; 1235 1236 static { 1237 DEFAULT_INSTANCE = new com.google.appengine.v1.firewall.FirewallRule(); 1238 } 1239 getDefaultInstance()1240 public static com.google.appengine.v1.firewall.FirewallRule getDefaultInstance() { 1241 return DEFAULT_INSTANCE; 1242 } 1243 1244 private static final com.google.protobuf.Parser<FirewallRule> PARSER = 1245 new com.google.protobuf.AbstractParser<FirewallRule>() { 1246 @java.lang.Override 1247 public FirewallRule parsePartialFrom( 1248 com.google.protobuf.CodedInputStream input, 1249 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1250 throws com.google.protobuf.InvalidProtocolBufferException { 1251 Builder builder = newBuilder(); 1252 try { 1253 builder.mergeFrom(input, extensionRegistry); 1254 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1255 throw e.setUnfinishedMessage(builder.buildPartial()); 1256 } catch (com.google.protobuf.UninitializedMessageException e) { 1257 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1258 } catch (java.io.IOException e) { 1259 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1260 .setUnfinishedMessage(builder.buildPartial()); 1261 } 1262 return builder.buildPartial(); 1263 } 1264 }; 1265 parser()1266 public static com.google.protobuf.Parser<FirewallRule> parser() { 1267 return PARSER; 1268 } 1269 1270 @java.lang.Override getParserForType()1271 public com.google.protobuf.Parser<FirewallRule> getParserForType() { 1272 return PARSER; 1273 } 1274 1275 @java.lang.Override getDefaultInstanceForType()1276 public com.google.appengine.v1.firewall.FirewallRule getDefaultInstanceForType() { 1277 return DEFAULT_INSTANCE; 1278 } 1279 } 1280