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/kms/v1/service.proto 18 19 package com.google.cloud.kms.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * Request message for 26 * [KeyManagementService.CreateKeyRing][google.cloud.kms.v1.KeyManagementService.CreateKeyRing]. 27 * </pre> 28 * 29 * Protobuf type {@code google.cloud.kms.v1.CreateKeyRingRequest} 30 */ 31 public final class CreateKeyRingRequest extends com.google.protobuf.GeneratedMessageV3 32 implements 33 // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CreateKeyRingRequest) 34 CreateKeyRingRequestOrBuilder { 35 private static final long serialVersionUID = 0L; 36 // Use CreateKeyRingRequest.newBuilder() to construct. CreateKeyRingRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)37 private CreateKeyRingRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 38 super(builder); 39 } 40 CreateKeyRingRequest()41 private CreateKeyRingRequest() { 42 parent_ = ""; 43 keyRingId_ = ""; 44 } 45 46 @java.lang.Override 47 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)48 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 49 return new CreateKeyRingRequest(); 50 } 51 52 @java.lang.Override getUnknownFields()53 public final com.google.protobuf.UnknownFieldSet getUnknownFields() { 54 return this.unknownFields; 55 } 56 getDescriptor()57 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 58 return com.google.cloud.kms.v1.KmsProto 59 .internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor; 60 } 61 62 @java.lang.Override 63 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()64 internalGetFieldAccessorTable() { 65 return com.google.cloud.kms.v1.KmsProto 66 .internal_static_google_cloud_kms_v1_CreateKeyRingRequest_fieldAccessorTable 67 .ensureFieldAccessorsInitialized( 68 com.google.cloud.kms.v1.CreateKeyRingRequest.class, 69 com.google.cloud.kms.v1.CreateKeyRingRequest.Builder.class); 70 } 71 72 public static final int PARENT_FIELD_NUMBER = 1; 73 74 @SuppressWarnings("serial") 75 private volatile java.lang.Object parent_ = ""; 76 /** 77 * 78 * 79 * <pre> 80 * Required. The resource name of the location associated with the 81 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 82 * `projects/*/locations/*`. 83 * </pre> 84 * 85 * <code> 86 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 87 * </code> 88 * 89 * @return The parent. 90 */ 91 @java.lang.Override getParent()92 public java.lang.String getParent() { 93 java.lang.Object ref = parent_; 94 if (ref instanceof java.lang.String) { 95 return (java.lang.String) ref; 96 } else { 97 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 98 java.lang.String s = bs.toStringUtf8(); 99 parent_ = s; 100 return s; 101 } 102 } 103 /** 104 * 105 * 106 * <pre> 107 * Required. The resource name of the location associated with the 108 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 109 * `projects/*/locations/*`. 110 * </pre> 111 * 112 * <code> 113 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 114 * </code> 115 * 116 * @return The bytes for parent. 117 */ 118 @java.lang.Override getParentBytes()119 public com.google.protobuf.ByteString getParentBytes() { 120 java.lang.Object ref = parent_; 121 if (ref instanceof java.lang.String) { 122 com.google.protobuf.ByteString b = 123 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 124 parent_ = b; 125 return b; 126 } else { 127 return (com.google.protobuf.ByteString) ref; 128 } 129 } 130 131 public static final int KEY_RING_ID_FIELD_NUMBER = 2; 132 133 @SuppressWarnings("serial") 134 private volatile java.lang.Object keyRingId_ = ""; 135 /** 136 * 137 * 138 * <pre> 139 * Required. It must be unique within a location and match the regular 140 * expression `[a-zA-Z0-9_-]{1,63}` 141 * </pre> 142 * 143 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 144 * 145 * @return The keyRingId. 146 */ 147 @java.lang.Override getKeyRingId()148 public java.lang.String getKeyRingId() { 149 java.lang.Object ref = keyRingId_; 150 if (ref instanceof java.lang.String) { 151 return (java.lang.String) ref; 152 } else { 153 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 154 java.lang.String s = bs.toStringUtf8(); 155 keyRingId_ = s; 156 return s; 157 } 158 } 159 /** 160 * 161 * 162 * <pre> 163 * Required. It must be unique within a location and match the regular 164 * expression `[a-zA-Z0-9_-]{1,63}` 165 * </pre> 166 * 167 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 168 * 169 * @return The bytes for keyRingId. 170 */ 171 @java.lang.Override getKeyRingIdBytes()172 public com.google.protobuf.ByteString getKeyRingIdBytes() { 173 java.lang.Object ref = keyRingId_; 174 if (ref instanceof java.lang.String) { 175 com.google.protobuf.ByteString b = 176 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 177 keyRingId_ = b; 178 return b; 179 } else { 180 return (com.google.protobuf.ByteString) ref; 181 } 182 } 183 184 public static final int KEY_RING_FIELD_NUMBER = 3; 185 private com.google.cloud.kms.v1.KeyRing keyRing_; 186 /** 187 * 188 * 189 * <pre> 190 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 191 * values. 192 * </pre> 193 * 194 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 195 * </code> 196 * 197 * @return Whether the keyRing field is set. 198 */ 199 @java.lang.Override hasKeyRing()200 public boolean hasKeyRing() { 201 return keyRing_ != null; 202 } 203 /** 204 * 205 * 206 * <pre> 207 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 208 * values. 209 * </pre> 210 * 211 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 212 * </code> 213 * 214 * @return The keyRing. 215 */ 216 @java.lang.Override getKeyRing()217 public com.google.cloud.kms.v1.KeyRing getKeyRing() { 218 return keyRing_ == null ? com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_; 219 } 220 /** 221 * 222 * 223 * <pre> 224 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 225 * values. 226 * </pre> 227 * 228 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 229 * </code> 230 */ 231 @java.lang.Override getKeyRingOrBuilder()232 public com.google.cloud.kms.v1.KeyRingOrBuilder getKeyRingOrBuilder() { 233 return keyRing_ == null ? com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_; 234 } 235 236 private byte memoizedIsInitialized = -1; 237 238 @java.lang.Override isInitialized()239 public final boolean isInitialized() { 240 byte isInitialized = memoizedIsInitialized; 241 if (isInitialized == 1) return true; 242 if (isInitialized == 0) return false; 243 244 memoizedIsInitialized = 1; 245 return true; 246 } 247 248 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)249 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 250 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { 251 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); 252 } 253 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyRingId_)) { 254 com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyRingId_); 255 } 256 if (keyRing_ != null) { 257 output.writeMessage(3, getKeyRing()); 258 } 259 getUnknownFields().writeTo(output); 260 } 261 262 @java.lang.Override getSerializedSize()263 public int getSerializedSize() { 264 int size = memoizedSize; 265 if (size != -1) return size; 266 267 size = 0; 268 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { 269 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); 270 } 271 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(keyRingId_)) { 272 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyRingId_); 273 } 274 if (keyRing_ != null) { 275 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getKeyRing()); 276 } 277 size += getUnknownFields().getSerializedSize(); 278 memoizedSize = size; 279 return size; 280 } 281 282 @java.lang.Override equals(final java.lang.Object obj)283 public boolean equals(final java.lang.Object obj) { 284 if (obj == this) { 285 return true; 286 } 287 if (!(obj instanceof com.google.cloud.kms.v1.CreateKeyRingRequest)) { 288 return super.equals(obj); 289 } 290 com.google.cloud.kms.v1.CreateKeyRingRequest other = 291 (com.google.cloud.kms.v1.CreateKeyRingRequest) obj; 292 293 if (!getParent().equals(other.getParent())) return false; 294 if (!getKeyRingId().equals(other.getKeyRingId())) return false; 295 if (hasKeyRing() != other.hasKeyRing()) return false; 296 if (hasKeyRing()) { 297 if (!getKeyRing().equals(other.getKeyRing())) return false; 298 } 299 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 300 return true; 301 } 302 303 @java.lang.Override hashCode()304 public int hashCode() { 305 if (memoizedHashCode != 0) { 306 return memoizedHashCode; 307 } 308 int hash = 41; 309 hash = (19 * hash) + getDescriptor().hashCode(); 310 hash = (37 * hash) + PARENT_FIELD_NUMBER; 311 hash = (53 * hash) + getParent().hashCode(); 312 hash = (37 * hash) + KEY_RING_ID_FIELD_NUMBER; 313 hash = (53 * hash) + getKeyRingId().hashCode(); 314 if (hasKeyRing()) { 315 hash = (37 * hash) + KEY_RING_FIELD_NUMBER; 316 hash = (53 * hash) + getKeyRing().hashCode(); 317 } 318 hash = (29 * hash) + getUnknownFields().hashCode(); 319 memoizedHashCode = hash; 320 return hash; 321 } 322 parseFrom(java.nio.ByteBuffer data)323 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(java.nio.ByteBuffer data) 324 throws com.google.protobuf.InvalidProtocolBufferException { 325 return PARSER.parseFrom(data); 326 } 327 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)328 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 329 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 330 throws com.google.protobuf.InvalidProtocolBufferException { 331 return PARSER.parseFrom(data, extensionRegistry); 332 } 333 parseFrom( com.google.protobuf.ByteString data)334 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 335 com.google.protobuf.ByteString data) 336 throws com.google.protobuf.InvalidProtocolBufferException { 337 return PARSER.parseFrom(data); 338 } 339 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)340 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 341 com.google.protobuf.ByteString data, 342 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 343 throws com.google.protobuf.InvalidProtocolBufferException { 344 return PARSER.parseFrom(data, extensionRegistry); 345 } 346 parseFrom(byte[] data)347 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(byte[] data) 348 throws com.google.protobuf.InvalidProtocolBufferException { 349 return PARSER.parseFrom(data); 350 } 351 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)352 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 353 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 354 throws com.google.protobuf.InvalidProtocolBufferException { 355 return PARSER.parseFrom(data, extensionRegistry); 356 } 357 parseFrom(java.io.InputStream input)358 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(java.io.InputStream input) 359 throws java.io.IOException { 360 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 361 } 362 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)363 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 364 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 365 throws java.io.IOException { 366 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 367 PARSER, input, extensionRegistry); 368 } 369 parseDelimitedFrom( java.io.InputStream input)370 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseDelimitedFrom( 371 java.io.InputStream input) throws java.io.IOException { 372 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 373 } 374 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)375 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseDelimitedFrom( 376 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 377 throws java.io.IOException { 378 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 379 PARSER, input, extensionRegistry); 380 } 381 parseFrom( com.google.protobuf.CodedInputStream input)382 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 383 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 384 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 385 } 386 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)387 public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom( 388 com.google.protobuf.CodedInputStream input, 389 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 390 throws java.io.IOException { 391 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 392 PARSER, input, extensionRegistry); 393 } 394 395 @java.lang.Override newBuilderForType()396 public Builder newBuilderForType() { 397 return newBuilder(); 398 } 399 newBuilder()400 public static Builder newBuilder() { 401 return DEFAULT_INSTANCE.toBuilder(); 402 } 403 newBuilder(com.google.cloud.kms.v1.CreateKeyRingRequest prototype)404 public static Builder newBuilder(com.google.cloud.kms.v1.CreateKeyRingRequest prototype) { 405 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 406 } 407 408 @java.lang.Override toBuilder()409 public Builder toBuilder() { 410 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 411 } 412 413 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)414 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 415 Builder builder = new Builder(parent); 416 return builder; 417 } 418 /** 419 * 420 * 421 * <pre> 422 * Request message for 423 * [KeyManagementService.CreateKeyRing][google.cloud.kms.v1.KeyManagementService.CreateKeyRing]. 424 * </pre> 425 * 426 * Protobuf type {@code google.cloud.kms.v1.CreateKeyRingRequest} 427 */ 428 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 429 implements 430 // @@protoc_insertion_point(builder_implements:google.cloud.kms.v1.CreateKeyRingRequest) 431 com.google.cloud.kms.v1.CreateKeyRingRequestOrBuilder { getDescriptor()432 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 433 return com.google.cloud.kms.v1.KmsProto 434 .internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor; 435 } 436 437 @java.lang.Override 438 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()439 internalGetFieldAccessorTable() { 440 return com.google.cloud.kms.v1.KmsProto 441 .internal_static_google_cloud_kms_v1_CreateKeyRingRequest_fieldAccessorTable 442 .ensureFieldAccessorsInitialized( 443 com.google.cloud.kms.v1.CreateKeyRingRequest.class, 444 com.google.cloud.kms.v1.CreateKeyRingRequest.Builder.class); 445 } 446 447 // Construct using com.google.cloud.kms.v1.CreateKeyRingRequest.newBuilder() Builder()448 private Builder() {} 449 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)450 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 451 super(parent); 452 } 453 454 @java.lang.Override clear()455 public Builder clear() { 456 super.clear(); 457 bitField0_ = 0; 458 parent_ = ""; 459 keyRingId_ = ""; 460 keyRing_ = null; 461 if (keyRingBuilder_ != null) { 462 keyRingBuilder_.dispose(); 463 keyRingBuilder_ = null; 464 } 465 return this; 466 } 467 468 @java.lang.Override getDescriptorForType()469 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 470 return com.google.cloud.kms.v1.KmsProto 471 .internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor; 472 } 473 474 @java.lang.Override getDefaultInstanceForType()475 public com.google.cloud.kms.v1.CreateKeyRingRequest getDefaultInstanceForType() { 476 return com.google.cloud.kms.v1.CreateKeyRingRequest.getDefaultInstance(); 477 } 478 479 @java.lang.Override build()480 public com.google.cloud.kms.v1.CreateKeyRingRequest build() { 481 com.google.cloud.kms.v1.CreateKeyRingRequest result = buildPartial(); 482 if (!result.isInitialized()) { 483 throw newUninitializedMessageException(result); 484 } 485 return result; 486 } 487 488 @java.lang.Override buildPartial()489 public com.google.cloud.kms.v1.CreateKeyRingRequest buildPartial() { 490 com.google.cloud.kms.v1.CreateKeyRingRequest result = 491 new com.google.cloud.kms.v1.CreateKeyRingRequest(this); 492 if (bitField0_ != 0) { 493 buildPartial0(result); 494 } 495 onBuilt(); 496 return result; 497 } 498 buildPartial0(com.google.cloud.kms.v1.CreateKeyRingRequest result)499 private void buildPartial0(com.google.cloud.kms.v1.CreateKeyRingRequest result) { 500 int from_bitField0_ = bitField0_; 501 if (((from_bitField0_ & 0x00000001) != 0)) { 502 result.parent_ = parent_; 503 } 504 if (((from_bitField0_ & 0x00000002) != 0)) { 505 result.keyRingId_ = keyRingId_; 506 } 507 if (((from_bitField0_ & 0x00000004) != 0)) { 508 result.keyRing_ = keyRingBuilder_ == null ? keyRing_ : keyRingBuilder_.build(); 509 } 510 } 511 512 @java.lang.Override clone()513 public Builder clone() { 514 return super.clone(); 515 } 516 517 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)518 public Builder setField( 519 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 520 return super.setField(field, value); 521 } 522 523 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)524 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 525 return super.clearField(field); 526 } 527 528 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)529 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 530 return super.clearOneof(oneof); 531 } 532 533 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)534 public Builder setRepeatedField( 535 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 536 return super.setRepeatedField(field, index, value); 537 } 538 539 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)540 public Builder addRepeatedField( 541 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 542 return super.addRepeatedField(field, value); 543 } 544 545 @java.lang.Override mergeFrom(com.google.protobuf.Message other)546 public Builder mergeFrom(com.google.protobuf.Message other) { 547 if (other instanceof com.google.cloud.kms.v1.CreateKeyRingRequest) { 548 return mergeFrom((com.google.cloud.kms.v1.CreateKeyRingRequest) other); 549 } else { 550 super.mergeFrom(other); 551 return this; 552 } 553 } 554 mergeFrom(com.google.cloud.kms.v1.CreateKeyRingRequest other)555 public Builder mergeFrom(com.google.cloud.kms.v1.CreateKeyRingRequest other) { 556 if (other == com.google.cloud.kms.v1.CreateKeyRingRequest.getDefaultInstance()) return this; 557 if (!other.getParent().isEmpty()) { 558 parent_ = other.parent_; 559 bitField0_ |= 0x00000001; 560 onChanged(); 561 } 562 if (!other.getKeyRingId().isEmpty()) { 563 keyRingId_ = other.keyRingId_; 564 bitField0_ |= 0x00000002; 565 onChanged(); 566 } 567 if (other.hasKeyRing()) { 568 mergeKeyRing(other.getKeyRing()); 569 } 570 this.mergeUnknownFields(other.getUnknownFields()); 571 onChanged(); 572 return this; 573 } 574 575 @java.lang.Override isInitialized()576 public final boolean isInitialized() { 577 return true; 578 } 579 580 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)581 public Builder mergeFrom( 582 com.google.protobuf.CodedInputStream input, 583 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 584 throws java.io.IOException { 585 if (extensionRegistry == null) { 586 throw new java.lang.NullPointerException(); 587 } 588 try { 589 boolean done = false; 590 while (!done) { 591 int tag = input.readTag(); 592 switch (tag) { 593 case 0: 594 done = true; 595 break; 596 case 10: 597 { 598 parent_ = input.readStringRequireUtf8(); 599 bitField0_ |= 0x00000001; 600 break; 601 } // case 10 602 case 18: 603 { 604 keyRingId_ = input.readStringRequireUtf8(); 605 bitField0_ |= 0x00000002; 606 break; 607 } // case 18 608 case 26: 609 { 610 input.readMessage(getKeyRingFieldBuilder().getBuilder(), extensionRegistry); 611 bitField0_ |= 0x00000004; 612 break; 613 } // case 26 614 default: 615 { 616 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 617 done = true; // was an endgroup tag 618 } 619 break; 620 } // default: 621 } // switch (tag) 622 } // while (!done) 623 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 624 throw e.unwrapIOException(); 625 } finally { 626 onChanged(); 627 } // finally 628 return this; 629 } 630 631 private int bitField0_; 632 633 private java.lang.Object parent_ = ""; 634 /** 635 * 636 * 637 * <pre> 638 * Required. The resource name of the location associated with the 639 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 640 * `projects/*/locations/*`. 641 * </pre> 642 * 643 * <code> 644 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 645 * </code> 646 * 647 * @return The parent. 648 */ getParent()649 public java.lang.String getParent() { 650 java.lang.Object ref = parent_; 651 if (!(ref instanceof java.lang.String)) { 652 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 653 java.lang.String s = bs.toStringUtf8(); 654 parent_ = s; 655 return s; 656 } else { 657 return (java.lang.String) ref; 658 } 659 } 660 /** 661 * 662 * 663 * <pre> 664 * Required. The resource name of the location associated with the 665 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 666 * `projects/*/locations/*`. 667 * </pre> 668 * 669 * <code> 670 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 671 * </code> 672 * 673 * @return The bytes for parent. 674 */ getParentBytes()675 public com.google.protobuf.ByteString getParentBytes() { 676 java.lang.Object ref = parent_; 677 if (ref instanceof String) { 678 com.google.protobuf.ByteString b = 679 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 680 parent_ = b; 681 return b; 682 } else { 683 return (com.google.protobuf.ByteString) ref; 684 } 685 } 686 /** 687 * 688 * 689 * <pre> 690 * Required. The resource name of the location associated with the 691 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 692 * `projects/*/locations/*`. 693 * </pre> 694 * 695 * <code> 696 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 697 * </code> 698 * 699 * @param value The parent to set. 700 * @return This builder for chaining. 701 */ setParent(java.lang.String value)702 public Builder setParent(java.lang.String value) { 703 if (value == null) { 704 throw new NullPointerException(); 705 } 706 parent_ = value; 707 bitField0_ |= 0x00000001; 708 onChanged(); 709 return this; 710 } 711 /** 712 * 713 * 714 * <pre> 715 * Required. The resource name of the location associated with the 716 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 717 * `projects/*/locations/*`. 718 * </pre> 719 * 720 * <code> 721 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 722 * </code> 723 * 724 * @return This builder for chaining. 725 */ clearParent()726 public Builder clearParent() { 727 parent_ = getDefaultInstance().getParent(); 728 bitField0_ = (bitField0_ & ~0x00000001); 729 onChanged(); 730 return this; 731 } 732 /** 733 * 734 * 735 * <pre> 736 * Required. The resource name of the location associated with the 737 * [KeyRings][google.cloud.kms.v1.KeyRing], in the format 738 * `projects/*/locations/*`. 739 * </pre> 740 * 741 * <code> 742 * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } 743 * </code> 744 * 745 * @param value The bytes for parent to set. 746 * @return This builder for chaining. 747 */ setParentBytes(com.google.protobuf.ByteString value)748 public Builder setParentBytes(com.google.protobuf.ByteString value) { 749 if (value == null) { 750 throw new NullPointerException(); 751 } 752 checkByteStringIsUtf8(value); 753 parent_ = value; 754 bitField0_ |= 0x00000001; 755 onChanged(); 756 return this; 757 } 758 759 private java.lang.Object keyRingId_ = ""; 760 /** 761 * 762 * 763 * <pre> 764 * Required. It must be unique within a location and match the regular 765 * expression `[a-zA-Z0-9_-]{1,63}` 766 * </pre> 767 * 768 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 769 * 770 * @return The keyRingId. 771 */ getKeyRingId()772 public java.lang.String getKeyRingId() { 773 java.lang.Object ref = keyRingId_; 774 if (!(ref instanceof java.lang.String)) { 775 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 776 java.lang.String s = bs.toStringUtf8(); 777 keyRingId_ = s; 778 return s; 779 } else { 780 return (java.lang.String) ref; 781 } 782 } 783 /** 784 * 785 * 786 * <pre> 787 * Required. It must be unique within a location and match the regular 788 * expression `[a-zA-Z0-9_-]{1,63}` 789 * </pre> 790 * 791 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 792 * 793 * @return The bytes for keyRingId. 794 */ getKeyRingIdBytes()795 public com.google.protobuf.ByteString getKeyRingIdBytes() { 796 java.lang.Object ref = keyRingId_; 797 if (ref instanceof String) { 798 com.google.protobuf.ByteString b = 799 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 800 keyRingId_ = b; 801 return b; 802 } else { 803 return (com.google.protobuf.ByteString) ref; 804 } 805 } 806 /** 807 * 808 * 809 * <pre> 810 * Required. It must be unique within a location and match the regular 811 * expression `[a-zA-Z0-9_-]{1,63}` 812 * </pre> 813 * 814 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 815 * 816 * @param value The keyRingId to set. 817 * @return This builder for chaining. 818 */ setKeyRingId(java.lang.String value)819 public Builder setKeyRingId(java.lang.String value) { 820 if (value == null) { 821 throw new NullPointerException(); 822 } 823 keyRingId_ = value; 824 bitField0_ |= 0x00000002; 825 onChanged(); 826 return this; 827 } 828 /** 829 * 830 * 831 * <pre> 832 * Required. It must be unique within a location and match the regular 833 * expression `[a-zA-Z0-9_-]{1,63}` 834 * </pre> 835 * 836 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 837 * 838 * @return This builder for chaining. 839 */ clearKeyRingId()840 public Builder clearKeyRingId() { 841 keyRingId_ = getDefaultInstance().getKeyRingId(); 842 bitField0_ = (bitField0_ & ~0x00000002); 843 onChanged(); 844 return this; 845 } 846 /** 847 * 848 * 849 * <pre> 850 * Required. It must be unique within a location and match the regular 851 * expression `[a-zA-Z0-9_-]{1,63}` 852 * </pre> 853 * 854 * <code>string key_ring_id = 2 [(.google.api.field_behavior) = REQUIRED];</code> 855 * 856 * @param value The bytes for keyRingId to set. 857 * @return This builder for chaining. 858 */ setKeyRingIdBytes(com.google.protobuf.ByteString value)859 public Builder setKeyRingIdBytes(com.google.protobuf.ByteString value) { 860 if (value == null) { 861 throw new NullPointerException(); 862 } 863 checkByteStringIsUtf8(value); 864 keyRingId_ = value; 865 bitField0_ |= 0x00000002; 866 onChanged(); 867 return this; 868 } 869 870 private com.google.cloud.kms.v1.KeyRing keyRing_; 871 private com.google.protobuf.SingleFieldBuilderV3< 872 com.google.cloud.kms.v1.KeyRing, 873 com.google.cloud.kms.v1.KeyRing.Builder, 874 com.google.cloud.kms.v1.KeyRingOrBuilder> 875 keyRingBuilder_; 876 /** 877 * 878 * 879 * <pre> 880 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 881 * values. 882 * </pre> 883 * 884 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 885 * </code> 886 * 887 * @return Whether the keyRing field is set. 888 */ hasKeyRing()889 public boolean hasKeyRing() { 890 return ((bitField0_ & 0x00000004) != 0); 891 } 892 /** 893 * 894 * 895 * <pre> 896 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 897 * values. 898 * </pre> 899 * 900 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 901 * </code> 902 * 903 * @return The keyRing. 904 */ getKeyRing()905 public com.google.cloud.kms.v1.KeyRing getKeyRing() { 906 if (keyRingBuilder_ == null) { 907 return keyRing_ == null ? com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_; 908 } else { 909 return keyRingBuilder_.getMessage(); 910 } 911 } 912 /** 913 * 914 * 915 * <pre> 916 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 917 * values. 918 * </pre> 919 * 920 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 921 * </code> 922 */ setKeyRing(com.google.cloud.kms.v1.KeyRing value)923 public Builder setKeyRing(com.google.cloud.kms.v1.KeyRing value) { 924 if (keyRingBuilder_ == null) { 925 if (value == null) { 926 throw new NullPointerException(); 927 } 928 keyRing_ = value; 929 } else { 930 keyRingBuilder_.setMessage(value); 931 } 932 bitField0_ |= 0x00000004; 933 onChanged(); 934 return this; 935 } 936 /** 937 * 938 * 939 * <pre> 940 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 941 * values. 942 * </pre> 943 * 944 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 945 * </code> 946 */ setKeyRing(com.google.cloud.kms.v1.KeyRing.Builder builderForValue)947 public Builder setKeyRing(com.google.cloud.kms.v1.KeyRing.Builder builderForValue) { 948 if (keyRingBuilder_ == null) { 949 keyRing_ = builderForValue.build(); 950 } else { 951 keyRingBuilder_.setMessage(builderForValue.build()); 952 } 953 bitField0_ |= 0x00000004; 954 onChanged(); 955 return this; 956 } 957 /** 958 * 959 * 960 * <pre> 961 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 962 * values. 963 * </pre> 964 * 965 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 966 * </code> 967 */ mergeKeyRing(com.google.cloud.kms.v1.KeyRing value)968 public Builder mergeKeyRing(com.google.cloud.kms.v1.KeyRing value) { 969 if (keyRingBuilder_ == null) { 970 if (((bitField0_ & 0x00000004) != 0) 971 && keyRing_ != null 972 && keyRing_ != com.google.cloud.kms.v1.KeyRing.getDefaultInstance()) { 973 getKeyRingBuilder().mergeFrom(value); 974 } else { 975 keyRing_ = value; 976 } 977 } else { 978 keyRingBuilder_.mergeFrom(value); 979 } 980 bitField0_ |= 0x00000004; 981 onChanged(); 982 return this; 983 } 984 /** 985 * 986 * 987 * <pre> 988 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 989 * values. 990 * </pre> 991 * 992 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 993 * </code> 994 */ clearKeyRing()995 public Builder clearKeyRing() { 996 bitField0_ = (bitField0_ & ~0x00000004); 997 keyRing_ = null; 998 if (keyRingBuilder_ != null) { 999 keyRingBuilder_.dispose(); 1000 keyRingBuilder_ = null; 1001 } 1002 onChanged(); 1003 return this; 1004 } 1005 /** 1006 * 1007 * 1008 * <pre> 1009 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 1010 * values. 1011 * </pre> 1012 * 1013 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 1014 * </code> 1015 */ getKeyRingBuilder()1016 public com.google.cloud.kms.v1.KeyRing.Builder getKeyRingBuilder() { 1017 bitField0_ |= 0x00000004; 1018 onChanged(); 1019 return getKeyRingFieldBuilder().getBuilder(); 1020 } 1021 /** 1022 * 1023 * 1024 * <pre> 1025 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 1026 * values. 1027 * </pre> 1028 * 1029 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 1030 * </code> 1031 */ getKeyRingOrBuilder()1032 public com.google.cloud.kms.v1.KeyRingOrBuilder getKeyRingOrBuilder() { 1033 if (keyRingBuilder_ != null) { 1034 return keyRingBuilder_.getMessageOrBuilder(); 1035 } else { 1036 return keyRing_ == null ? com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_; 1037 } 1038 } 1039 /** 1040 * 1041 * 1042 * <pre> 1043 * Required. A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field 1044 * values. 1045 * </pre> 1046 * 1047 * <code>.google.cloud.kms.v1.KeyRing key_ring = 3 [(.google.api.field_behavior) = REQUIRED]; 1048 * </code> 1049 */ 1050 private com.google.protobuf.SingleFieldBuilderV3< 1051 com.google.cloud.kms.v1.KeyRing, 1052 com.google.cloud.kms.v1.KeyRing.Builder, 1053 com.google.cloud.kms.v1.KeyRingOrBuilder> getKeyRingFieldBuilder()1054 getKeyRingFieldBuilder() { 1055 if (keyRingBuilder_ == null) { 1056 keyRingBuilder_ = 1057 new com.google.protobuf.SingleFieldBuilderV3< 1058 com.google.cloud.kms.v1.KeyRing, 1059 com.google.cloud.kms.v1.KeyRing.Builder, 1060 com.google.cloud.kms.v1.KeyRingOrBuilder>( 1061 getKeyRing(), getParentForChildren(), isClean()); 1062 keyRing_ = null; 1063 } 1064 return keyRingBuilder_; 1065 } 1066 1067 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)1068 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 1069 return super.setUnknownFields(unknownFields); 1070 } 1071 1072 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)1073 public final Builder mergeUnknownFields( 1074 final com.google.protobuf.UnknownFieldSet unknownFields) { 1075 return super.mergeUnknownFields(unknownFields); 1076 } 1077 1078 // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.CreateKeyRingRequest) 1079 } 1080 1081 // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.CreateKeyRingRequest) 1082 private static final com.google.cloud.kms.v1.CreateKeyRingRequest DEFAULT_INSTANCE; 1083 1084 static { 1085 DEFAULT_INSTANCE = new com.google.cloud.kms.v1.CreateKeyRingRequest(); 1086 } 1087 getDefaultInstance()1088 public static com.google.cloud.kms.v1.CreateKeyRingRequest getDefaultInstance() { 1089 return DEFAULT_INSTANCE; 1090 } 1091 1092 private static final com.google.protobuf.Parser<CreateKeyRingRequest> PARSER = 1093 new com.google.protobuf.AbstractParser<CreateKeyRingRequest>() { 1094 @java.lang.Override 1095 public CreateKeyRingRequest parsePartialFrom( 1096 com.google.protobuf.CodedInputStream input, 1097 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1098 throws com.google.protobuf.InvalidProtocolBufferException { 1099 Builder builder = newBuilder(); 1100 try { 1101 builder.mergeFrom(input, extensionRegistry); 1102 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1103 throw e.setUnfinishedMessage(builder.buildPartial()); 1104 } catch (com.google.protobuf.UninitializedMessageException e) { 1105 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 1106 } catch (java.io.IOException e) { 1107 throw new com.google.protobuf.InvalidProtocolBufferException(e) 1108 .setUnfinishedMessage(builder.buildPartial()); 1109 } 1110 return builder.buildPartial(); 1111 } 1112 }; 1113 parser()1114 public static com.google.protobuf.Parser<CreateKeyRingRequest> parser() { 1115 return PARSER; 1116 } 1117 1118 @java.lang.Override getParserForType()1119 public com.google.protobuf.Parser<CreateKeyRingRequest> getParserForType() { 1120 return PARSER; 1121 } 1122 1123 @java.lang.Override getDefaultInstanceForType()1124 public com.google.cloud.kms.v1.CreateKeyRingRequest getDefaultInstanceForType() { 1125 return DEFAULT_INSTANCE; 1126 } 1127 } 1128