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/apigateway/v1/apigateway.proto 18 19 package com.google.cloud.apigateway.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A Gateway is an API-aware HTTP proxy. It performs API-Method and/or 26 * API-Consumer specific actions based on an API Config such as authentication, 27 * policy enforcement, and backend selection. 28 * </pre> 29 * 30 * Protobuf type {@code google.cloud.apigateway.v1.Gateway} 31 */ 32 public final class Gateway extends com.google.protobuf.GeneratedMessageV3 33 implements 34 // @@protoc_insertion_point(message_implements:google.cloud.apigateway.v1.Gateway) 35 GatewayOrBuilder { 36 private static final long serialVersionUID = 0L; 37 // Use Gateway.newBuilder() to construct. Gateway(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)38 private Gateway(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 39 super(builder); 40 } 41 Gateway()42 private Gateway() { 43 name_ = ""; 44 displayName_ = ""; 45 apiConfig_ = ""; 46 state_ = 0; 47 defaultHostname_ = ""; 48 } 49 50 @java.lang.Override 51 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)52 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 53 return new Gateway(); 54 } 55 56 @java.lang.Override getUnknownFields()57 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 58 return this.unknownFields; 59 } 60 getDescriptor()61 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 62 return com.google.cloud.apigateway.v1.Apigateway 63 .internal_static_google_cloud_apigateway_v1_Gateway_descriptor; 64 } 65 66 @SuppressWarnings({"rawtypes"}) 67 @java.lang.Override internalGetMapField(int number)68 protected com.google.protobuf.MapField internalGetMapField(int number) { 69 switch (number) { 70 case 4: 71 return internalGetLabels(); 72 default: 73 throw new RuntimeException("Invalid map field number: " + number); 74 } 75 } 76 77 @java.lang.Override 78 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()79 internalGetFieldAccessorTable() { 80 return com.google.cloud.apigateway.v1.Apigateway 81 .internal_static_google_cloud_apigateway_v1_Gateway_fieldAccessorTable 82 .ensureFieldAccessorsInitialized( 83 com.google.cloud.apigateway.v1.Gateway.class, 84 com.google.cloud.apigateway.v1.Gateway.Builder.class); 85 } 86 87 /** 88 * 89 * 90 * <pre> 91 * All the possible Gateway states. 92 * </pre> 93 * 94 * Protobuf enum {@code google.cloud.apigateway.v1.Gateway.State} 95 */ 96 public enum State implements com.google.protobuf.ProtocolMessageEnum { 97 /** 98 * 99 * 100 * <pre> 101 * Gateway does not have a state yet. 102 * </pre> 103 * 104 * <code>STATE_UNSPECIFIED = 0;</code> 105 */ 106 STATE_UNSPECIFIED(0), 107 /** 108 * 109 * 110 * <pre> 111 * Gateway is being created. 112 * </pre> 113 * 114 * <code>CREATING = 1;</code> 115 */ 116 CREATING(1), 117 /** 118 * 119 * 120 * <pre> 121 * Gateway is running and ready for requests. 122 * </pre> 123 * 124 * <code>ACTIVE = 2;</code> 125 */ 126 ACTIVE(2), 127 /** 128 * 129 * 130 * <pre> 131 * Gateway creation failed. 132 * </pre> 133 * 134 * <code>FAILED = 3;</code> 135 */ 136 FAILED(3), 137 /** 138 * 139 * 140 * <pre> 141 * Gateway is being deleted. 142 * </pre> 143 * 144 * <code>DELETING = 4;</code> 145 */ 146 DELETING(4), 147 /** 148 * 149 * 150 * <pre> 151 * Gateway is being updated. 152 * </pre> 153 * 154 * <code>UPDATING = 5;</code> 155 */ 156 UPDATING(5), 157 UNRECOGNIZED(-1), 158 ; 159 160 /** 161 * 162 * 163 * <pre> 164 * Gateway does not have a state yet. 165 * </pre> 166 * 167 * <code>STATE_UNSPECIFIED = 0;</code> 168 */ 169 public static final int STATE_UNSPECIFIED_VALUE = 0; 170 /** 171 * 172 * 173 * <pre> 174 * Gateway is being created. 175 * </pre> 176 * 177 * <code>CREATING = 1;</code> 178 */ 179 public static final int CREATING_VALUE = 1; 180 /** 181 * 182 * 183 * <pre> 184 * Gateway is running and ready for requests. 185 * </pre> 186 * 187 * <code>ACTIVE = 2;</code> 188 */ 189 public static final int ACTIVE_VALUE = 2; 190 /** 191 * 192 * 193 * <pre> 194 * Gateway creation failed. 195 * </pre> 196 * 197 * <code>FAILED = 3;</code> 198 */ 199 public static final int FAILED_VALUE = 3; 200 /** 201 * 202 * 203 * <pre> 204 * Gateway is being deleted. 205 * </pre> 206 * 207 * <code>DELETING = 4;</code> 208 */ 209 public static final int DELETING_VALUE = 4; 210 /** 211 * 212 * 213 * <pre> 214 * Gateway is being updated. 215 * </pre> 216 * 217 * <code>UPDATING = 5;</code> 218 */ 219 public static final int UPDATING_VALUE = 5; 220 getNumber()221 public final int getNumber() { 222 if (this == UNRECOGNIZED) { 223 throw new java.lang.IllegalArgumentException( 224 "Can't get the number of an unknown enum value."); 225 } 226 return value; 227 } 228 229 /** 230 * @param value The numeric wire value of the corresponding enum entry. 231 * @return The enum associated with the given numeric wire value. 232 * @deprecated Use {@link #forNumber(int)} instead. 233 */ 234 @java.lang.Deprecated valueOf(int value)235 public static State valueOf(int value) { 236 return forNumber(value); 237 } 238 239 /** 240 * @param value The numeric wire value of the corresponding enum entry. 241 * @return The enum associated with the given numeric wire value. 242 */ forNumber(int value)243 public static State forNumber(int value) { 244 switch (value) { 245 case 0: 246 return STATE_UNSPECIFIED; 247 case 1: 248 return CREATING; 249 case 2: 250 return ACTIVE; 251 case 3: 252 return FAILED; 253 case 4: 254 return DELETING; 255 case 5: 256 return UPDATING; 257 default: 258 return null; 259 } 260 } 261 internalGetValueMap()262 public static com.google.protobuf.Internal.EnumLiteMap<State> internalGetValueMap() { 263 return internalValueMap; 264 } 265 266 private static final com.google.protobuf.Internal.EnumLiteMap<State> internalValueMap = 267 new com.google.protobuf.Internal.EnumLiteMap<State>() { 268 public State findValueByNumber(int number) { 269 return State.forNumber(number); 270 } 271 }; 272 getValueDescriptor()273 public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { 274 if (this == UNRECOGNIZED) { 275 throw new java.lang.IllegalStateException( 276 "Can't get the descriptor of an unrecognized enum value."); 277 } 278 return getDescriptor().getValues().get(ordinal()); 279 } 280 getDescriptorForType()281 public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { 282 return getDescriptor(); 283 } 284 getDescriptor()285 public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { 286 return com.google.cloud.apigateway.v1.Gateway.getDescriptor().getEnumTypes().get(0); 287 } 288 289 private static final State[] VALUES = values(); 290 valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc)291 public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { 292 if (desc.getType() != getDescriptor()) { 293 throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); 294 } 295 if (desc.getIndex() == -1) { 296 return UNRECOGNIZED; 297 } 298 return VALUES[desc.getIndex()]; 299 } 300 301 private final int value; 302 State(int value)303 private State(int value) { 304 this.value = value; 305 } 306 307 // @@protoc_insertion_point(enum_scope:google.cloud.apigateway.v1.Gateway.State) 308 } 309 310 public static final int NAME_FIELD_NUMBER = 1; 311 312 @SuppressWarnings("serial") 313 private volatile java.lang.Object name_ = ""; 314 /** 315 * 316 * 317 * <pre> 318 * Output only. Resource name of the Gateway. 319 * Format: projects/{project}/locations/{location}/gateways/{gateway} 320 * </pre> 321 * 322 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 323 * 324 * @return The name. 325 */ 326 @java.lang.Override getName()327 public java.lang.String getName() { 328 java.lang.Object ref = name_; 329 if (ref instanceof java.lang.String) { 330 return (java.lang.String) ref; 331 } else { 332 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 333 java.lang.String s = bs.toStringUtf8(); 334 name_ = s; 335 return s; 336 } 337 } 338 /** 339 * 340 * 341 * <pre> 342 * Output only. Resource name of the Gateway. 343 * Format: projects/{project}/locations/{location}/gateways/{gateway} 344 * </pre> 345 * 346 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 347 * 348 * @return The bytes for name. 349 */ 350 @java.lang.Override getNameBytes()351 public com.google.protobuf.ByteString getNameBytes() { 352 java.lang.Object ref = name_; 353 if (ref instanceof java.lang.String) { 354 com.google.protobuf.ByteString b = 355 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 356 name_ = b; 357 return b; 358 } else { 359 return (com.google.protobuf.ByteString) ref; 360 } 361 } 362 363 public static final int CREATE_TIME_FIELD_NUMBER = 2; 364 private com.google.protobuf.Timestamp createTime_; 365 /** 366 * 367 * 368 * <pre> 369 * Output only. Created time. 370 * </pre> 371 * 372 * <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 373 * </code> 374 * 375 * @return Whether the createTime field is set. 376 */ 377 @java.lang.Override hasCreateTime()378 public boolean hasCreateTime() { 379 return createTime_ != null; 380 } 381 /** 382 * 383 * 384 * <pre> 385 * Output only. Created time. 386 * </pre> 387 * 388 * <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 389 * </code> 390 * 391 * @return The createTime. 392 */ 393 @java.lang.Override getCreateTime()394 public com.google.protobuf.Timestamp getCreateTime() { 395 return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; 396 } 397 /** 398 * 399 * 400 * <pre> 401 * Output only. Created time. 402 * </pre> 403 * 404 * <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 405 * </code> 406 */ 407 @java.lang.Override getCreateTimeOrBuilder()408 public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 409 return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; 410 } 411 412 public static final int UPDATE_TIME_FIELD_NUMBER = 3; 413 private com.google.protobuf.Timestamp updateTime_; 414 /** 415 * 416 * 417 * <pre> 418 * Output only. Updated time. 419 * </pre> 420 * 421 * <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 422 * </code> 423 * 424 * @return Whether the updateTime field is set. 425 */ 426 @java.lang.Override hasUpdateTime()427 public boolean hasUpdateTime() { 428 return updateTime_ != null; 429 } 430 /** 431 * 432 * 433 * <pre> 434 * Output only. Updated time. 435 * </pre> 436 * 437 * <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 438 * </code> 439 * 440 * @return The updateTime. 441 */ 442 @java.lang.Override getUpdateTime()443 public com.google.protobuf.Timestamp getUpdateTime() { 444 return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; 445 } 446 /** 447 * 448 * 449 * <pre> 450 * Output only. Updated time. 451 * </pre> 452 * 453 * <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 454 * </code> 455 */ 456 @java.lang.Override getUpdateTimeOrBuilder()457 public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { 458 return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; 459 } 460 461 public static final int LABELS_FIELD_NUMBER = 4; 462 463 private static final class LabelsDefaultEntryHolder { 464 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 465 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 466 com.google.cloud.apigateway.v1.Apigateway 467 .internal_static_google_cloud_apigateway_v1_Gateway_LabelsEntry_descriptor, 468 com.google.protobuf.WireFormat.FieldType.STRING, 469 "", 470 com.google.protobuf.WireFormat.FieldType.STRING, 471 ""); 472 } 473 474 @SuppressWarnings("serial") 475 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 476 internalGetLabels()477 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 478 if (labels_ == null) { 479 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 480 } 481 return labels_; 482 } 483 getLabelsCount()484 public int getLabelsCount() { 485 return internalGetLabels().getMap().size(); 486 } 487 /** 488 * 489 * 490 * <pre> 491 * Optional. Resource labels to represent user-provided metadata. 492 * Refer to cloud documentation on labels for more details. 493 * https://cloud.google.com/compute/docs/labeling-resources 494 * </pre> 495 * 496 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 497 */ 498 @java.lang.Override containsLabels(java.lang.String key)499 public boolean containsLabels(java.lang.String key) { 500 if (key == null) { 501 throw new NullPointerException("map key"); 502 } 503 return internalGetLabels().getMap().containsKey(key); 504 } 505 /** Use {@link #getLabelsMap()} instead. */ 506 @java.lang.Override 507 @java.lang.Deprecated getLabels()508 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 509 return getLabelsMap(); 510 } 511 /** 512 * 513 * 514 * <pre> 515 * Optional. Resource labels to represent user-provided metadata. 516 * Refer to cloud documentation on labels for more details. 517 * https://cloud.google.com/compute/docs/labeling-resources 518 * </pre> 519 * 520 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 521 */ 522 @java.lang.Override getLabelsMap()523 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 524 return internalGetLabels().getMap(); 525 } 526 /** 527 * 528 * 529 * <pre> 530 * Optional. Resource labels to represent user-provided metadata. 531 * Refer to cloud documentation on labels for more details. 532 * https://cloud.google.com/compute/docs/labeling-resources 533 * </pre> 534 * 535 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 536 */ 537 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)538 public /* nullable */ java.lang.String getLabelsOrDefault( 539 java.lang.String key, 540 /* nullable */ 541 java.lang.String defaultValue) { 542 if (key == null) { 543 throw new NullPointerException("map key"); 544 } 545 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 546 return map.containsKey(key) ? map.get(key) : defaultValue; 547 } 548 /** 549 * 550 * 551 * <pre> 552 * Optional. Resource labels to represent user-provided metadata. 553 * Refer to cloud documentation on labels for more details. 554 * https://cloud.google.com/compute/docs/labeling-resources 555 * </pre> 556 * 557 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 558 */ 559 @java.lang.Override getLabelsOrThrow(java.lang.String key)560 public java.lang.String getLabelsOrThrow(java.lang.String key) { 561 if (key == null) { 562 throw new NullPointerException("map key"); 563 } 564 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 565 if (!map.containsKey(key)) { 566 throw new java.lang.IllegalArgumentException(); 567 } 568 return map.get(key); 569 } 570 571 public static final int DISPLAY_NAME_FIELD_NUMBER = 5; 572 573 @SuppressWarnings("serial") 574 private volatile java.lang.Object displayName_ = ""; 575 /** 576 * 577 * 578 * <pre> 579 * Optional. Display name. 580 * </pre> 581 * 582 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 583 * 584 * @return The displayName. 585 */ 586 @java.lang.Override getDisplayName()587 public java.lang.String getDisplayName() { 588 java.lang.Object ref = displayName_; 589 if (ref instanceof java.lang.String) { 590 return (java.lang.String) ref; 591 } else { 592 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 593 java.lang.String s = bs.toStringUtf8(); 594 displayName_ = s; 595 return s; 596 } 597 } 598 /** 599 * 600 * 601 * <pre> 602 * Optional. Display name. 603 * </pre> 604 * 605 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 606 * 607 * @return The bytes for displayName. 608 */ 609 @java.lang.Override getDisplayNameBytes()610 public com.google.protobuf.ByteString getDisplayNameBytes() { 611 java.lang.Object ref = displayName_; 612 if (ref instanceof java.lang.String) { 613 com.google.protobuf.ByteString b = 614 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 615 displayName_ = b; 616 return b; 617 } else { 618 return (com.google.protobuf.ByteString) ref; 619 } 620 } 621 622 public static final int API_CONFIG_FIELD_NUMBER = 6; 623 624 @SuppressWarnings("serial") 625 private volatile java.lang.Object apiConfig_ = ""; 626 /** 627 * 628 * 629 * <pre> 630 * Required. Resource name of the API Config for this Gateway. 631 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 632 * </pre> 633 * 634 * <code> 635 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 636 * </code> 637 * 638 * @return The apiConfig. 639 */ 640 @java.lang.Override getApiConfig()641 public java.lang.String getApiConfig() { 642 java.lang.Object ref = apiConfig_; 643 if (ref instanceof java.lang.String) { 644 return (java.lang.String) ref; 645 } else { 646 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 647 java.lang.String s = bs.toStringUtf8(); 648 apiConfig_ = s; 649 return s; 650 } 651 } 652 /** 653 * 654 * 655 * <pre> 656 * Required. Resource name of the API Config for this Gateway. 657 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 658 * </pre> 659 * 660 * <code> 661 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 662 * </code> 663 * 664 * @return The bytes for apiConfig. 665 */ 666 @java.lang.Override getApiConfigBytes()667 public com.google.protobuf.ByteString getApiConfigBytes() { 668 java.lang.Object ref = apiConfig_; 669 if (ref instanceof java.lang.String) { 670 com.google.protobuf.ByteString b = 671 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 672 apiConfig_ = b; 673 return b; 674 } else { 675 return (com.google.protobuf.ByteString) ref; 676 } 677 } 678 679 public static final int STATE_FIELD_NUMBER = 7; 680 private int state_ = 0; 681 /** 682 * 683 * 684 * <pre> 685 * Output only. The current state of the Gateway. 686 * </pre> 687 * 688 * <code> 689 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 690 * </code> 691 * 692 * @return The enum numeric value on the wire for state. 693 */ 694 @java.lang.Override getStateValue()695 public int getStateValue() { 696 return state_; 697 } 698 /** 699 * 700 * 701 * <pre> 702 * Output only. The current state of the Gateway. 703 * </pre> 704 * 705 * <code> 706 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 707 * </code> 708 * 709 * @return The state. 710 */ 711 @java.lang.Override getState()712 public com.google.cloud.apigateway.v1.Gateway.State getState() { 713 com.google.cloud.apigateway.v1.Gateway.State result = 714 com.google.cloud.apigateway.v1.Gateway.State.forNumber(state_); 715 return result == null ? com.google.cloud.apigateway.v1.Gateway.State.UNRECOGNIZED : result; 716 } 717 718 public static final int DEFAULT_HOSTNAME_FIELD_NUMBER = 9; 719 720 @SuppressWarnings("serial") 721 private volatile java.lang.Object defaultHostname_ = ""; 722 /** 723 * 724 * 725 * <pre> 726 * Output only. The default API Gateway host name of the form 727 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 728 * </pre> 729 * 730 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 731 * 732 * @return The defaultHostname. 733 */ 734 @java.lang.Override getDefaultHostname()735 public java.lang.String getDefaultHostname() { 736 java.lang.Object ref = defaultHostname_; 737 if (ref instanceof java.lang.String) { 738 return (java.lang.String) ref; 739 } else { 740 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 741 java.lang.String s = bs.toStringUtf8(); 742 defaultHostname_ = s; 743 return s; 744 } 745 } 746 /** 747 * 748 * 749 * <pre> 750 * Output only. The default API Gateway host name of the form 751 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 752 * </pre> 753 * 754 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 755 * 756 * @return The bytes for defaultHostname. 757 */ 758 @java.lang.Override getDefaultHostnameBytes()759 public com.google.protobuf.ByteString getDefaultHostnameBytes() { 760 java.lang.Object ref = defaultHostname_; 761 if (ref instanceof java.lang.String) { 762 com.google.protobuf.ByteString b = 763 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 764 defaultHostname_ = b; 765 return b; 766 } else { 767 return (com.google.protobuf.ByteString) ref; 768 } 769 } 770 771 private byte memoizedIsInitialized = -1; 772 773 @java.lang.Override isInitialized()774 public final boolean isInitialized() { 775 byte isInitialized = memoizedIsInitialized; 776 if (isInitialized == 1) return true; 777 if (isInitialized == 0) return false; 778 779 memoizedIsInitialized = 1; 780 return true; 781 } 782 783 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)784 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 785 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 786 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 787 } 788 if (createTime_ != null) { 789 output.writeMessage(2, getCreateTime()); 790 } 791 if (updateTime_ != null) { 792 output.writeMessage(3, getUpdateTime()); 793 } 794 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 795 output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); 796 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 797 com.google.protobuf.GeneratedMessageV3.writeString(output, 5, displayName_); 798 } 799 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiConfig_)) { 800 com.google.protobuf.GeneratedMessageV3.writeString(output, 6, apiConfig_); 801 } 802 if (state_ != com.google.cloud.apigateway.v1.Gateway.State.STATE_UNSPECIFIED.getNumber()) { 803 output.writeEnum(7, state_); 804 } 805 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultHostname_)) { 806 com.google.protobuf.GeneratedMessageV3.writeString(output, 9, defaultHostname_); 807 } 808 getUnknownFields().writeTo(output); 809 } 810 811 @java.lang.Override getSerializedSize()812 public int getSerializedSize() { 813 int size = memoizedSize; 814 if (size != -1) return size; 815 816 size = 0; 817 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 818 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 819 } 820 if (createTime_ != null) { 821 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); 822 } 823 if (updateTime_ != null) { 824 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); 825 } 826 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 827 internalGetLabels().getMap().entrySet()) { 828 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 829 LabelsDefaultEntryHolder.defaultEntry 830 .newBuilderForType() 831 .setKey(entry.getKey()) 832 .setValue(entry.getValue()) 833 .build(); 834 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); 835 } 836 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) { 837 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, displayName_); 838 } 839 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(apiConfig_)) { 840 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, apiConfig_); 841 } 842 if (state_ != com.google.cloud.apigateway.v1.Gateway.State.STATE_UNSPECIFIED.getNumber()) { 843 size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); 844 } 845 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(defaultHostname_)) { 846 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, defaultHostname_); 847 } 848 size += getUnknownFields().getSerializedSize(); 849 memoizedSize = size; 850 return size; 851 } 852 853 @java.lang.Override equals(final java.lang.Object obj)854 public boolean equals(final java.lang.Object obj) { 855 if (obj == this) { 856 return true; 857 } 858 if (!(obj instanceof com.google.cloud.apigateway.v1.Gateway)) { 859 return super.equals(obj); 860 } 861 com.google.cloud.apigateway.v1.Gateway other = (com.google.cloud.apigateway.v1.Gateway) obj; 862 863 if (!getName().equals(other.getName())) return false; 864 if (hasCreateTime() != other.hasCreateTime()) return false; 865 if (hasCreateTime()) { 866 if (!getCreateTime().equals(other.getCreateTime())) return false; 867 } 868 if (hasUpdateTime() != other.hasUpdateTime()) return false; 869 if (hasUpdateTime()) { 870 if (!getUpdateTime().equals(other.getUpdateTime())) return false; 871 } 872 if (!internalGetLabels().equals(other.internalGetLabels())) return false; 873 if (!getDisplayName().equals(other.getDisplayName())) return false; 874 if (!getApiConfig().equals(other.getApiConfig())) return false; 875 if (state_ != other.state_) return false; 876 if (!getDefaultHostname().equals(other.getDefaultHostname())) return false; 877 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 878 return true; 879 } 880 881 @java.lang.Override hashCode()882 public int hashCode() { 883 if (memoizedHashCode != 0) { 884 return memoizedHashCode; 885 } 886 int hash = 41; 887 hash = (19 * hash) + getDescriptor().hashCode(); 888 hash = (37 * hash) + NAME_FIELD_NUMBER; 889 hash = (53 * hash) + getName().hashCode(); 890 if (hasCreateTime()) { 891 hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; 892 hash = (53 * hash) + getCreateTime().hashCode(); 893 } 894 if (hasUpdateTime()) { 895 hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; 896 hash = (53 * hash) + getUpdateTime().hashCode(); 897 } 898 if (!internalGetLabels().getMap().isEmpty()) { 899 hash = (37 * hash) + LABELS_FIELD_NUMBER; 900 hash = (53 * hash) + internalGetLabels().hashCode(); 901 } 902 hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; 903 hash = (53 * hash) + getDisplayName().hashCode(); 904 hash = (37 * hash) + API_CONFIG_FIELD_NUMBER; 905 hash = (53 * hash) + getApiConfig().hashCode(); 906 hash = (37 * hash) + STATE_FIELD_NUMBER; 907 hash = (53 * hash) + state_; 908 hash = (37 * hash) + DEFAULT_HOSTNAME_FIELD_NUMBER; 909 hash = (53 * hash) + getDefaultHostname().hashCode(); 910 hash = (29 * hash) + getUnknownFields().hashCode(); 911 memoizedHashCode = hash; 912 return hash; 913 } 914 parseFrom(java.nio.ByteBuffer data)915 public static com.google.cloud.apigateway.v1.Gateway parseFrom(java.nio.ByteBuffer data) 916 throws com.google.protobuf.InvalidProtocolBufferException { 917 return PARSER.parseFrom(data); 918 } 919 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)920 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 921 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 922 throws com.google.protobuf.InvalidProtocolBufferException { 923 return PARSER.parseFrom(data, extensionRegistry); 924 } 925 parseFrom( com.google.protobuf.ByteString data)926 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 927 com.google.protobuf.ByteString data) 928 throws com.google.protobuf.InvalidProtocolBufferException { 929 return PARSER.parseFrom(data); 930 } 931 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)932 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 933 com.google.protobuf.ByteString data, 934 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 935 throws com.google.protobuf.InvalidProtocolBufferException { 936 return PARSER.parseFrom(data, extensionRegistry); 937 } 938 parseFrom(byte[] data)939 public static com.google.cloud.apigateway.v1.Gateway parseFrom(byte[] data) 940 throws com.google.protobuf.InvalidProtocolBufferException { 941 return PARSER.parseFrom(data); 942 } 943 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)944 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 945 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 946 throws com.google.protobuf.InvalidProtocolBufferException { 947 return PARSER.parseFrom(data, extensionRegistry); 948 } 949 parseFrom(java.io.InputStream input)950 public static com.google.cloud.apigateway.v1.Gateway parseFrom(java.io.InputStream input) 951 throws java.io.IOException { 952 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 953 } 954 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)955 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 956 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 957 throws java.io.IOException { 958 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 959 PARSER, input, extensionRegistry); 960 } 961 parseDelimitedFrom(java.io.InputStream input)962 public static com.google.cloud.apigateway.v1.Gateway parseDelimitedFrom(java.io.InputStream input) 963 throws java.io.IOException { 964 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 965 } 966 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)967 public static com.google.cloud.apigateway.v1.Gateway parseDelimitedFrom( 968 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 969 throws java.io.IOException { 970 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 971 PARSER, input, extensionRegistry); 972 } 973 parseFrom( com.google.protobuf.CodedInputStream input)974 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 975 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 976 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 977 } 978 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)979 public static com.google.cloud.apigateway.v1.Gateway parseFrom( 980 com.google.protobuf.CodedInputStream input, 981 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 982 throws java.io.IOException { 983 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 984 PARSER, input, extensionRegistry); 985 } 986 987 @java.lang.Override newBuilderForType()988 public Builder newBuilderForType() { 989 return newBuilder(); 990 } 991 newBuilder()992 public static Builder newBuilder() { 993 return DEFAULT_INSTANCE.toBuilder(); 994 } 995 newBuilder(com.google.cloud.apigateway.v1.Gateway prototype)996 public static Builder newBuilder(com.google.cloud.apigateway.v1.Gateway prototype) { 997 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 998 } 999 1000 @java.lang.Override toBuilder()1001 public Builder toBuilder() { 1002 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1003 } 1004 1005 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1006 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1007 Builder builder = new Builder(parent); 1008 return builder; 1009 } 1010 /** 1011 * 1012 * 1013 * <pre> 1014 * A Gateway is an API-aware HTTP proxy. It performs API-Method and/or 1015 * API-Consumer specific actions based on an API Config such as authentication, 1016 * policy enforcement, and backend selection. 1017 * </pre> 1018 * 1019 * Protobuf type {@code google.cloud.apigateway.v1.Gateway} 1020 */ 1021 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1022 implements 1023 // @@protoc_insertion_point(builder_implements:google.cloud.apigateway.v1.Gateway) 1024 com.google.cloud.apigateway.v1.GatewayOrBuilder { getDescriptor()1025 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1026 return com.google.cloud.apigateway.v1.Apigateway 1027 .internal_static_google_cloud_apigateway_v1_Gateway_descriptor; 1028 } 1029 1030 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)1031 protected com.google.protobuf.MapField internalGetMapField(int number) { 1032 switch (number) { 1033 case 4: 1034 return internalGetLabels(); 1035 default: 1036 throw new RuntimeException("Invalid map field number: " + number); 1037 } 1038 } 1039 1040 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)1041 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 1042 switch (number) { 1043 case 4: 1044 return internalGetMutableLabels(); 1045 default: 1046 throw new RuntimeException("Invalid map field number: " + number); 1047 } 1048 } 1049 1050 @java.lang.Override 1051 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1052 internalGetFieldAccessorTable() { 1053 return com.google.cloud.apigateway.v1.Apigateway 1054 .internal_static_google_cloud_apigateway_v1_Gateway_fieldAccessorTable 1055 .ensureFieldAccessorsInitialized( 1056 com.google.cloud.apigateway.v1.Gateway.class, 1057 com.google.cloud.apigateway.v1.Gateway.Builder.class); 1058 } 1059 1060 // Construct using com.google.cloud.apigateway.v1.Gateway.newBuilder() Builder()1061 private Builder() {} 1062 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1063 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1064 super(parent); 1065 } 1066 1067 @java.lang.Override clear()1068 public Builder clear() { 1069 super.clear(); 1070 bitField0_ = 0; 1071 name_ = ""; 1072 createTime_ = null; 1073 if (createTimeBuilder_ != null) { 1074 createTimeBuilder_.dispose(); 1075 createTimeBuilder_ = null; 1076 } 1077 updateTime_ = null; 1078 if (updateTimeBuilder_ != null) { 1079 updateTimeBuilder_.dispose(); 1080 updateTimeBuilder_ = null; 1081 } 1082 internalGetMutableLabels().clear(); 1083 displayName_ = ""; 1084 apiConfig_ = ""; 1085 state_ = 0; 1086 defaultHostname_ = ""; 1087 return this; 1088 } 1089 1090 @java.lang.Override getDescriptorForType()1091 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1092 return com.google.cloud.apigateway.v1.Apigateway 1093 .internal_static_google_cloud_apigateway_v1_Gateway_descriptor; 1094 } 1095 1096 @java.lang.Override getDefaultInstanceForType()1097 public com.google.cloud.apigateway.v1.Gateway getDefaultInstanceForType() { 1098 return com.google.cloud.apigateway.v1.Gateway.getDefaultInstance(); 1099 } 1100 1101 @java.lang.Override build()1102 public com.google.cloud.apigateway.v1.Gateway build() { 1103 com.google.cloud.apigateway.v1.Gateway result = buildPartial(); 1104 if (!result.isInitialized()) { 1105 throw newUninitializedMessageException(result); 1106 } 1107 return result; 1108 } 1109 1110 @java.lang.Override buildPartial()1111 public com.google.cloud.apigateway.v1.Gateway buildPartial() { 1112 com.google.cloud.apigateway.v1.Gateway result = 1113 new com.google.cloud.apigateway.v1.Gateway(this); 1114 if (bitField0_ != 0) { 1115 buildPartial0(result); 1116 } 1117 onBuilt(); 1118 return result; 1119 } 1120 buildPartial0(com.google.cloud.apigateway.v1.Gateway result)1121 private void buildPartial0(com.google.cloud.apigateway.v1.Gateway result) { 1122 int from_bitField0_ = bitField0_; 1123 if (((from_bitField0_ & 0x00000001) != 0)) { 1124 result.name_ = name_; 1125 } 1126 if (((from_bitField0_ & 0x00000002) != 0)) { 1127 result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); 1128 } 1129 if (((from_bitField0_ & 0x00000004) != 0)) { 1130 result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); 1131 } 1132 if (((from_bitField0_ & 0x00000008) != 0)) { 1133 result.labels_ = internalGetLabels(); 1134 result.labels_.makeImmutable(); 1135 } 1136 if (((from_bitField0_ & 0x00000010) != 0)) { 1137 result.displayName_ = displayName_; 1138 } 1139 if (((from_bitField0_ & 0x00000020) != 0)) { 1140 result.apiConfig_ = apiConfig_; 1141 } 1142 if (((from_bitField0_ & 0x00000040) != 0)) { 1143 result.state_ = state_; 1144 } 1145 if (((from_bitField0_ & 0x00000080) != 0)) { 1146 result.defaultHostname_ = defaultHostname_; 1147 } 1148 } 1149 1150 @java.lang.Override clone()1151 public Builder clone() { 1152 return super.clone(); 1153 } 1154 1155 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1156 public Builder setField( 1157 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1158 return super.setField(field, value); 1159 } 1160 1161 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1162 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1163 return super.clearField(field); 1164 } 1165 1166 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1167 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1168 return super.clearOneof(oneof); 1169 } 1170 1171 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1172 public Builder setRepeatedField( 1173 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1174 return super.setRepeatedField(field, index, value); 1175 } 1176 1177 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1178 public Builder addRepeatedField( 1179 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1180 return super.addRepeatedField(field, value); 1181 } 1182 1183 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1184 public Builder mergeFrom(com.google.protobuf.Message other) { 1185 if (other instanceof com.google.cloud.apigateway.v1.Gateway) { 1186 return mergeFrom((com.google.cloud.apigateway.v1.Gateway) other); 1187 } else { 1188 super.mergeFrom(other); 1189 return this; 1190 } 1191 } 1192 mergeFrom(com.google.cloud.apigateway.v1.Gateway other)1193 public Builder mergeFrom(com.google.cloud.apigateway.v1.Gateway other) { 1194 if (other == com.google.cloud.apigateway.v1.Gateway.getDefaultInstance()) return this; 1195 if (!other.getName().isEmpty()) { 1196 name_ = other.name_; 1197 bitField0_ |= 0x00000001; 1198 onChanged(); 1199 } 1200 if (other.hasCreateTime()) { 1201 mergeCreateTime(other.getCreateTime()); 1202 } 1203 if (other.hasUpdateTime()) { 1204 mergeUpdateTime(other.getUpdateTime()); 1205 } 1206 internalGetMutableLabels().mergeFrom(other.internalGetLabels()); 1207 bitField0_ |= 0x00000008; 1208 if (!other.getDisplayName().isEmpty()) { 1209 displayName_ = other.displayName_; 1210 bitField0_ |= 0x00000010; 1211 onChanged(); 1212 } 1213 if (!other.getApiConfig().isEmpty()) { 1214 apiConfig_ = other.apiConfig_; 1215 bitField0_ |= 0x00000020; 1216 onChanged(); 1217 } 1218 if (other.state_ != 0) { 1219 setStateValue(other.getStateValue()); 1220 } 1221 if (!other.getDefaultHostname().isEmpty()) { 1222 defaultHostname_ = other.defaultHostname_; 1223 bitField0_ |= 0x00000080; 1224 onChanged(); 1225 } 1226 this.mergeUnknownFields(other.getUnknownFields()); 1227 onChanged(); 1228 return this; 1229 } 1230 1231 @java.lang.Override isInitialized()1232 public final boolean isInitialized() { 1233 return true; 1234 } 1235 1236 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1237 public Builder mergeFrom( 1238 com.google.protobuf.CodedInputStream input, 1239 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1240 throws java.io.IOException { 1241 if (extensionRegistry == null) { 1242 throw new java.lang.NullPointerException(); 1243 } 1244 try { 1245 boolean done = false; 1246 while (!done) { 1247 int tag = input.readTag(); 1248 switch (tag) { 1249 case 0: 1250 done = true; 1251 break; 1252 case 10: 1253 { 1254 name_ = input.readStringRequireUtf8(); 1255 bitField0_ |= 0x00000001; 1256 break; 1257 } // case 10 1258 case 18: 1259 { 1260 input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); 1261 bitField0_ |= 0x00000002; 1262 break; 1263 } // case 18 1264 case 26: 1265 { 1266 input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); 1267 bitField0_ |= 0x00000004; 1268 break; 1269 } // case 26 1270 case 34: 1271 { 1272 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 1273 input.readMessage( 1274 LabelsDefaultEntryHolder.defaultEntry.getParserForType(), 1275 extensionRegistry); 1276 internalGetMutableLabels() 1277 .getMutableMap() 1278 .put(labels__.getKey(), labels__.getValue()); 1279 bitField0_ |= 0x00000008; 1280 break; 1281 } // case 34 1282 case 42: 1283 { 1284 displayName_ = input.readStringRequireUtf8(); 1285 bitField0_ |= 0x00000010; 1286 break; 1287 } // case 42 1288 case 50: 1289 { 1290 apiConfig_ = input.readStringRequireUtf8(); 1291 bitField0_ |= 0x00000020; 1292 break; 1293 } // case 50 1294 case 56: 1295 { 1296 state_ = input.readEnum(); 1297 bitField0_ |= 0x00000040; 1298 break; 1299 } // case 56 1300 case 74: 1301 { 1302 defaultHostname_ = input.readStringRequireUtf8(); 1303 bitField0_ |= 0x00000080; 1304 break; 1305 } // case 74 1306 default: 1307 { 1308 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1309 done = true; // was an endgroup tag 1310 } 1311 break; 1312 } // default: 1313 } // switch (tag) 1314 } // while (!done) 1315 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1316 throw e.unwrapIOException(); 1317 } finally { 1318 onChanged(); 1319 } // finally 1320 return this; 1321 } 1322 1323 private int bitField0_; 1324 1325 private java.lang.Object name_ = ""; 1326 /** 1327 * 1328 * 1329 * <pre> 1330 * Output only. Resource name of the Gateway. 1331 * Format: projects/{project}/locations/{location}/gateways/{gateway} 1332 * </pre> 1333 * 1334 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1335 * 1336 * @return The name. 1337 */ getName()1338 public java.lang.String getName() { 1339 java.lang.Object ref = name_; 1340 if (!(ref instanceof java.lang.String)) { 1341 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1342 java.lang.String s = bs.toStringUtf8(); 1343 name_ = s; 1344 return s; 1345 } else { 1346 return (java.lang.String) ref; 1347 } 1348 } 1349 /** 1350 * 1351 * 1352 * <pre> 1353 * Output only. Resource name of the Gateway. 1354 * Format: projects/{project}/locations/{location}/gateways/{gateway} 1355 * </pre> 1356 * 1357 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1358 * 1359 * @return The bytes for name. 1360 */ getNameBytes()1361 public com.google.protobuf.ByteString getNameBytes() { 1362 java.lang.Object ref = name_; 1363 if (ref instanceof String) { 1364 com.google.protobuf.ByteString b = 1365 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1366 name_ = b; 1367 return b; 1368 } else { 1369 return (com.google.protobuf.ByteString) ref; 1370 } 1371 } 1372 /** 1373 * 1374 * 1375 * <pre> 1376 * Output only. Resource name of the Gateway. 1377 * Format: projects/{project}/locations/{location}/gateways/{gateway} 1378 * </pre> 1379 * 1380 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1381 * 1382 * @param value The name to set. 1383 * @return This builder for chaining. 1384 */ setName(java.lang.String value)1385 public Builder setName(java.lang.String value) { 1386 if (value == null) { 1387 throw new NullPointerException(); 1388 } 1389 name_ = value; 1390 bitField0_ |= 0x00000001; 1391 onChanged(); 1392 return this; 1393 } 1394 /** 1395 * 1396 * 1397 * <pre> 1398 * Output only. Resource name of the Gateway. 1399 * Format: projects/{project}/locations/{location}/gateways/{gateway} 1400 * </pre> 1401 * 1402 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1403 * 1404 * @return This builder for chaining. 1405 */ clearName()1406 public Builder clearName() { 1407 name_ = getDefaultInstance().getName(); 1408 bitField0_ = (bitField0_ & ~0x00000001); 1409 onChanged(); 1410 return this; 1411 } 1412 /** 1413 * 1414 * 1415 * <pre> 1416 * Output only. Resource name of the Gateway. 1417 * Format: projects/{project}/locations/{location}/gateways/{gateway} 1418 * </pre> 1419 * 1420 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1421 * 1422 * @param value The bytes for name to set. 1423 * @return This builder for chaining. 1424 */ setNameBytes(com.google.protobuf.ByteString value)1425 public Builder setNameBytes(com.google.protobuf.ByteString value) { 1426 if (value == null) { 1427 throw new NullPointerException(); 1428 } 1429 checkByteStringIsUtf8(value); 1430 name_ = value; 1431 bitField0_ |= 0x00000001; 1432 onChanged(); 1433 return this; 1434 } 1435 1436 private com.google.protobuf.Timestamp createTime_; 1437 private com.google.protobuf.SingleFieldBuilderV3< 1438 com.google.protobuf.Timestamp, 1439 com.google.protobuf.Timestamp.Builder, 1440 com.google.protobuf.TimestampOrBuilder> 1441 createTimeBuilder_; 1442 /** 1443 * 1444 * 1445 * <pre> 1446 * Output only. Created time. 1447 * </pre> 1448 * 1449 * <code> 1450 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1451 * </code> 1452 * 1453 * @return Whether the createTime field is set. 1454 */ hasCreateTime()1455 public boolean hasCreateTime() { 1456 return ((bitField0_ & 0x00000002) != 0); 1457 } 1458 /** 1459 * 1460 * 1461 * <pre> 1462 * Output only. Created time. 1463 * </pre> 1464 * 1465 * <code> 1466 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1467 * </code> 1468 * 1469 * @return The createTime. 1470 */ getCreateTime()1471 public com.google.protobuf.Timestamp getCreateTime() { 1472 if (createTimeBuilder_ == null) { 1473 return createTime_ == null 1474 ? com.google.protobuf.Timestamp.getDefaultInstance() 1475 : createTime_; 1476 } else { 1477 return createTimeBuilder_.getMessage(); 1478 } 1479 } 1480 /** 1481 * 1482 * 1483 * <pre> 1484 * Output only. Created time. 1485 * </pre> 1486 * 1487 * <code> 1488 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1489 * </code> 1490 */ setCreateTime(com.google.protobuf.Timestamp value)1491 public Builder setCreateTime(com.google.protobuf.Timestamp value) { 1492 if (createTimeBuilder_ == null) { 1493 if (value == null) { 1494 throw new NullPointerException(); 1495 } 1496 createTime_ = value; 1497 } else { 1498 createTimeBuilder_.setMessage(value); 1499 } 1500 bitField0_ |= 0x00000002; 1501 onChanged(); 1502 return this; 1503 } 1504 /** 1505 * 1506 * 1507 * <pre> 1508 * Output only. Created time. 1509 * </pre> 1510 * 1511 * <code> 1512 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1513 * </code> 1514 */ setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue)1515 public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { 1516 if (createTimeBuilder_ == null) { 1517 createTime_ = builderForValue.build(); 1518 } else { 1519 createTimeBuilder_.setMessage(builderForValue.build()); 1520 } 1521 bitField0_ |= 0x00000002; 1522 onChanged(); 1523 return this; 1524 } 1525 /** 1526 * 1527 * 1528 * <pre> 1529 * Output only. Created time. 1530 * </pre> 1531 * 1532 * <code> 1533 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1534 * </code> 1535 */ mergeCreateTime(com.google.protobuf.Timestamp value)1536 public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { 1537 if (createTimeBuilder_ == null) { 1538 if (((bitField0_ & 0x00000002) != 0) 1539 && createTime_ != null 1540 && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 1541 getCreateTimeBuilder().mergeFrom(value); 1542 } else { 1543 createTime_ = value; 1544 } 1545 } else { 1546 createTimeBuilder_.mergeFrom(value); 1547 } 1548 bitField0_ |= 0x00000002; 1549 onChanged(); 1550 return this; 1551 } 1552 /** 1553 * 1554 * 1555 * <pre> 1556 * Output only. Created time. 1557 * </pre> 1558 * 1559 * <code> 1560 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1561 * </code> 1562 */ clearCreateTime()1563 public Builder clearCreateTime() { 1564 bitField0_ = (bitField0_ & ~0x00000002); 1565 createTime_ = null; 1566 if (createTimeBuilder_ != null) { 1567 createTimeBuilder_.dispose(); 1568 createTimeBuilder_ = null; 1569 } 1570 onChanged(); 1571 return this; 1572 } 1573 /** 1574 * 1575 * 1576 * <pre> 1577 * Output only. Created time. 1578 * </pre> 1579 * 1580 * <code> 1581 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1582 * </code> 1583 */ getCreateTimeBuilder()1584 public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { 1585 bitField0_ |= 0x00000002; 1586 onChanged(); 1587 return getCreateTimeFieldBuilder().getBuilder(); 1588 } 1589 /** 1590 * 1591 * 1592 * <pre> 1593 * Output only. Created time. 1594 * </pre> 1595 * 1596 * <code> 1597 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1598 * </code> 1599 */ getCreateTimeOrBuilder()1600 public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 1601 if (createTimeBuilder_ != null) { 1602 return createTimeBuilder_.getMessageOrBuilder(); 1603 } else { 1604 return createTime_ == null 1605 ? com.google.protobuf.Timestamp.getDefaultInstance() 1606 : createTime_; 1607 } 1608 } 1609 /** 1610 * 1611 * 1612 * <pre> 1613 * Output only. Created time. 1614 * </pre> 1615 * 1616 * <code> 1617 * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1618 * </code> 1619 */ 1620 private com.google.protobuf.SingleFieldBuilderV3< 1621 com.google.protobuf.Timestamp, 1622 com.google.protobuf.Timestamp.Builder, 1623 com.google.protobuf.TimestampOrBuilder> getCreateTimeFieldBuilder()1624 getCreateTimeFieldBuilder() { 1625 if (createTimeBuilder_ == null) { 1626 createTimeBuilder_ = 1627 new com.google.protobuf.SingleFieldBuilderV3< 1628 com.google.protobuf.Timestamp, 1629 com.google.protobuf.Timestamp.Builder, 1630 com.google.protobuf.TimestampOrBuilder>( 1631 getCreateTime(), getParentForChildren(), isClean()); 1632 createTime_ = null; 1633 } 1634 return createTimeBuilder_; 1635 } 1636 1637 private com.google.protobuf.Timestamp updateTime_; 1638 private com.google.protobuf.SingleFieldBuilderV3< 1639 com.google.protobuf.Timestamp, 1640 com.google.protobuf.Timestamp.Builder, 1641 com.google.protobuf.TimestampOrBuilder> 1642 updateTimeBuilder_; 1643 /** 1644 * 1645 * 1646 * <pre> 1647 * Output only. Updated time. 1648 * </pre> 1649 * 1650 * <code> 1651 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1652 * </code> 1653 * 1654 * @return Whether the updateTime field is set. 1655 */ hasUpdateTime()1656 public boolean hasUpdateTime() { 1657 return ((bitField0_ & 0x00000004) != 0); 1658 } 1659 /** 1660 * 1661 * 1662 * <pre> 1663 * Output only. Updated time. 1664 * </pre> 1665 * 1666 * <code> 1667 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1668 * </code> 1669 * 1670 * @return The updateTime. 1671 */ getUpdateTime()1672 public com.google.protobuf.Timestamp getUpdateTime() { 1673 if (updateTimeBuilder_ == null) { 1674 return updateTime_ == null 1675 ? com.google.protobuf.Timestamp.getDefaultInstance() 1676 : updateTime_; 1677 } else { 1678 return updateTimeBuilder_.getMessage(); 1679 } 1680 } 1681 /** 1682 * 1683 * 1684 * <pre> 1685 * Output only. Updated time. 1686 * </pre> 1687 * 1688 * <code> 1689 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1690 * </code> 1691 */ setUpdateTime(com.google.protobuf.Timestamp value)1692 public Builder setUpdateTime(com.google.protobuf.Timestamp value) { 1693 if (updateTimeBuilder_ == null) { 1694 if (value == null) { 1695 throw new NullPointerException(); 1696 } 1697 updateTime_ = value; 1698 } else { 1699 updateTimeBuilder_.setMessage(value); 1700 } 1701 bitField0_ |= 0x00000004; 1702 onChanged(); 1703 return this; 1704 } 1705 /** 1706 * 1707 * 1708 * <pre> 1709 * Output only. Updated time. 1710 * </pre> 1711 * 1712 * <code> 1713 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1714 * </code> 1715 */ setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue)1716 public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { 1717 if (updateTimeBuilder_ == null) { 1718 updateTime_ = builderForValue.build(); 1719 } else { 1720 updateTimeBuilder_.setMessage(builderForValue.build()); 1721 } 1722 bitField0_ |= 0x00000004; 1723 onChanged(); 1724 return this; 1725 } 1726 /** 1727 * 1728 * 1729 * <pre> 1730 * Output only. Updated time. 1731 * </pre> 1732 * 1733 * <code> 1734 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1735 * </code> 1736 */ mergeUpdateTime(com.google.protobuf.Timestamp value)1737 public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { 1738 if (updateTimeBuilder_ == null) { 1739 if (((bitField0_ & 0x00000004) != 0) 1740 && updateTime_ != null 1741 && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 1742 getUpdateTimeBuilder().mergeFrom(value); 1743 } else { 1744 updateTime_ = value; 1745 } 1746 } else { 1747 updateTimeBuilder_.mergeFrom(value); 1748 } 1749 bitField0_ |= 0x00000004; 1750 onChanged(); 1751 return this; 1752 } 1753 /** 1754 * 1755 * 1756 * <pre> 1757 * Output only. Updated time. 1758 * </pre> 1759 * 1760 * <code> 1761 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1762 * </code> 1763 */ clearUpdateTime()1764 public Builder clearUpdateTime() { 1765 bitField0_ = (bitField0_ & ~0x00000004); 1766 updateTime_ = null; 1767 if (updateTimeBuilder_ != null) { 1768 updateTimeBuilder_.dispose(); 1769 updateTimeBuilder_ = null; 1770 } 1771 onChanged(); 1772 return this; 1773 } 1774 /** 1775 * 1776 * 1777 * <pre> 1778 * Output only. Updated time. 1779 * </pre> 1780 * 1781 * <code> 1782 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1783 * </code> 1784 */ getUpdateTimeBuilder()1785 public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { 1786 bitField0_ |= 0x00000004; 1787 onChanged(); 1788 return getUpdateTimeFieldBuilder().getBuilder(); 1789 } 1790 /** 1791 * 1792 * 1793 * <pre> 1794 * Output only. Updated time. 1795 * </pre> 1796 * 1797 * <code> 1798 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1799 * </code> 1800 */ getUpdateTimeOrBuilder()1801 public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { 1802 if (updateTimeBuilder_ != null) { 1803 return updateTimeBuilder_.getMessageOrBuilder(); 1804 } else { 1805 return updateTime_ == null 1806 ? com.google.protobuf.Timestamp.getDefaultInstance() 1807 : updateTime_; 1808 } 1809 } 1810 /** 1811 * 1812 * 1813 * <pre> 1814 * Output only. Updated time. 1815 * </pre> 1816 * 1817 * <code> 1818 * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 1819 * </code> 1820 */ 1821 private com.google.protobuf.SingleFieldBuilderV3< 1822 com.google.protobuf.Timestamp, 1823 com.google.protobuf.Timestamp.Builder, 1824 com.google.protobuf.TimestampOrBuilder> getUpdateTimeFieldBuilder()1825 getUpdateTimeFieldBuilder() { 1826 if (updateTimeBuilder_ == null) { 1827 updateTimeBuilder_ = 1828 new com.google.protobuf.SingleFieldBuilderV3< 1829 com.google.protobuf.Timestamp, 1830 com.google.protobuf.Timestamp.Builder, 1831 com.google.protobuf.TimestampOrBuilder>( 1832 getUpdateTime(), getParentForChildren(), isClean()); 1833 updateTime_ = null; 1834 } 1835 return updateTimeBuilder_; 1836 } 1837 1838 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 1839 internalGetLabels()1840 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 1841 if (labels_ == null) { 1842 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 1843 } 1844 return labels_; 1845 } 1846 1847 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableLabels()1848 internalGetMutableLabels() { 1849 if (labels_ == null) { 1850 labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); 1851 } 1852 if (!labels_.isMutable()) { 1853 labels_ = labels_.copy(); 1854 } 1855 bitField0_ |= 0x00000008; 1856 onChanged(); 1857 return labels_; 1858 } 1859 getLabelsCount()1860 public int getLabelsCount() { 1861 return internalGetLabels().getMap().size(); 1862 } 1863 /** 1864 * 1865 * 1866 * <pre> 1867 * Optional. Resource labels to represent user-provided metadata. 1868 * Refer to cloud documentation on labels for more details. 1869 * https://cloud.google.com/compute/docs/labeling-resources 1870 * </pre> 1871 * 1872 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 1873 */ 1874 @java.lang.Override containsLabels(java.lang.String key)1875 public boolean containsLabels(java.lang.String key) { 1876 if (key == null) { 1877 throw new NullPointerException("map key"); 1878 } 1879 return internalGetLabels().getMap().containsKey(key); 1880 } 1881 /** Use {@link #getLabelsMap()} instead. */ 1882 @java.lang.Override 1883 @java.lang.Deprecated getLabels()1884 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 1885 return getLabelsMap(); 1886 } 1887 /** 1888 * 1889 * 1890 * <pre> 1891 * Optional. Resource labels to represent user-provided metadata. 1892 * Refer to cloud documentation on labels for more details. 1893 * https://cloud.google.com/compute/docs/labeling-resources 1894 * </pre> 1895 * 1896 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 1897 */ 1898 @java.lang.Override getLabelsMap()1899 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 1900 return internalGetLabels().getMap(); 1901 } 1902 /** 1903 * 1904 * 1905 * <pre> 1906 * Optional. Resource labels to represent user-provided metadata. 1907 * Refer to cloud documentation on labels for more details. 1908 * https://cloud.google.com/compute/docs/labeling-resources 1909 * </pre> 1910 * 1911 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 1912 */ 1913 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)1914 public /* nullable */ java.lang.String getLabelsOrDefault( 1915 java.lang.String key, 1916 /* nullable */ 1917 java.lang.String defaultValue) { 1918 if (key == null) { 1919 throw new NullPointerException("map key"); 1920 } 1921 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 1922 return map.containsKey(key) ? map.get(key) : defaultValue; 1923 } 1924 /** 1925 * 1926 * 1927 * <pre> 1928 * Optional. Resource labels to represent user-provided metadata. 1929 * Refer to cloud documentation on labels for more details. 1930 * https://cloud.google.com/compute/docs/labeling-resources 1931 * </pre> 1932 * 1933 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 1934 */ 1935 @java.lang.Override getLabelsOrThrow(java.lang.String key)1936 public java.lang.String getLabelsOrThrow(java.lang.String key) { 1937 if (key == null) { 1938 throw new NullPointerException("map key"); 1939 } 1940 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 1941 if (!map.containsKey(key)) { 1942 throw new java.lang.IllegalArgumentException(); 1943 } 1944 return map.get(key); 1945 } 1946 clearLabels()1947 public Builder clearLabels() { 1948 bitField0_ = (bitField0_ & ~0x00000008); 1949 internalGetMutableLabels().getMutableMap().clear(); 1950 return this; 1951 } 1952 /** 1953 * 1954 * 1955 * <pre> 1956 * Optional. Resource labels to represent user-provided metadata. 1957 * Refer to cloud documentation on labels for more details. 1958 * https://cloud.google.com/compute/docs/labeling-resources 1959 * </pre> 1960 * 1961 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 1962 */ removeLabels(java.lang.String key)1963 public Builder removeLabels(java.lang.String key) { 1964 if (key == null) { 1965 throw new NullPointerException("map key"); 1966 } 1967 internalGetMutableLabels().getMutableMap().remove(key); 1968 return this; 1969 } 1970 /** Use alternate mutation accessors instead. */ 1971 @java.lang.Deprecated getMutableLabels()1972 public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() { 1973 bitField0_ |= 0x00000008; 1974 return internalGetMutableLabels().getMutableMap(); 1975 } 1976 /** 1977 * 1978 * 1979 * <pre> 1980 * Optional. Resource labels to represent user-provided metadata. 1981 * Refer to cloud documentation on labels for more details. 1982 * https://cloud.google.com/compute/docs/labeling-resources 1983 * </pre> 1984 * 1985 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 1986 */ putLabels(java.lang.String key, java.lang.String value)1987 public Builder putLabels(java.lang.String key, java.lang.String value) { 1988 if (key == null) { 1989 throw new NullPointerException("map key"); 1990 } 1991 if (value == null) { 1992 throw new NullPointerException("map value"); 1993 } 1994 internalGetMutableLabels().getMutableMap().put(key, value); 1995 bitField0_ |= 0x00000008; 1996 return this; 1997 } 1998 /** 1999 * 2000 * 2001 * <pre> 2002 * Optional. Resource labels to represent user-provided metadata. 2003 * Refer to cloud documentation on labels for more details. 2004 * https://cloud.google.com/compute/docs/labeling-resources 2005 * </pre> 2006 * 2007 * <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code> 2008 */ putAllLabels(java.util.Map<java.lang.String, java.lang.String> values)2009 public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) { 2010 internalGetMutableLabels().getMutableMap().putAll(values); 2011 bitField0_ |= 0x00000008; 2012 return this; 2013 } 2014 2015 private java.lang.Object displayName_ = ""; 2016 /** 2017 * 2018 * 2019 * <pre> 2020 * Optional. Display name. 2021 * </pre> 2022 * 2023 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 2024 * 2025 * @return The displayName. 2026 */ getDisplayName()2027 public java.lang.String getDisplayName() { 2028 java.lang.Object ref = displayName_; 2029 if (!(ref instanceof java.lang.String)) { 2030 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2031 java.lang.String s = bs.toStringUtf8(); 2032 displayName_ = s; 2033 return s; 2034 } else { 2035 return (java.lang.String) ref; 2036 } 2037 } 2038 /** 2039 * 2040 * 2041 * <pre> 2042 * Optional. Display name. 2043 * </pre> 2044 * 2045 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 2046 * 2047 * @return The bytes for displayName. 2048 */ getDisplayNameBytes()2049 public com.google.protobuf.ByteString getDisplayNameBytes() { 2050 java.lang.Object ref = displayName_; 2051 if (ref instanceof String) { 2052 com.google.protobuf.ByteString b = 2053 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2054 displayName_ = b; 2055 return b; 2056 } else { 2057 return (com.google.protobuf.ByteString) ref; 2058 } 2059 } 2060 /** 2061 * 2062 * 2063 * <pre> 2064 * Optional. Display name. 2065 * </pre> 2066 * 2067 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 2068 * 2069 * @param value The displayName to set. 2070 * @return This builder for chaining. 2071 */ setDisplayName(java.lang.String value)2072 public Builder setDisplayName(java.lang.String value) { 2073 if (value == null) { 2074 throw new NullPointerException(); 2075 } 2076 displayName_ = value; 2077 bitField0_ |= 0x00000010; 2078 onChanged(); 2079 return this; 2080 } 2081 /** 2082 * 2083 * 2084 * <pre> 2085 * Optional. Display name. 2086 * </pre> 2087 * 2088 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 2089 * 2090 * @return This builder for chaining. 2091 */ clearDisplayName()2092 public Builder clearDisplayName() { 2093 displayName_ = getDefaultInstance().getDisplayName(); 2094 bitField0_ = (bitField0_ & ~0x00000010); 2095 onChanged(); 2096 return this; 2097 } 2098 /** 2099 * 2100 * 2101 * <pre> 2102 * Optional. Display name. 2103 * </pre> 2104 * 2105 * <code>string display_name = 5 [(.google.api.field_behavior) = OPTIONAL];</code> 2106 * 2107 * @param value The bytes for displayName to set. 2108 * @return This builder for chaining. 2109 */ setDisplayNameBytes(com.google.protobuf.ByteString value)2110 public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { 2111 if (value == null) { 2112 throw new NullPointerException(); 2113 } 2114 checkByteStringIsUtf8(value); 2115 displayName_ = value; 2116 bitField0_ |= 0x00000010; 2117 onChanged(); 2118 return this; 2119 } 2120 2121 private java.lang.Object apiConfig_ = ""; 2122 /** 2123 * 2124 * 2125 * <pre> 2126 * Required. Resource name of the API Config for this Gateway. 2127 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 2128 * </pre> 2129 * 2130 * <code> 2131 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 2132 * </code> 2133 * 2134 * @return The apiConfig. 2135 */ getApiConfig()2136 public java.lang.String getApiConfig() { 2137 java.lang.Object ref = apiConfig_; 2138 if (!(ref instanceof java.lang.String)) { 2139 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2140 java.lang.String s = bs.toStringUtf8(); 2141 apiConfig_ = s; 2142 return s; 2143 } else { 2144 return (java.lang.String) ref; 2145 } 2146 } 2147 /** 2148 * 2149 * 2150 * <pre> 2151 * Required. Resource name of the API Config for this Gateway. 2152 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 2153 * </pre> 2154 * 2155 * <code> 2156 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 2157 * </code> 2158 * 2159 * @return The bytes for apiConfig. 2160 */ getApiConfigBytes()2161 public com.google.protobuf.ByteString getApiConfigBytes() { 2162 java.lang.Object ref = apiConfig_; 2163 if (ref instanceof String) { 2164 com.google.protobuf.ByteString b = 2165 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2166 apiConfig_ = b; 2167 return b; 2168 } else { 2169 return (com.google.protobuf.ByteString) ref; 2170 } 2171 } 2172 /** 2173 * 2174 * 2175 * <pre> 2176 * Required. Resource name of the API Config for this Gateway. 2177 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 2178 * </pre> 2179 * 2180 * <code> 2181 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 2182 * </code> 2183 * 2184 * @param value The apiConfig to set. 2185 * @return This builder for chaining. 2186 */ setApiConfig(java.lang.String value)2187 public Builder setApiConfig(java.lang.String value) { 2188 if (value == null) { 2189 throw new NullPointerException(); 2190 } 2191 apiConfig_ = value; 2192 bitField0_ |= 0x00000020; 2193 onChanged(); 2194 return this; 2195 } 2196 /** 2197 * 2198 * 2199 * <pre> 2200 * Required. Resource name of the API Config for this Gateway. 2201 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 2202 * </pre> 2203 * 2204 * <code> 2205 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 2206 * </code> 2207 * 2208 * @return This builder for chaining. 2209 */ clearApiConfig()2210 public Builder clearApiConfig() { 2211 apiConfig_ = getDefaultInstance().getApiConfig(); 2212 bitField0_ = (bitField0_ & ~0x00000020); 2213 onChanged(); 2214 return this; 2215 } 2216 /** 2217 * 2218 * 2219 * <pre> 2220 * Required. Resource name of the API Config for this Gateway. 2221 * Format: projects/{project}/locations/global/apis/{api}/configs/{apiConfig} 2222 * </pre> 2223 * 2224 * <code> 2225 * string api_config = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 2226 * </code> 2227 * 2228 * @param value The bytes for apiConfig to set. 2229 * @return This builder for chaining. 2230 */ setApiConfigBytes(com.google.protobuf.ByteString value)2231 public Builder setApiConfigBytes(com.google.protobuf.ByteString value) { 2232 if (value == null) { 2233 throw new NullPointerException(); 2234 } 2235 checkByteStringIsUtf8(value); 2236 apiConfig_ = value; 2237 bitField0_ |= 0x00000020; 2238 onChanged(); 2239 return this; 2240 } 2241 2242 private int state_ = 0; 2243 /** 2244 * 2245 * 2246 * <pre> 2247 * Output only. The current state of the Gateway. 2248 * </pre> 2249 * 2250 * <code> 2251 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2252 * </code> 2253 * 2254 * @return The enum numeric value on the wire for state. 2255 */ 2256 @java.lang.Override getStateValue()2257 public int getStateValue() { 2258 return state_; 2259 } 2260 /** 2261 * 2262 * 2263 * <pre> 2264 * Output only. The current state of the Gateway. 2265 * </pre> 2266 * 2267 * <code> 2268 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2269 * </code> 2270 * 2271 * @param value The enum numeric value on the wire for state to set. 2272 * @return This builder for chaining. 2273 */ setStateValue(int value)2274 public Builder setStateValue(int value) { 2275 state_ = value; 2276 bitField0_ |= 0x00000040; 2277 onChanged(); 2278 return this; 2279 } 2280 /** 2281 * 2282 * 2283 * <pre> 2284 * Output only. The current state of the Gateway. 2285 * </pre> 2286 * 2287 * <code> 2288 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2289 * </code> 2290 * 2291 * @return The state. 2292 */ 2293 @java.lang.Override getState()2294 public com.google.cloud.apigateway.v1.Gateway.State getState() { 2295 com.google.cloud.apigateway.v1.Gateway.State result = 2296 com.google.cloud.apigateway.v1.Gateway.State.forNumber(state_); 2297 return result == null ? com.google.cloud.apigateway.v1.Gateway.State.UNRECOGNIZED : result; 2298 } 2299 /** 2300 * 2301 * 2302 * <pre> 2303 * Output only. The current state of the Gateway. 2304 * </pre> 2305 * 2306 * <code> 2307 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2308 * </code> 2309 * 2310 * @param value The state to set. 2311 * @return This builder for chaining. 2312 */ setState(com.google.cloud.apigateway.v1.Gateway.State value)2313 public Builder setState(com.google.cloud.apigateway.v1.Gateway.State value) { 2314 if (value == null) { 2315 throw new NullPointerException(); 2316 } 2317 bitField0_ |= 0x00000040; 2318 state_ = value.getNumber(); 2319 onChanged(); 2320 return this; 2321 } 2322 /** 2323 * 2324 * 2325 * <pre> 2326 * Output only. The current state of the Gateway. 2327 * </pre> 2328 * 2329 * <code> 2330 * .google.cloud.apigateway.v1.Gateway.State state = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2331 * </code> 2332 * 2333 * @return This builder for chaining. 2334 */ clearState()2335 public Builder clearState() { 2336 bitField0_ = (bitField0_ & ~0x00000040); 2337 state_ = 0; 2338 onChanged(); 2339 return this; 2340 } 2341 2342 private java.lang.Object defaultHostname_ = ""; 2343 /** 2344 * 2345 * 2346 * <pre> 2347 * Output only. The default API Gateway host name of the form 2348 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 2349 * </pre> 2350 * 2351 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 2352 * 2353 * @return The defaultHostname. 2354 */ getDefaultHostname()2355 public java.lang.String getDefaultHostname() { 2356 java.lang.Object ref = defaultHostname_; 2357 if (!(ref instanceof java.lang.String)) { 2358 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 2359 java.lang.String s = bs.toStringUtf8(); 2360 defaultHostname_ = s; 2361 return s; 2362 } else { 2363 return (java.lang.String) ref; 2364 } 2365 } 2366 /** 2367 * 2368 * 2369 * <pre> 2370 * Output only. The default API Gateway host name of the form 2371 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 2372 * </pre> 2373 * 2374 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 2375 * 2376 * @return The bytes for defaultHostname. 2377 */ getDefaultHostnameBytes()2378 public com.google.protobuf.ByteString getDefaultHostnameBytes() { 2379 java.lang.Object ref = defaultHostname_; 2380 if (ref instanceof String) { 2381 com.google.protobuf.ByteString b = 2382 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 2383 defaultHostname_ = b; 2384 return b; 2385 } else { 2386 return (com.google.protobuf.ByteString) ref; 2387 } 2388 } 2389 /** 2390 * 2391 * 2392 * <pre> 2393 * Output only. The default API Gateway host name of the form 2394 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 2395 * </pre> 2396 * 2397 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 2398 * 2399 * @param value The defaultHostname to set. 2400 * @return This builder for chaining. 2401 */ setDefaultHostname(java.lang.String value)2402 public Builder setDefaultHostname(java.lang.String value) { 2403 if (value == null) { 2404 throw new NullPointerException(); 2405 } 2406 defaultHostname_ = value; 2407 bitField0_ |= 0x00000080; 2408 onChanged(); 2409 return this; 2410 } 2411 /** 2412 * 2413 * 2414 * <pre> 2415 * Output only. The default API Gateway host name of the form 2416 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 2417 * </pre> 2418 * 2419 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 2420 * 2421 * @return This builder for chaining. 2422 */ clearDefaultHostname()2423 public Builder clearDefaultHostname() { 2424 defaultHostname_ = getDefaultInstance().getDefaultHostname(); 2425 bitField0_ = (bitField0_ & ~0x00000080); 2426 onChanged(); 2427 return this; 2428 } 2429 /** 2430 * 2431 * 2432 * <pre> 2433 * Output only. The default API Gateway host name of the form 2434 * `{gateway_id}-{hash}.{region_code}.gateway.dev`. 2435 * </pre> 2436 * 2437 * <code>string default_hostname = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 2438 * 2439 * @param value The bytes for defaultHostname to set. 2440 * @return This builder for chaining. 2441 */ setDefaultHostnameBytes(com.google.protobuf.ByteString value)2442 public Builder setDefaultHostnameBytes(com.google.protobuf.ByteString value) { 2443 if (value == null) { 2444 throw new NullPointerException(); 2445 } 2446 checkByteStringIsUtf8(value); 2447 defaultHostname_ = value; 2448 bitField0_ |= 0x00000080; 2449 onChanged(); 2450 return this; 2451 } 2452 2453 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)2454 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 2455 return super.setUnknownFields(unknownFields); 2456 } 2457 2458 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)2459 public final Builder mergeUnknownFields( 2460 final com.google.protobuf.UnknownFieldSet unknownFields) { 2461 return super.mergeUnknownFields(unknownFields); 2462 } 2463 2464 // @@protoc_insertion_point(builder_scope:google.cloud.apigateway.v1.Gateway) 2465 } 2466 2467 // @@protoc_insertion_point(class_scope:google.cloud.apigateway.v1.Gateway) 2468 private static final com.google.cloud.apigateway.v1.Gateway DEFAULT_INSTANCE; 2469 2470 static { 2471 DEFAULT_INSTANCE = new com.google.cloud.apigateway.v1.Gateway(); 2472 } 2473 getDefaultInstance()2474 public static com.google.cloud.apigateway.v1.Gateway getDefaultInstance() { 2475 return DEFAULT_INSTANCE; 2476 } 2477 2478 private static final com.google.protobuf.Parser<Gateway> PARSER = 2479 new com.google.protobuf.AbstractParser<Gateway>() { 2480 @java.lang.Override 2481 public Gateway parsePartialFrom( 2482 com.google.protobuf.CodedInputStream input, 2483 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 2484 throws com.google.protobuf.InvalidProtocolBufferException { 2485 Builder builder = newBuilder(); 2486 try { 2487 builder.mergeFrom(input, extensionRegistry); 2488 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 2489 throw e.setUnfinishedMessage(builder.buildPartial()); 2490 } catch (com.google.protobuf.UninitializedMessageException e) { 2491 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 2492 } catch (java.io.IOException e) { 2493 throw new com.google.protobuf.InvalidProtocolBufferException(e) 2494 .setUnfinishedMessage(builder.buildPartial()); 2495 } 2496 return builder.buildPartial(); 2497 } 2498 }; 2499 parser()2500 public static com.google.protobuf.Parser<Gateway> parser() { 2501 return PARSER; 2502 } 2503 2504 @java.lang.Override getParserForType()2505 public com.google.protobuf.Parser<Gateway> getParserForType() { 2506 return PARSER; 2507 } 2508 2509 @java.lang.Override getDefaultInstanceForType()2510 public com.google.cloud.apigateway.v1.Gateway getDefaultInstanceForType() { 2511 return DEFAULT_INSTANCE; 2512 } 2513 } 2514