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/secretmanager/v1/resources.proto 18 19 package com.google.cloud.secretmanager.v1; 20 21 /** 22 * 23 * 24 * <pre> 25 * A [Secret][google.cloud.secretmanager.v1.Secret] is a logical secret whose 26 * value and versions can be accessed. 27 * A [Secret][google.cloud.secretmanager.v1.Secret] is made up of zero or more 28 * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] that represent 29 * the secret data. 30 * </pre> 31 * 32 * Protobuf type {@code google.cloud.secretmanager.v1.Secret} 33 */ 34 public final class Secret extends com.google.protobuf.GeneratedMessageV3 35 implements 36 // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.Secret) 37 SecretOrBuilder { 38 private static final long serialVersionUID = 0L; 39 // Use Secret.newBuilder() to construct. Secret(com.google.protobuf.GeneratedMessageV3.Builder<?> builder)40 private Secret(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { 41 super(builder); 42 } 43 Secret()44 private Secret() { 45 name_ = ""; 46 topics_ = java.util.Collections.emptyList(); 47 etag_ = ""; 48 } 49 50 @java.lang.Override 51 @SuppressWarnings({"unused"}) newInstance(UnusedPrivateParameter unused)52 protected java.lang.Object newInstance(UnusedPrivateParameter unused) { 53 return new Secret(); 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.secretmanager.v1.ResourcesProto 63 .internal_static_google_cloud_secretmanager_v1_Secret_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 case 11: 73 return internalGetVersionAliases(); 74 case 13: 75 return internalGetAnnotations(); 76 default: 77 throw new RuntimeException("Invalid map field number: " + number); 78 } 79 } 80 81 @java.lang.Override 82 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()83 internalGetFieldAccessorTable() { 84 return com.google.cloud.secretmanager.v1.ResourcesProto 85 .internal_static_google_cloud_secretmanager_v1_Secret_fieldAccessorTable 86 .ensureFieldAccessorsInitialized( 87 com.google.cloud.secretmanager.v1.Secret.class, 88 com.google.cloud.secretmanager.v1.Secret.Builder.class); 89 } 90 91 private int expirationCase_ = 0; 92 private java.lang.Object expiration_; 93 94 public enum ExpirationCase 95 implements 96 com.google.protobuf.Internal.EnumLite, 97 com.google.protobuf.AbstractMessage.InternalOneOfEnum { 98 EXPIRE_TIME(6), 99 TTL(7), 100 EXPIRATION_NOT_SET(0); 101 private final int value; 102 ExpirationCase(int value)103 private ExpirationCase(int value) { 104 this.value = value; 105 } 106 /** 107 * @param value The number of the enum to look for. 108 * @return The enum associated with the given number. 109 * @deprecated Use {@link #forNumber(int)} instead. 110 */ 111 @java.lang.Deprecated valueOf(int value)112 public static ExpirationCase valueOf(int value) { 113 return forNumber(value); 114 } 115 forNumber(int value)116 public static ExpirationCase forNumber(int value) { 117 switch (value) { 118 case 6: 119 return EXPIRE_TIME; 120 case 7: 121 return TTL; 122 case 0: 123 return EXPIRATION_NOT_SET; 124 default: 125 return null; 126 } 127 } 128 getNumber()129 public int getNumber() { 130 return this.value; 131 } 132 }; 133 getExpirationCase()134 public ExpirationCase getExpirationCase() { 135 return ExpirationCase.forNumber(expirationCase_); 136 } 137 138 public static final int NAME_FIELD_NUMBER = 1; 139 140 @SuppressWarnings("serial") 141 private volatile java.lang.Object name_ = ""; 142 /** 143 * 144 * 145 * <pre> 146 * Output only. The resource name of the 147 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 148 * `projects/*/secrets/*`. 149 * </pre> 150 * 151 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 152 * 153 * @return The name. 154 */ 155 @java.lang.Override getName()156 public java.lang.String getName() { 157 java.lang.Object ref = name_; 158 if (ref instanceof java.lang.String) { 159 return (java.lang.String) ref; 160 } else { 161 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 162 java.lang.String s = bs.toStringUtf8(); 163 name_ = s; 164 return s; 165 } 166 } 167 /** 168 * 169 * 170 * <pre> 171 * Output only. The resource name of the 172 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 173 * `projects/*/secrets/*`. 174 * </pre> 175 * 176 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 177 * 178 * @return The bytes for name. 179 */ 180 @java.lang.Override getNameBytes()181 public com.google.protobuf.ByteString getNameBytes() { 182 java.lang.Object ref = name_; 183 if (ref instanceof java.lang.String) { 184 com.google.protobuf.ByteString b = 185 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 186 name_ = b; 187 return b; 188 } else { 189 return (com.google.protobuf.ByteString) ref; 190 } 191 } 192 193 public static final int REPLICATION_FIELD_NUMBER = 2; 194 private com.google.cloud.secretmanager.v1.Replication replication_; 195 /** 196 * 197 * 198 * <pre> 199 * Required. Immutable. The replication policy of the secret data attached to 200 * the [Secret][google.cloud.secretmanager.v1.Secret]. 201 * The replication policy cannot be changed after the Secret has been created. 202 * </pre> 203 * 204 * <code> 205 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 206 * </code> 207 * 208 * @return Whether the replication field is set. 209 */ 210 @java.lang.Override hasReplication()211 public boolean hasReplication() { 212 return replication_ != null; 213 } 214 /** 215 * 216 * 217 * <pre> 218 * Required. Immutable. The replication policy of the secret data attached to 219 * the [Secret][google.cloud.secretmanager.v1.Secret]. 220 * The replication policy cannot be changed after the Secret has been created. 221 * </pre> 222 * 223 * <code> 224 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 225 * </code> 226 * 227 * @return The replication. 228 */ 229 @java.lang.Override getReplication()230 public com.google.cloud.secretmanager.v1.Replication getReplication() { 231 return replication_ == null 232 ? com.google.cloud.secretmanager.v1.Replication.getDefaultInstance() 233 : replication_; 234 } 235 /** 236 * 237 * 238 * <pre> 239 * Required. Immutable. The replication policy of the secret data attached to 240 * the [Secret][google.cloud.secretmanager.v1.Secret]. 241 * The replication policy cannot be changed after the Secret has been created. 242 * </pre> 243 * 244 * <code> 245 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 246 * </code> 247 */ 248 @java.lang.Override getReplicationOrBuilder()249 public com.google.cloud.secretmanager.v1.ReplicationOrBuilder getReplicationOrBuilder() { 250 return replication_ == null 251 ? com.google.cloud.secretmanager.v1.Replication.getDefaultInstance() 252 : replication_; 253 } 254 255 public static final int CREATE_TIME_FIELD_NUMBER = 3; 256 private com.google.protobuf.Timestamp createTime_; 257 /** 258 * 259 * 260 * <pre> 261 * Output only. The time at which the 262 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 263 * </pre> 264 * 265 * <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 266 * </code> 267 * 268 * @return Whether the createTime field is set. 269 */ 270 @java.lang.Override hasCreateTime()271 public boolean hasCreateTime() { 272 return createTime_ != null; 273 } 274 /** 275 * 276 * 277 * <pre> 278 * Output only. The time at which the 279 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 280 * </pre> 281 * 282 * <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 283 * </code> 284 * 285 * @return The createTime. 286 */ 287 @java.lang.Override getCreateTime()288 public com.google.protobuf.Timestamp getCreateTime() { 289 return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; 290 } 291 /** 292 * 293 * 294 * <pre> 295 * Output only. The time at which the 296 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 297 * </pre> 298 * 299 * <code>.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 300 * </code> 301 */ 302 @java.lang.Override getCreateTimeOrBuilder()303 public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 304 return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; 305 } 306 307 public static final int LABELS_FIELD_NUMBER = 4; 308 309 private static final class LabelsDefaultEntryHolder { 310 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 311 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 312 com.google.cloud.secretmanager.v1.ResourcesProto 313 .internal_static_google_cloud_secretmanager_v1_Secret_LabelsEntry_descriptor, 314 com.google.protobuf.WireFormat.FieldType.STRING, 315 "", 316 com.google.protobuf.WireFormat.FieldType.STRING, 317 ""); 318 } 319 320 @SuppressWarnings("serial") 321 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 322 internalGetLabels()323 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 324 if (labels_ == null) { 325 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 326 } 327 return labels_; 328 } 329 getLabelsCount()330 public int getLabelsCount() { 331 return internalGetLabels().getMap().size(); 332 } 333 /** 334 * 335 * 336 * <pre> 337 * The labels assigned to this Secret. 338 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 339 * of maximum 128 bytes, and must conform to the following PCRE regular 340 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 341 * Label values must be between 0 and 63 characters long, have a UTF-8 342 * encoding of maximum 128 bytes, and must conform to the following PCRE 343 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 344 * No more than 64 labels can be assigned to a given resource. 345 * </pre> 346 * 347 * <code>map<string, string> labels = 4;</code> 348 */ 349 @java.lang.Override containsLabels(java.lang.String key)350 public boolean containsLabels(java.lang.String key) { 351 if (key == null) { 352 throw new NullPointerException("map key"); 353 } 354 return internalGetLabels().getMap().containsKey(key); 355 } 356 /** Use {@link #getLabelsMap()} instead. */ 357 @java.lang.Override 358 @java.lang.Deprecated getLabels()359 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 360 return getLabelsMap(); 361 } 362 /** 363 * 364 * 365 * <pre> 366 * The labels assigned to this Secret. 367 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 368 * of maximum 128 bytes, and must conform to the following PCRE regular 369 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 370 * Label values must be between 0 and 63 characters long, have a UTF-8 371 * encoding of maximum 128 bytes, and must conform to the following PCRE 372 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 373 * No more than 64 labels can be assigned to a given resource. 374 * </pre> 375 * 376 * <code>map<string, string> labels = 4;</code> 377 */ 378 @java.lang.Override getLabelsMap()379 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 380 return internalGetLabels().getMap(); 381 } 382 /** 383 * 384 * 385 * <pre> 386 * The labels assigned to this Secret. 387 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 388 * of maximum 128 bytes, and must conform to the following PCRE regular 389 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 390 * Label values must be between 0 and 63 characters long, have a UTF-8 391 * encoding of maximum 128 bytes, and must conform to the following PCRE 392 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 393 * No more than 64 labels can be assigned to a given resource. 394 * </pre> 395 * 396 * <code>map<string, string> labels = 4;</code> 397 */ 398 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)399 public /* nullable */ java.lang.String getLabelsOrDefault( 400 java.lang.String key, 401 /* nullable */ 402 java.lang.String defaultValue) { 403 if (key == null) { 404 throw new NullPointerException("map key"); 405 } 406 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 407 return map.containsKey(key) ? map.get(key) : defaultValue; 408 } 409 /** 410 * 411 * 412 * <pre> 413 * The labels assigned to this Secret. 414 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 415 * of maximum 128 bytes, and must conform to the following PCRE regular 416 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 417 * Label values must be between 0 and 63 characters long, have a UTF-8 418 * encoding of maximum 128 bytes, and must conform to the following PCRE 419 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 420 * No more than 64 labels can be assigned to a given resource. 421 * </pre> 422 * 423 * <code>map<string, string> labels = 4;</code> 424 */ 425 @java.lang.Override getLabelsOrThrow(java.lang.String key)426 public java.lang.String getLabelsOrThrow(java.lang.String key) { 427 if (key == null) { 428 throw new NullPointerException("map key"); 429 } 430 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 431 if (!map.containsKey(key)) { 432 throw new java.lang.IllegalArgumentException(); 433 } 434 return map.get(key); 435 } 436 437 public static final int TOPICS_FIELD_NUMBER = 5; 438 439 @SuppressWarnings("serial") 440 private java.util.List<com.google.cloud.secretmanager.v1.Topic> topics_; 441 /** 442 * 443 * 444 * <pre> 445 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 446 * when control plane operations are called on the secret or its versions. 447 * </pre> 448 * 449 * <code> 450 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 451 * </code> 452 */ 453 @java.lang.Override getTopicsList()454 public java.util.List<com.google.cloud.secretmanager.v1.Topic> getTopicsList() { 455 return topics_; 456 } 457 /** 458 * 459 * 460 * <pre> 461 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 462 * when control plane operations are called on the secret or its versions. 463 * </pre> 464 * 465 * <code> 466 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 467 * </code> 468 */ 469 @java.lang.Override 470 public java.util.List<? extends com.google.cloud.secretmanager.v1.TopicOrBuilder> getTopicsOrBuilderList()471 getTopicsOrBuilderList() { 472 return topics_; 473 } 474 /** 475 * 476 * 477 * <pre> 478 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 479 * when control plane operations are called on the secret or its versions. 480 * </pre> 481 * 482 * <code> 483 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 484 * </code> 485 */ 486 @java.lang.Override getTopicsCount()487 public int getTopicsCount() { 488 return topics_.size(); 489 } 490 /** 491 * 492 * 493 * <pre> 494 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 495 * when control plane operations are called on the secret or its versions. 496 * </pre> 497 * 498 * <code> 499 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 500 * </code> 501 */ 502 @java.lang.Override getTopics(int index)503 public com.google.cloud.secretmanager.v1.Topic getTopics(int index) { 504 return topics_.get(index); 505 } 506 /** 507 * 508 * 509 * <pre> 510 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 511 * when control plane operations are called on the secret or its versions. 512 * </pre> 513 * 514 * <code> 515 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 516 * </code> 517 */ 518 @java.lang.Override getTopicsOrBuilder(int index)519 public com.google.cloud.secretmanager.v1.TopicOrBuilder getTopicsOrBuilder(int index) { 520 return topics_.get(index); 521 } 522 523 public static final int EXPIRE_TIME_FIELD_NUMBER = 6; 524 /** 525 * 526 * 527 * <pre> 528 * Optional. Timestamp in UTC when the 529 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 530 * This is always provided on output, regardless of what was sent on input. 531 * </pre> 532 * 533 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 534 * </code> 535 * 536 * @return Whether the expireTime field is set. 537 */ 538 @java.lang.Override hasExpireTime()539 public boolean hasExpireTime() { 540 return expirationCase_ == 6; 541 } 542 /** 543 * 544 * 545 * <pre> 546 * Optional. Timestamp in UTC when the 547 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 548 * This is always provided on output, regardless of what was sent on input. 549 * </pre> 550 * 551 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 552 * </code> 553 * 554 * @return The expireTime. 555 */ 556 @java.lang.Override getExpireTime()557 public com.google.protobuf.Timestamp getExpireTime() { 558 if (expirationCase_ == 6) { 559 return (com.google.protobuf.Timestamp) expiration_; 560 } 561 return com.google.protobuf.Timestamp.getDefaultInstance(); 562 } 563 /** 564 * 565 * 566 * <pre> 567 * Optional. Timestamp in UTC when the 568 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 569 * This is always provided on output, regardless of what was sent on input. 570 * </pre> 571 * 572 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 573 * </code> 574 */ 575 @java.lang.Override getExpireTimeOrBuilder()576 public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { 577 if (expirationCase_ == 6) { 578 return (com.google.protobuf.Timestamp) expiration_; 579 } 580 return com.google.protobuf.Timestamp.getDefaultInstance(); 581 } 582 583 public static final int TTL_FIELD_NUMBER = 7; 584 /** 585 * 586 * 587 * <pre> 588 * Input only. The TTL for the 589 * [Secret][google.cloud.secretmanager.v1.Secret]. 590 * </pre> 591 * 592 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 593 * 594 * @return Whether the ttl field is set. 595 */ 596 @java.lang.Override hasTtl()597 public boolean hasTtl() { 598 return expirationCase_ == 7; 599 } 600 /** 601 * 602 * 603 * <pre> 604 * Input only. The TTL for the 605 * [Secret][google.cloud.secretmanager.v1.Secret]. 606 * </pre> 607 * 608 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 609 * 610 * @return The ttl. 611 */ 612 @java.lang.Override getTtl()613 public com.google.protobuf.Duration getTtl() { 614 if (expirationCase_ == 7) { 615 return (com.google.protobuf.Duration) expiration_; 616 } 617 return com.google.protobuf.Duration.getDefaultInstance(); 618 } 619 /** 620 * 621 * 622 * <pre> 623 * Input only. The TTL for the 624 * [Secret][google.cloud.secretmanager.v1.Secret]. 625 * </pre> 626 * 627 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 628 */ 629 @java.lang.Override getTtlOrBuilder()630 public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { 631 if (expirationCase_ == 7) { 632 return (com.google.protobuf.Duration) expiration_; 633 } 634 return com.google.protobuf.Duration.getDefaultInstance(); 635 } 636 637 public static final int ETAG_FIELD_NUMBER = 8; 638 639 @SuppressWarnings("serial") 640 private volatile java.lang.Object etag_ = ""; 641 /** 642 * 643 * 644 * <pre> 645 * Optional. Etag of the currently stored 646 * [Secret][google.cloud.secretmanager.v1.Secret]. 647 * </pre> 648 * 649 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 650 * 651 * @return The etag. 652 */ 653 @java.lang.Override getEtag()654 public java.lang.String getEtag() { 655 java.lang.Object ref = etag_; 656 if (ref instanceof java.lang.String) { 657 return (java.lang.String) ref; 658 } else { 659 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 660 java.lang.String s = bs.toStringUtf8(); 661 etag_ = s; 662 return s; 663 } 664 } 665 /** 666 * 667 * 668 * <pre> 669 * Optional. Etag of the currently stored 670 * [Secret][google.cloud.secretmanager.v1.Secret]. 671 * </pre> 672 * 673 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 674 * 675 * @return The bytes for etag. 676 */ 677 @java.lang.Override getEtagBytes()678 public com.google.protobuf.ByteString getEtagBytes() { 679 java.lang.Object ref = etag_; 680 if (ref instanceof java.lang.String) { 681 com.google.protobuf.ByteString b = 682 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 683 etag_ = b; 684 return b; 685 } else { 686 return (com.google.protobuf.ByteString) ref; 687 } 688 } 689 690 public static final int ROTATION_FIELD_NUMBER = 9; 691 private com.google.cloud.secretmanager.v1.Rotation rotation_; 692 /** 693 * 694 * 695 * <pre> 696 * Optional. Rotation policy attached to the 697 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 698 * no rotation policy. 699 * </pre> 700 * 701 * <code> 702 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 703 * </code> 704 * 705 * @return Whether the rotation field is set. 706 */ 707 @java.lang.Override hasRotation()708 public boolean hasRotation() { 709 return rotation_ != null; 710 } 711 /** 712 * 713 * 714 * <pre> 715 * Optional. Rotation policy attached to the 716 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 717 * no rotation policy. 718 * </pre> 719 * 720 * <code> 721 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 722 * </code> 723 * 724 * @return The rotation. 725 */ 726 @java.lang.Override getRotation()727 public com.google.cloud.secretmanager.v1.Rotation getRotation() { 728 return rotation_ == null 729 ? com.google.cloud.secretmanager.v1.Rotation.getDefaultInstance() 730 : rotation_; 731 } 732 /** 733 * 734 * 735 * <pre> 736 * Optional. Rotation policy attached to the 737 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 738 * no rotation policy. 739 * </pre> 740 * 741 * <code> 742 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 743 * </code> 744 */ 745 @java.lang.Override getRotationOrBuilder()746 public com.google.cloud.secretmanager.v1.RotationOrBuilder getRotationOrBuilder() { 747 return rotation_ == null 748 ? com.google.cloud.secretmanager.v1.Rotation.getDefaultInstance() 749 : rotation_; 750 } 751 752 public static final int VERSION_ALIASES_FIELD_NUMBER = 11; 753 754 private static final class VersionAliasesDefaultEntryHolder { 755 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.Long> defaultEntry = 756 com.google.protobuf.MapEntry.<java.lang.String, java.lang.Long>newDefaultInstance( 757 com.google.cloud.secretmanager.v1.ResourcesProto 758 .internal_static_google_cloud_secretmanager_v1_Secret_VersionAliasesEntry_descriptor, 759 com.google.protobuf.WireFormat.FieldType.STRING, 760 "", 761 com.google.protobuf.WireFormat.FieldType.INT64, 762 0L); 763 } 764 765 @SuppressWarnings("serial") 766 private com.google.protobuf.MapField<java.lang.String, java.lang.Long> versionAliases_; 767 768 private com.google.protobuf.MapField<java.lang.String, java.lang.Long> internalGetVersionAliases()769 internalGetVersionAliases() { 770 if (versionAliases_ == null) { 771 return com.google.protobuf.MapField.emptyMapField( 772 VersionAliasesDefaultEntryHolder.defaultEntry); 773 } 774 return versionAliases_; 775 } 776 getVersionAliasesCount()777 public int getVersionAliasesCount() { 778 return internalGetVersionAliases().getMap().size(); 779 } 780 /** 781 * 782 * 783 * <pre> 784 * Optional. Mapping from version alias to version name. 785 * A version alias is a string with a maximum length of 63 characters and can 786 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 787 * and underscore ('_') characters. An alias string must start with a 788 * letter and cannot be the string 'latest' or 'NEW'. 789 * No more than 50 aliases can be assigned to a given secret. 790 * Version-Alias pairs will be viewable via GetSecret and modifiable via 791 * UpdateSecret. At launch access by alias will only be supported on 792 * GetSecretVersion and AccessSecretVersion. 793 * </pre> 794 * 795 * <code>map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 796 * </code> 797 */ 798 @java.lang.Override containsVersionAliases(java.lang.String key)799 public boolean containsVersionAliases(java.lang.String key) { 800 if (key == null) { 801 throw new NullPointerException("map key"); 802 } 803 return internalGetVersionAliases().getMap().containsKey(key); 804 } 805 /** Use {@link #getVersionAliasesMap()} instead. */ 806 @java.lang.Override 807 @java.lang.Deprecated getVersionAliases()808 public java.util.Map<java.lang.String, java.lang.Long> getVersionAliases() { 809 return getVersionAliasesMap(); 810 } 811 /** 812 * 813 * 814 * <pre> 815 * Optional. Mapping from version alias to version name. 816 * A version alias is a string with a maximum length of 63 characters and can 817 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 818 * and underscore ('_') characters. An alias string must start with a 819 * letter and cannot be the string 'latest' or 'NEW'. 820 * No more than 50 aliases can be assigned to a given secret. 821 * Version-Alias pairs will be viewable via GetSecret and modifiable via 822 * UpdateSecret. At launch access by alias will only be supported on 823 * GetSecretVersion and AccessSecretVersion. 824 * </pre> 825 * 826 * <code>map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 827 * </code> 828 */ 829 @java.lang.Override getVersionAliasesMap()830 public java.util.Map<java.lang.String, java.lang.Long> getVersionAliasesMap() { 831 return internalGetVersionAliases().getMap(); 832 } 833 /** 834 * 835 * 836 * <pre> 837 * Optional. Mapping from version alias to version name. 838 * A version alias is a string with a maximum length of 63 characters and can 839 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 840 * and underscore ('_') characters. An alias string must start with a 841 * letter and cannot be the string 'latest' or 'NEW'. 842 * No more than 50 aliases can be assigned to a given secret. 843 * Version-Alias pairs will be viewable via GetSecret and modifiable via 844 * UpdateSecret. At launch access by alias will only be supported on 845 * GetSecretVersion and AccessSecretVersion. 846 * </pre> 847 * 848 * <code>map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 849 * </code> 850 */ 851 @java.lang.Override getVersionAliasesOrDefault(java.lang.String key, long defaultValue)852 public long getVersionAliasesOrDefault(java.lang.String key, long defaultValue) { 853 if (key == null) { 854 throw new NullPointerException("map key"); 855 } 856 java.util.Map<java.lang.String, java.lang.Long> map = internalGetVersionAliases().getMap(); 857 return map.containsKey(key) ? map.get(key) : defaultValue; 858 } 859 /** 860 * 861 * 862 * <pre> 863 * Optional. Mapping from version alias to version name. 864 * A version alias is a string with a maximum length of 63 characters and can 865 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 866 * and underscore ('_') characters. An alias string must start with a 867 * letter and cannot be the string 'latest' or 'NEW'. 868 * No more than 50 aliases can be assigned to a given secret. 869 * Version-Alias pairs will be viewable via GetSecret and modifiable via 870 * UpdateSecret. At launch access by alias will only be supported on 871 * GetSecretVersion and AccessSecretVersion. 872 * </pre> 873 * 874 * <code>map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 875 * </code> 876 */ 877 @java.lang.Override getVersionAliasesOrThrow(java.lang.String key)878 public long getVersionAliasesOrThrow(java.lang.String key) { 879 if (key == null) { 880 throw new NullPointerException("map key"); 881 } 882 java.util.Map<java.lang.String, java.lang.Long> map = internalGetVersionAliases().getMap(); 883 if (!map.containsKey(key)) { 884 throw new java.lang.IllegalArgumentException(); 885 } 886 return map.get(key); 887 } 888 889 public static final int ANNOTATIONS_FIELD_NUMBER = 13; 890 891 private static final class AnnotationsDefaultEntryHolder { 892 static final com.google.protobuf.MapEntry<java.lang.String, java.lang.String> defaultEntry = 893 com.google.protobuf.MapEntry.<java.lang.String, java.lang.String>newDefaultInstance( 894 com.google.cloud.secretmanager.v1.ResourcesProto 895 .internal_static_google_cloud_secretmanager_v1_Secret_AnnotationsEntry_descriptor, 896 com.google.protobuf.WireFormat.FieldType.STRING, 897 "", 898 com.google.protobuf.WireFormat.FieldType.STRING, 899 ""); 900 } 901 902 @SuppressWarnings("serial") 903 private com.google.protobuf.MapField<java.lang.String, java.lang.String> annotations_; 904 905 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetAnnotations()906 internalGetAnnotations() { 907 if (annotations_ == null) { 908 return com.google.protobuf.MapField.emptyMapField(AnnotationsDefaultEntryHolder.defaultEntry); 909 } 910 return annotations_; 911 } 912 getAnnotationsCount()913 public int getAnnotationsCount() { 914 return internalGetAnnotations().getMap().size(); 915 } 916 /** 917 * 918 * 919 * <pre> 920 * Optional. Custom metadata about the secret. 921 * Annotations are distinct from various forms of labels. 922 * Annotations exist to allow client tools to store their own state 923 * information without requiring a database. 924 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 925 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 926 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 927 * alphanumerics in between these symbols. 928 * The total size of annotation keys and values must be less than 16KiB. 929 * </pre> 930 * 931 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 932 * </code> 933 */ 934 @java.lang.Override containsAnnotations(java.lang.String key)935 public boolean containsAnnotations(java.lang.String key) { 936 if (key == null) { 937 throw new NullPointerException("map key"); 938 } 939 return internalGetAnnotations().getMap().containsKey(key); 940 } 941 /** Use {@link #getAnnotationsMap()} instead. */ 942 @java.lang.Override 943 @java.lang.Deprecated getAnnotations()944 public java.util.Map<java.lang.String, java.lang.String> getAnnotations() { 945 return getAnnotationsMap(); 946 } 947 /** 948 * 949 * 950 * <pre> 951 * Optional. Custom metadata about the secret. 952 * Annotations are distinct from various forms of labels. 953 * Annotations exist to allow client tools to store their own state 954 * information without requiring a database. 955 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 956 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 957 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 958 * alphanumerics in between these symbols. 959 * The total size of annotation keys and values must be less than 16KiB. 960 * </pre> 961 * 962 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 963 * </code> 964 */ 965 @java.lang.Override getAnnotationsMap()966 public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() { 967 return internalGetAnnotations().getMap(); 968 } 969 /** 970 * 971 * 972 * <pre> 973 * Optional. Custom metadata about the secret. 974 * Annotations are distinct from various forms of labels. 975 * Annotations exist to allow client tools to store their own state 976 * information without requiring a database. 977 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 978 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 979 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 980 * alphanumerics in between these symbols. 981 * The total size of annotation keys and values must be less than 16KiB. 982 * </pre> 983 * 984 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 985 * </code> 986 */ 987 @java.lang.Override getAnnotationsOrDefault( java.lang.String key, java.lang.String defaultValue)988 public /* nullable */ java.lang.String getAnnotationsOrDefault( 989 java.lang.String key, 990 /* nullable */ 991 java.lang.String defaultValue) { 992 if (key == null) { 993 throw new NullPointerException("map key"); 994 } 995 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 996 return map.containsKey(key) ? map.get(key) : defaultValue; 997 } 998 /** 999 * 1000 * 1001 * <pre> 1002 * Optional. Custom metadata about the secret. 1003 * Annotations are distinct from various forms of labels. 1004 * Annotations exist to allow client tools to store their own state 1005 * information without requiring a database. 1006 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 1007 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 1008 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 1009 * alphanumerics in between these symbols. 1010 * The total size of annotation keys and values must be less than 16KiB. 1011 * </pre> 1012 * 1013 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 1014 * </code> 1015 */ 1016 @java.lang.Override getAnnotationsOrThrow(java.lang.String key)1017 public java.lang.String getAnnotationsOrThrow(java.lang.String key) { 1018 if (key == null) { 1019 throw new NullPointerException("map key"); 1020 } 1021 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 1022 if (!map.containsKey(key)) { 1023 throw new java.lang.IllegalArgumentException(); 1024 } 1025 return map.get(key); 1026 } 1027 1028 private byte memoizedIsInitialized = -1; 1029 1030 @java.lang.Override isInitialized()1031 public final boolean isInitialized() { 1032 byte isInitialized = memoizedIsInitialized; 1033 if (isInitialized == 1) return true; 1034 if (isInitialized == 0) return false; 1035 1036 memoizedIsInitialized = 1; 1037 return true; 1038 } 1039 1040 @java.lang.Override writeTo(com.google.protobuf.CodedOutputStream output)1041 public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { 1042 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1043 com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 1044 } 1045 if (replication_ != null) { 1046 output.writeMessage(2, getReplication()); 1047 } 1048 if (createTime_ != null) { 1049 output.writeMessage(3, getCreateTime()); 1050 } 1051 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1052 output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); 1053 for (int i = 0; i < topics_.size(); i++) { 1054 output.writeMessage(5, topics_.get(i)); 1055 } 1056 if (expirationCase_ == 6) { 1057 output.writeMessage(6, (com.google.protobuf.Timestamp) expiration_); 1058 } 1059 if (expirationCase_ == 7) { 1060 output.writeMessage(7, (com.google.protobuf.Duration) expiration_); 1061 } 1062 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { 1063 com.google.protobuf.GeneratedMessageV3.writeString(output, 8, etag_); 1064 } 1065 if (rotation_ != null) { 1066 output.writeMessage(9, getRotation()); 1067 } 1068 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1069 output, internalGetVersionAliases(), VersionAliasesDefaultEntryHolder.defaultEntry, 11); 1070 com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( 1071 output, internalGetAnnotations(), AnnotationsDefaultEntryHolder.defaultEntry, 13); 1072 getUnknownFields().writeTo(output); 1073 } 1074 1075 @java.lang.Override getSerializedSize()1076 public int getSerializedSize() { 1077 int size = memoizedSize; 1078 if (size != -1) return size; 1079 1080 size = 0; 1081 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { 1082 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 1083 } 1084 if (replication_ != null) { 1085 size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReplication()); 1086 } 1087 if (createTime_ != null) { 1088 size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); 1089 } 1090 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 1091 internalGetLabels().getMap().entrySet()) { 1092 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 1093 LabelsDefaultEntryHolder.defaultEntry 1094 .newBuilderForType() 1095 .setKey(entry.getKey()) 1096 .setValue(entry.getValue()) 1097 .build(); 1098 size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); 1099 } 1100 for (int i = 0; i < topics_.size(); i++) { 1101 size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, topics_.get(i)); 1102 } 1103 if (expirationCase_ == 6) { 1104 size += 1105 com.google.protobuf.CodedOutputStream.computeMessageSize( 1106 6, (com.google.protobuf.Timestamp) expiration_); 1107 } 1108 if (expirationCase_ == 7) { 1109 size += 1110 com.google.protobuf.CodedOutputStream.computeMessageSize( 1111 7, (com.google.protobuf.Duration) expiration_); 1112 } 1113 if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(etag_)) { 1114 size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, etag_); 1115 } 1116 if (rotation_ != null) { 1117 size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getRotation()); 1118 } 1119 for (java.util.Map.Entry<java.lang.String, java.lang.Long> entry : 1120 internalGetVersionAliases().getMap().entrySet()) { 1121 com.google.protobuf.MapEntry<java.lang.String, java.lang.Long> versionAliases__ = 1122 VersionAliasesDefaultEntryHolder.defaultEntry 1123 .newBuilderForType() 1124 .setKey(entry.getKey()) 1125 .setValue(entry.getValue()) 1126 .build(); 1127 size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, versionAliases__); 1128 } 1129 for (java.util.Map.Entry<java.lang.String, java.lang.String> entry : 1130 internalGetAnnotations().getMap().entrySet()) { 1131 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> annotations__ = 1132 AnnotationsDefaultEntryHolder.defaultEntry 1133 .newBuilderForType() 1134 .setKey(entry.getKey()) 1135 .setValue(entry.getValue()) 1136 .build(); 1137 size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, annotations__); 1138 } 1139 size += getUnknownFields().getSerializedSize(); 1140 memoizedSize = size; 1141 return size; 1142 } 1143 1144 @java.lang.Override equals(final java.lang.Object obj)1145 public boolean equals(final java.lang.Object obj) { 1146 if (obj == this) { 1147 return true; 1148 } 1149 if (!(obj instanceof com.google.cloud.secretmanager.v1.Secret)) { 1150 return super.equals(obj); 1151 } 1152 com.google.cloud.secretmanager.v1.Secret other = (com.google.cloud.secretmanager.v1.Secret) obj; 1153 1154 if (!getName().equals(other.getName())) return false; 1155 if (hasReplication() != other.hasReplication()) return false; 1156 if (hasReplication()) { 1157 if (!getReplication().equals(other.getReplication())) return false; 1158 } 1159 if (hasCreateTime() != other.hasCreateTime()) return false; 1160 if (hasCreateTime()) { 1161 if (!getCreateTime().equals(other.getCreateTime())) return false; 1162 } 1163 if (!internalGetLabels().equals(other.internalGetLabels())) return false; 1164 if (!getTopicsList().equals(other.getTopicsList())) return false; 1165 if (!getEtag().equals(other.getEtag())) return false; 1166 if (hasRotation() != other.hasRotation()) return false; 1167 if (hasRotation()) { 1168 if (!getRotation().equals(other.getRotation())) return false; 1169 } 1170 if (!internalGetVersionAliases().equals(other.internalGetVersionAliases())) return false; 1171 if (!internalGetAnnotations().equals(other.internalGetAnnotations())) return false; 1172 if (!getExpirationCase().equals(other.getExpirationCase())) return false; 1173 switch (expirationCase_) { 1174 case 6: 1175 if (!getExpireTime().equals(other.getExpireTime())) return false; 1176 break; 1177 case 7: 1178 if (!getTtl().equals(other.getTtl())) return false; 1179 break; 1180 case 0: 1181 default: 1182 } 1183 if (!getUnknownFields().equals(other.getUnknownFields())) return false; 1184 return true; 1185 } 1186 1187 @java.lang.Override hashCode()1188 public int hashCode() { 1189 if (memoizedHashCode != 0) { 1190 return memoizedHashCode; 1191 } 1192 int hash = 41; 1193 hash = (19 * hash) + getDescriptor().hashCode(); 1194 hash = (37 * hash) + NAME_FIELD_NUMBER; 1195 hash = (53 * hash) + getName().hashCode(); 1196 if (hasReplication()) { 1197 hash = (37 * hash) + REPLICATION_FIELD_NUMBER; 1198 hash = (53 * hash) + getReplication().hashCode(); 1199 } 1200 if (hasCreateTime()) { 1201 hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; 1202 hash = (53 * hash) + getCreateTime().hashCode(); 1203 } 1204 if (!internalGetLabels().getMap().isEmpty()) { 1205 hash = (37 * hash) + LABELS_FIELD_NUMBER; 1206 hash = (53 * hash) + internalGetLabels().hashCode(); 1207 } 1208 if (getTopicsCount() > 0) { 1209 hash = (37 * hash) + TOPICS_FIELD_NUMBER; 1210 hash = (53 * hash) + getTopicsList().hashCode(); 1211 } 1212 hash = (37 * hash) + ETAG_FIELD_NUMBER; 1213 hash = (53 * hash) + getEtag().hashCode(); 1214 if (hasRotation()) { 1215 hash = (37 * hash) + ROTATION_FIELD_NUMBER; 1216 hash = (53 * hash) + getRotation().hashCode(); 1217 } 1218 if (!internalGetVersionAliases().getMap().isEmpty()) { 1219 hash = (37 * hash) + VERSION_ALIASES_FIELD_NUMBER; 1220 hash = (53 * hash) + internalGetVersionAliases().hashCode(); 1221 } 1222 if (!internalGetAnnotations().getMap().isEmpty()) { 1223 hash = (37 * hash) + ANNOTATIONS_FIELD_NUMBER; 1224 hash = (53 * hash) + internalGetAnnotations().hashCode(); 1225 } 1226 switch (expirationCase_) { 1227 case 6: 1228 hash = (37 * hash) + EXPIRE_TIME_FIELD_NUMBER; 1229 hash = (53 * hash) + getExpireTime().hashCode(); 1230 break; 1231 case 7: 1232 hash = (37 * hash) + TTL_FIELD_NUMBER; 1233 hash = (53 * hash) + getTtl().hashCode(); 1234 break; 1235 case 0: 1236 default: 1237 } 1238 hash = (29 * hash) + getUnknownFields().hashCode(); 1239 memoizedHashCode = hash; 1240 return hash; 1241 } 1242 parseFrom(java.nio.ByteBuffer data)1243 public static com.google.cloud.secretmanager.v1.Secret parseFrom(java.nio.ByteBuffer data) 1244 throws com.google.protobuf.InvalidProtocolBufferException { 1245 return PARSER.parseFrom(data); 1246 } 1247 parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1248 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1249 java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1250 throws com.google.protobuf.InvalidProtocolBufferException { 1251 return PARSER.parseFrom(data, extensionRegistry); 1252 } 1253 parseFrom( com.google.protobuf.ByteString data)1254 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1255 com.google.protobuf.ByteString data) 1256 throws com.google.protobuf.InvalidProtocolBufferException { 1257 return PARSER.parseFrom(data); 1258 } 1259 parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1260 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1261 com.google.protobuf.ByteString data, 1262 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1263 throws com.google.protobuf.InvalidProtocolBufferException { 1264 return PARSER.parseFrom(data, extensionRegistry); 1265 } 1266 parseFrom(byte[] data)1267 public static com.google.cloud.secretmanager.v1.Secret parseFrom(byte[] data) 1268 throws com.google.protobuf.InvalidProtocolBufferException { 1269 return PARSER.parseFrom(data); 1270 } 1271 parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1272 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1273 byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1274 throws com.google.protobuf.InvalidProtocolBufferException { 1275 return PARSER.parseFrom(data, extensionRegistry); 1276 } 1277 parseFrom(java.io.InputStream input)1278 public static com.google.cloud.secretmanager.v1.Secret parseFrom(java.io.InputStream input) 1279 throws java.io.IOException { 1280 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1281 } 1282 parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1283 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1284 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1285 throws java.io.IOException { 1286 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1287 PARSER, input, extensionRegistry); 1288 } 1289 parseDelimitedFrom( java.io.InputStream input)1290 public static com.google.cloud.secretmanager.v1.Secret parseDelimitedFrom( 1291 java.io.InputStream input) throws java.io.IOException { 1292 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); 1293 } 1294 parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1295 public static com.google.cloud.secretmanager.v1.Secret parseDelimitedFrom( 1296 java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1297 throws java.io.IOException { 1298 return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( 1299 PARSER, input, extensionRegistry); 1300 } 1301 parseFrom( com.google.protobuf.CodedInputStream input)1302 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1303 com.google.protobuf.CodedInputStream input) throws java.io.IOException { 1304 return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); 1305 } 1306 parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1307 public static com.google.cloud.secretmanager.v1.Secret parseFrom( 1308 com.google.protobuf.CodedInputStream input, 1309 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1310 throws java.io.IOException { 1311 return com.google.protobuf.GeneratedMessageV3.parseWithIOException( 1312 PARSER, input, extensionRegistry); 1313 } 1314 1315 @java.lang.Override newBuilderForType()1316 public Builder newBuilderForType() { 1317 return newBuilder(); 1318 } 1319 newBuilder()1320 public static Builder newBuilder() { 1321 return DEFAULT_INSTANCE.toBuilder(); 1322 } 1323 newBuilder(com.google.cloud.secretmanager.v1.Secret prototype)1324 public static Builder newBuilder(com.google.cloud.secretmanager.v1.Secret prototype) { 1325 return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 1326 } 1327 1328 @java.lang.Override toBuilder()1329 public Builder toBuilder() { 1330 return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); 1331 } 1332 1333 @java.lang.Override newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1334 protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1335 Builder builder = new Builder(parent); 1336 return builder; 1337 } 1338 /** 1339 * 1340 * 1341 * <pre> 1342 * A [Secret][google.cloud.secretmanager.v1.Secret] is a logical secret whose 1343 * value and versions can be accessed. 1344 * A [Secret][google.cloud.secretmanager.v1.Secret] is made up of zero or more 1345 * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] that represent 1346 * the secret data. 1347 * </pre> 1348 * 1349 * Protobuf type {@code google.cloud.secretmanager.v1.Secret} 1350 */ 1351 public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> 1352 implements 1353 // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.Secret) 1354 com.google.cloud.secretmanager.v1.SecretOrBuilder { getDescriptor()1355 public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { 1356 return com.google.cloud.secretmanager.v1.ResourcesProto 1357 .internal_static_google_cloud_secretmanager_v1_Secret_descriptor; 1358 } 1359 1360 @SuppressWarnings({"rawtypes"}) internalGetMapField(int number)1361 protected com.google.protobuf.MapField internalGetMapField(int number) { 1362 switch (number) { 1363 case 4: 1364 return internalGetLabels(); 1365 case 11: 1366 return internalGetVersionAliases(); 1367 case 13: 1368 return internalGetAnnotations(); 1369 default: 1370 throw new RuntimeException("Invalid map field number: " + number); 1371 } 1372 } 1373 1374 @SuppressWarnings({"rawtypes"}) internalGetMutableMapField(int number)1375 protected com.google.protobuf.MapField internalGetMutableMapField(int number) { 1376 switch (number) { 1377 case 4: 1378 return internalGetMutableLabels(); 1379 case 11: 1380 return internalGetMutableVersionAliases(); 1381 case 13: 1382 return internalGetMutableAnnotations(); 1383 default: 1384 throw new RuntimeException("Invalid map field number: " + number); 1385 } 1386 } 1387 1388 @java.lang.Override 1389 protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()1390 internalGetFieldAccessorTable() { 1391 return com.google.cloud.secretmanager.v1.ResourcesProto 1392 .internal_static_google_cloud_secretmanager_v1_Secret_fieldAccessorTable 1393 .ensureFieldAccessorsInitialized( 1394 com.google.cloud.secretmanager.v1.Secret.class, 1395 com.google.cloud.secretmanager.v1.Secret.Builder.class); 1396 } 1397 1398 // Construct using com.google.cloud.secretmanager.v1.Secret.newBuilder() Builder()1399 private Builder() {} 1400 Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)1401 private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 1402 super(parent); 1403 } 1404 1405 @java.lang.Override clear()1406 public Builder clear() { 1407 super.clear(); 1408 bitField0_ = 0; 1409 name_ = ""; 1410 replication_ = null; 1411 if (replicationBuilder_ != null) { 1412 replicationBuilder_.dispose(); 1413 replicationBuilder_ = null; 1414 } 1415 createTime_ = null; 1416 if (createTimeBuilder_ != null) { 1417 createTimeBuilder_.dispose(); 1418 createTimeBuilder_ = null; 1419 } 1420 internalGetMutableLabels().clear(); 1421 if (topicsBuilder_ == null) { 1422 topics_ = java.util.Collections.emptyList(); 1423 } else { 1424 topics_ = null; 1425 topicsBuilder_.clear(); 1426 } 1427 bitField0_ = (bitField0_ & ~0x00000010); 1428 if (expireTimeBuilder_ != null) { 1429 expireTimeBuilder_.clear(); 1430 } 1431 if (ttlBuilder_ != null) { 1432 ttlBuilder_.clear(); 1433 } 1434 etag_ = ""; 1435 rotation_ = null; 1436 if (rotationBuilder_ != null) { 1437 rotationBuilder_.dispose(); 1438 rotationBuilder_ = null; 1439 } 1440 internalGetMutableVersionAliases().clear(); 1441 internalGetMutableAnnotations().clear(); 1442 expirationCase_ = 0; 1443 expiration_ = null; 1444 return this; 1445 } 1446 1447 @java.lang.Override getDescriptorForType()1448 public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { 1449 return com.google.cloud.secretmanager.v1.ResourcesProto 1450 .internal_static_google_cloud_secretmanager_v1_Secret_descriptor; 1451 } 1452 1453 @java.lang.Override getDefaultInstanceForType()1454 public com.google.cloud.secretmanager.v1.Secret getDefaultInstanceForType() { 1455 return com.google.cloud.secretmanager.v1.Secret.getDefaultInstance(); 1456 } 1457 1458 @java.lang.Override build()1459 public com.google.cloud.secretmanager.v1.Secret build() { 1460 com.google.cloud.secretmanager.v1.Secret result = buildPartial(); 1461 if (!result.isInitialized()) { 1462 throw newUninitializedMessageException(result); 1463 } 1464 return result; 1465 } 1466 1467 @java.lang.Override buildPartial()1468 public com.google.cloud.secretmanager.v1.Secret buildPartial() { 1469 com.google.cloud.secretmanager.v1.Secret result = 1470 new com.google.cloud.secretmanager.v1.Secret(this); 1471 buildPartialRepeatedFields(result); 1472 if (bitField0_ != 0) { 1473 buildPartial0(result); 1474 } 1475 buildPartialOneofs(result); 1476 onBuilt(); 1477 return result; 1478 } 1479 buildPartialRepeatedFields(com.google.cloud.secretmanager.v1.Secret result)1480 private void buildPartialRepeatedFields(com.google.cloud.secretmanager.v1.Secret result) { 1481 if (topicsBuilder_ == null) { 1482 if (((bitField0_ & 0x00000010) != 0)) { 1483 topics_ = java.util.Collections.unmodifiableList(topics_); 1484 bitField0_ = (bitField0_ & ~0x00000010); 1485 } 1486 result.topics_ = topics_; 1487 } else { 1488 result.topics_ = topicsBuilder_.build(); 1489 } 1490 } 1491 buildPartial0(com.google.cloud.secretmanager.v1.Secret result)1492 private void buildPartial0(com.google.cloud.secretmanager.v1.Secret result) { 1493 int from_bitField0_ = bitField0_; 1494 if (((from_bitField0_ & 0x00000001) != 0)) { 1495 result.name_ = name_; 1496 } 1497 if (((from_bitField0_ & 0x00000002) != 0)) { 1498 result.replication_ = 1499 replicationBuilder_ == null ? replication_ : replicationBuilder_.build(); 1500 } 1501 if (((from_bitField0_ & 0x00000004) != 0)) { 1502 result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); 1503 } 1504 if (((from_bitField0_ & 0x00000008) != 0)) { 1505 result.labels_ = internalGetLabels(); 1506 result.labels_.makeImmutable(); 1507 } 1508 if (((from_bitField0_ & 0x00000080) != 0)) { 1509 result.etag_ = etag_; 1510 } 1511 if (((from_bitField0_ & 0x00000100) != 0)) { 1512 result.rotation_ = rotationBuilder_ == null ? rotation_ : rotationBuilder_.build(); 1513 } 1514 if (((from_bitField0_ & 0x00000200) != 0)) { 1515 result.versionAliases_ = internalGetVersionAliases(); 1516 result.versionAliases_.makeImmutable(); 1517 } 1518 if (((from_bitField0_ & 0x00000400) != 0)) { 1519 result.annotations_ = internalGetAnnotations(); 1520 result.annotations_.makeImmutable(); 1521 } 1522 } 1523 buildPartialOneofs(com.google.cloud.secretmanager.v1.Secret result)1524 private void buildPartialOneofs(com.google.cloud.secretmanager.v1.Secret result) { 1525 result.expirationCase_ = expirationCase_; 1526 result.expiration_ = this.expiration_; 1527 if (expirationCase_ == 6 && expireTimeBuilder_ != null) { 1528 result.expiration_ = expireTimeBuilder_.build(); 1529 } 1530 if (expirationCase_ == 7 && ttlBuilder_ != null) { 1531 result.expiration_ = ttlBuilder_.build(); 1532 } 1533 } 1534 1535 @java.lang.Override clone()1536 public Builder clone() { 1537 return super.clone(); 1538 } 1539 1540 @java.lang.Override setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1541 public Builder setField( 1542 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1543 return super.setField(field, value); 1544 } 1545 1546 @java.lang.Override clearField(com.google.protobuf.Descriptors.FieldDescriptor field)1547 public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { 1548 return super.clearField(field); 1549 } 1550 1551 @java.lang.Override clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)1552 public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { 1553 return super.clearOneof(oneof); 1554 } 1555 1556 @java.lang.Override setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value)1557 public Builder setRepeatedField( 1558 com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { 1559 return super.setRepeatedField(field, index, value); 1560 } 1561 1562 @java.lang.Override addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value)1563 public Builder addRepeatedField( 1564 com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { 1565 return super.addRepeatedField(field, value); 1566 } 1567 1568 @java.lang.Override mergeFrom(com.google.protobuf.Message other)1569 public Builder mergeFrom(com.google.protobuf.Message other) { 1570 if (other instanceof com.google.cloud.secretmanager.v1.Secret) { 1571 return mergeFrom((com.google.cloud.secretmanager.v1.Secret) other); 1572 } else { 1573 super.mergeFrom(other); 1574 return this; 1575 } 1576 } 1577 mergeFrom(com.google.cloud.secretmanager.v1.Secret other)1578 public Builder mergeFrom(com.google.cloud.secretmanager.v1.Secret other) { 1579 if (other == com.google.cloud.secretmanager.v1.Secret.getDefaultInstance()) return this; 1580 if (!other.getName().isEmpty()) { 1581 name_ = other.name_; 1582 bitField0_ |= 0x00000001; 1583 onChanged(); 1584 } 1585 if (other.hasReplication()) { 1586 mergeReplication(other.getReplication()); 1587 } 1588 if (other.hasCreateTime()) { 1589 mergeCreateTime(other.getCreateTime()); 1590 } 1591 internalGetMutableLabels().mergeFrom(other.internalGetLabels()); 1592 bitField0_ |= 0x00000008; 1593 if (topicsBuilder_ == null) { 1594 if (!other.topics_.isEmpty()) { 1595 if (topics_.isEmpty()) { 1596 topics_ = other.topics_; 1597 bitField0_ = (bitField0_ & ~0x00000010); 1598 } else { 1599 ensureTopicsIsMutable(); 1600 topics_.addAll(other.topics_); 1601 } 1602 onChanged(); 1603 } 1604 } else { 1605 if (!other.topics_.isEmpty()) { 1606 if (topicsBuilder_.isEmpty()) { 1607 topicsBuilder_.dispose(); 1608 topicsBuilder_ = null; 1609 topics_ = other.topics_; 1610 bitField0_ = (bitField0_ & ~0x00000010); 1611 topicsBuilder_ = 1612 com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders 1613 ? getTopicsFieldBuilder() 1614 : null; 1615 } else { 1616 topicsBuilder_.addAllMessages(other.topics_); 1617 } 1618 } 1619 } 1620 if (!other.getEtag().isEmpty()) { 1621 etag_ = other.etag_; 1622 bitField0_ |= 0x00000080; 1623 onChanged(); 1624 } 1625 if (other.hasRotation()) { 1626 mergeRotation(other.getRotation()); 1627 } 1628 internalGetMutableVersionAliases().mergeFrom(other.internalGetVersionAliases()); 1629 bitField0_ |= 0x00000200; 1630 internalGetMutableAnnotations().mergeFrom(other.internalGetAnnotations()); 1631 bitField0_ |= 0x00000400; 1632 switch (other.getExpirationCase()) { 1633 case EXPIRE_TIME: 1634 { 1635 mergeExpireTime(other.getExpireTime()); 1636 break; 1637 } 1638 case TTL: 1639 { 1640 mergeTtl(other.getTtl()); 1641 break; 1642 } 1643 case EXPIRATION_NOT_SET: 1644 { 1645 break; 1646 } 1647 } 1648 this.mergeUnknownFields(other.getUnknownFields()); 1649 onChanged(); 1650 return this; 1651 } 1652 1653 @java.lang.Override isInitialized()1654 public final boolean isInitialized() { 1655 return true; 1656 } 1657 1658 @java.lang.Override mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)1659 public Builder mergeFrom( 1660 com.google.protobuf.CodedInputStream input, 1661 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1662 throws java.io.IOException { 1663 if (extensionRegistry == null) { 1664 throw new java.lang.NullPointerException(); 1665 } 1666 try { 1667 boolean done = false; 1668 while (!done) { 1669 int tag = input.readTag(); 1670 switch (tag) { 1671 case 0: 1672 done = true; 1673 break; 1674 case 10: 1675 { 1676 name_ = input.readStringRequireUtf8(); 1677 bitField0_ |= 0x00000001; 1678 break; 1679 } // case 10 1680 case 18: 1681 { 1682 input.readMessage(getReplicationFieldBuilder().getBuilder(), extensionRegistry); 1683 bitField0_ |= 0x00000002; 1684 break; 1685 } // case 18 1686 case 26: 1687 { 1688 input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); 1689 bitField0_ |= 0x00000004; 1690 break; 1691 } // case 26 1692 case 34: 1693 { 1694 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> labels__ = 1695 input.readMessage( 1696 LabelsDefaultEntryHolder.defaultEntry.getParserForType(), 1697 extensionRegistry); 1698 internalGetMutableLabels() 1699 .getMutableMap() 1700 .put(labels__.getKey(), labels__.getValue()); 1701 bitField0_ |= 0x00000008; 1702 break; 1703 } // case 34 1704 case 42: 1705 { 1706 com.google.cloud.secretmanager.v1.Topic m = 1707 input.readMessage( 1708 com.google.cloud.secretmanager.v1.Topic.parser(), extensionRegistry); 1709 if (topicsBuilder_ == null) { 1710 ensureTopicsIsMutable(); 1711 topics_.add(m); 1712 } else { 1713 topicsBuilder_.addMessage(m); 1714 } 1715 break; 1716 } // case 42 1717 case 50: 1718 { 1719 input.readMessage(getExpireTimeFieldBuilder().getBuilder(), extensionRegistry); 1720 expirationCase_ = 6; 1721 break; 1722 } // case 50 1723 case 58: 1724 { 1725 input.readMessage(getTtlFieldBuilder().getBuilder(), extensionRegistry); 1726 expirationCase_ = 7; 1727 break; 1728 } // case 58 1729 case 66: 1730 { 1731 etag_ = input.readStringRequireUtf8(); 1732 bitField0_ |= 0x00000080; 1733 break; 1734 } // case 66 1735 case 74: 1736 { 1737 input.readMessage(getRotationFieldBuilder().getBuilder(), extensionRegistry); 1738 bitField0_ |= 0x00000100; 1739 break; 1740 } // case 74 1741 case 90: 1742 { 1743 com.google.protobuf.MapEntry<java.lang.String, java.lang.Long> versionAliases__ = 1744 input.readMessage( 1745 VersionAliasesDefaultEntryHolder.defaultEntry.getParserForType(), 1746 extensionRegistry); 1747 internalGetMutableVersionAliases() 1748 .getMutableMap() 1749 .put(versionAliases__.getKey(), versionAliases__.getValue()); 1750 bitField0_ |= 0x00000200; 1751 break; 1752 } // case 90 1753 case 106: 1754 { 1755 com.google.protobuf.MapEntry<java.lang.String, java.lang.String> annotations__ = 1756 input.readMessage( 1757 AnnotationsDefaultEntryHolder.defaultEntry.getParserForType(), 1758 extensionRegistry); 1759 internalGetMutableAnnotations() 1760 .getMutableMap() 1761 .put(annotations__.getKey(), annotations__.getValue()); 1762 bitField0_ |= 0x00000400; 1763 break; 1764 } // case 106 1765 default: 1766 { 1767 if (!super.parseUnknownField(input, extensionRegistry, tag)) { 1768 done = true; // was an endgroup tag 1769 } 1770 break; 1771 } // default: 1772 } // switch (tag) 1773 } // while (!done) 1774 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 1775 throw e.unwrapIOException(); 1776 } finally { 1777 onChanged(); 1778 } // finally 1779 return this; 1780 } 1781 1782 private int expirationCase_ = 0; 1783 private java.lang.Object expiration_; 1784 getExpirationCase()1785 public ExpirationCase getExpirationCase() { 1786 return ExpirationCase.forNumber(expirationCase_); 1787 } 1788 clearExpiration()1789 public Builder clearExpiration() { 1790 expirationCase_ = 0; 1791 expiration_ = null; 1792 onChanged(); 1793 return this; 1794 } 1795 1796 private int bitField0_; 1797 1798 private java.lang.Object name_ = ""; 1799 /** 1800 * 1801 * 1802 * <pre> 1803 * Output only. The resource name of the 1804 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 1805 * `projects/*/secrets/*`. 1806 * </pre> 1807 * 1808 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1809 * 1810 * @return The name. 1811 */ getName()1812 public java.lang.String getName() { 1813 java.lang.Object ref = name_; 1814 if (!(ref instanceof java.lang.String)) { 1815 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 1816 java.lang.String s = bs.toStringUtf8(); 1817 name_ = s; 1818 return s; 1819 } else { 1820 return (java.lang.String) ref; 1821 } 1822 } 1823 /** 1824 * 1825 * 1826 * <pre> 1827 * Output only. The resource name of the 1828 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 1829 * `projects/*/secrets/*`. 1830 * </pre> 1831 * 1832 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1833 * 1834 * @return The bytes for name. 1835 */ getNameBytes()1836 public com.google.protobuf.ByteString getNameBytes() { 1837 java.lang.Object ref = name_; 1838 if (ref instanceof String) { 1839 com.google.protobuf.ByteString b = 1840 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 1841 name_ = b; 1842 return b; 1843 } else { 1844 return (com.google.protobuf.ByteString) ref; 1845 } 1846 } 1847 /** 1848 * 1849 * 1850 * <pre> 1851 * Output only. The resource name of the 1852 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 1853 * `projects/*/secrets/*`. 1854 * </pre> 1855 * 1856 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1857 * 1858 * @param value The name to set. 1859 * @return This builder for chaining. 1860 */ setName(java.lang.String value)1861 public Builder setName(java.lang.String value) { 1862 if (value == null) { 1863 throw new NullPointerException(); 1864 } 1865 name_ = value; 1866 bitField0_ |= 0x00000001; 1867 onChanged(); 1868 return this; 1869 } 1870 /** 1871 * 1872 * 1873 * <pre> 1874 * Output only. The resource name of the 1875 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 1876 * `projects/*/secrets/*`. 1877 * </pre> 1878 * 1879 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1880 * 1881 * @return This builder for chaining. 1882 */ clearName()1883 public Builder clearName() { 1884 name_ = getDefaultInstance().getName(); 1885 bitField0_ = (bitField0_ & ~0x00000001); 1886 onChanged(); 1887 return this; 1888 } 1889 /** 1890 * 1891 * 1892 * <pre> 1893 * Output only. The resource name of the 1894 * [Secret][google.cloud.secretmanager.v1.Secret] in the format 1895 * `projects/*/secrets/*`. 1896 * </pre> 1897 * 1898 * <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code> 1899 * 1900 * @param value The bytes for name to set. 1901 * @return This builder for chaining. 1902 */ setNameBytes(com.google.protobuf.ByteString value)1903 public Builder setNameBytes(com.google.protobuf.ByteString value) { 1904 if (value == null) { 1905 throw new NullPointerException(); 1906 } 1907 checkByteStringIsUtf8(value); 1908 name_ = value; 1909 bitField0_ |= 0x00000001; 1910 onChanged(); 1911 return this; 1912 } 1913 1914 private com.google.cloud.secretmanager.v1.Replication replication_; 1915 private com.google.protobuf.SingleFieldBuilderV3< 1916 com.google.cloud.secretmanager.v1.Replication, 1917 com.google.cloud.secretmanager.v1.Replication.Builder, 1918 com.google.cloud.secretmanager.v1.ReplicationOrBuilder> 1919 replicationBuilder_; 1920 /** 1921 * 1922 * 1923 * <pre> 1924 * Required. Immutable. The replication policy of the secret data attached to 1925 * the [Secret][google.cloud.secretmanager.v1.Secret]. 1926 * The replication policy cannot be changed after the Secret has been created. 1927 * </pre> 1928 * 1929 * <code> 1930 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 1931 * </code> 1932 * 1933 * @return Whether the replication field is set. 1934 */ hasReplication()1935 public boolean hasReplication() { 1936 return ((bitField0_ & 0x00000002) != 0); 1937 } 1938 /** 1939 * 1940 * 1941 * <pre> 1942 * Required. Immutable. The replication policy of the secret data attached to 1943 * the [Secret][google.cloud.secretmanager.v1.Secret]. 1944 * The replication policy cannot be changed after the Secret has been created. 1945 * </pre> 1946 * 1947 * <code> 1948 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 1949 * </code> 1950 * 1951 * @return The replication. 1952 */ getReplication()1953 public com.google.cloud.secretmanager.v1.Replication getReplication() { 1954 if (replicationBuilder_ == null) { 1955 return replication_ == null 1956 ? com.google.cloud.secretmanager.v1.Replication.getDefaultInstance() 1957 : replication_; 1958 } else { 1959 return replicationBuilder_.getMessage(); 1960 } 1961 } 1962 /** 1963 * 1964 * 1965 * <pre> 1966 * Required. Immutable. The replication policy of the secret data attached to 1967 * the [Secret][google.cloud.secretmanager.v1.Secret]. 1968 * The replication policy cannot be changed after the Secret has been created. 1969 * </pre> 1970 * 1971 * <code> 1972 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 1973 * </code> 1974 */ setReplication(com.google.cloud.secretmanager.v1.Replication value)1975 public Builder setReplication(com.google.cloud.secretmanager.v1.Replication value) { 1976 if (replicationBuilder_ == null) { 1977 if (value == null) { 1978 throw new NullPointerException(); 1979 } 1980 replication_ = value; 1981 } else { 1982 replicationBuilder_.setMessage(value); 1983 } 1984 bitField0_ |= 0x00000002; 1985 onChanged(); 1986 return this; 1987 } 1988 /** 1989 * 1990 * 1991 * <pre> 1992 * Required. Immutable. The replication policy of the secret data attached to 1993 * the [Secret][google.cloud.secretmanager.v1.Secret]. 1994 * The replication policy cannot be changed after the Secret has been created. 1995 * </pre> 1996 * 1997 * <code> 1998 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 1999 * </code> 2000 */ setReplication( com.google.cloud.secretmanager.v1.Replication.Builder builderForValue)2001 public Builder setReplication( 2002 com.google.cloud.secretmanager.v1.Replication.Builder builderForValue) { 2003 if (replicationBuilder_ == null) { 2004 replication_ = builderForValue.build(); 2005 } else { 2006 replicationBuilder_.setMessage(builderForValue.build()); 2007 } 2008 bitField0_ |= 0x00000002; 2009 onChanged(); 2010 return this; 2011 } 2012 /** 2013 * 2014 * 2015 * <pre> 2016 * Required. Immutable. The replication policy of the secret data attached to 2017 * the [Secret][google.cloud.secretmanager.v1.Secret]. 2018 * The replication policy cannot be changed after the Secret has been created. 2019 * </pre> 2020 * 2021 * <code> 2022 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 2023 * </code> 2024 */ mergeReplication(com.google.cloud.secretmanager.v1.Replication value)2025 public Builder mergeReplication(com.google.cloud.secretmanager.v1.Replication value) { 2026 if (replicationBuilder_ == null) { 2027 if (((bitField0_ & 0x00000002) != 0) 2028 && replication_ != null 2029 && replication_ != com.google.cloud.secretmanager.v1.Replication.getDefaultInstance()) { 2030 getReplicationBuilder().mergeFrom(value); 2031 } else { 2032 replication_ = value; 2033 } 2034 } else { 2035 replicationBuilder_.mergeFrom(value); 2036 } 2037 bitField0_ |= 0x00000002; 2038 onChanged(); 2039 return this; 2040 } 2041 /** 2042 * 2043 * 2044 * <pre> 2045 * Required. Immutable. The replication policy of the secret data attached to 2046 * the [Secret][google.cloud.secretmanager.v1.Secret]. 2047 * The replication policy cannot be changed after the Secret has been created. 2048 * </pre> 2049 * 2050 * <code> 2051 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 2052 * </code> 2053 */ clearReplication()2054 public Builder clearReplication() { 2055 bitField0_ = (bitField0_ & ~0x00000002); 2056 replication_ = null; 2057 if (replicationBuilder_ != null) { 2058 replicationBuilder_.dispose(); 2059 replicationBuilder_ = null; 2060 } 2061 onChanged(); 2062 return this; 2063 } 2064 /** 2065 * 2066 * 2067 * <pre> 2068 * Required. Immutable. The replication policy of the secret data attached to 2069 * the [Secret][google.cloud.secretmanager.v1.Secret]. 2070 * The replication policy cannot be changed after the Secret has been created. 2071 * </pre> 2072 * 2073 * <code> 2074 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 2075 * </code> 2076 */ getReplicationBuilder()2077 public com.google.cloud.secretmanager.v1.Replication.Builder getReplicationBuilder() { 2078 bitField0_ |= 0x00000002; 2079 onChanged(); 2080 return getReplicationFieldBuilder().getBuilder(); 2081 } 2082 /** 2083 * 2084 * 2085 * <pre> 2086 * Required. Immutable. The replication policy of the secret data attached to 2087 * the [Secret][google.cloud.secretmanager.v1.Secret]. 2088 * The replication policy cannot be changed after the Secret has been created. 2089 * </pre> 2090 * 2091 * <code> 2092 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 2093 * </code> 2094 */ getReplicationOrBuilder()2095 public com.google.cloud.secretmanager.v1.ReplicationOrBuilder getReplicationOrBuilder() { 2096 if (replicationBuilder_ != null) { 2097 return replicationBuilder_.getMessageOrBuilder(); 2098 } else { 2099 return replication_ == null 2100 ? com.google.cloud.secretmanager.v1.Replication.getDefaultInstance() 2101 : replication_; 2102 } 2103 } 2104 /** 2105 * 2106 * 2107 * <pre> 2108 * Required. Immutable. The replication policy of the secret data attached to 2109 * the [Secret][google.cloud.secretmanager.v1.Secret]. 2110 * The replication policy cannot be changed after the Secret has been created. 2111 * </pre> 2112 * 2113 * <code> 2114 * .google.cloud.secretmanager.v1.Replication replication = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED]; 2115 * </code> 2116 */ 2117 private com.google.protobuf.SingleFieldBuilderV3< 2118 com.google.cloud.secretmanager.v1.Replication, 2119 com.google.cloud.secretmanager.v1.Replication.Builder, 2120 com.google.cloud.secretmanager.v1.ReplicationOrBuilder> getReplicationFieldBuilder()2121 getReplicationFieldBuilder() { 2122 if (replicationBuilder_ == null) { 2123 replicationBuilder_ = 2124 new com.google.protobuf.SingleFieldBuilderV3< 2125 com.google.cloud.secretmanager.v1.Replication, 2126 com.google.cloud.secretmanager.v1.Replication.Builder, 2127 com.google.cloud.secretmanager.v1.ReplicationOrBuilder>( 2128 getReplication(), getParentForChildren(), isClean()); 2129 replication_ = null; 2130 } 2131 return replicationBuilder_; 2132 } 2133 2134 private com.google.protobuf.Timestamp createTime_; 2135 private com.google.protobuf.SingleFieldBuilderV3< 2136 com.google.protobuf.Timestamp, 2137 com.google.protobuf.Timestamp.Builder, 2138 com.google.protobuf.TimestampOrBuilder> 2139 createTimeBuilder_; 2140 /** 2141 * 2142 * 2143 * <pre> 2144 * Output only. The time at which the 2145 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2146 * </pre> 2147 * 2148 * <code> 2149 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2150 * </code> 2151 * 2152 * @return Whether the createTime field is set. 2153 */ hasCreateTime()2154 public boolean hasCreateTime() { 2155 return ((bitField0_ & 0x00000004) != 0); 2156 } 2157 /** 2158 * 2159 * 2160 * <pre> 2161 * Output only. The time at which the 2162 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2163 * </pre> 2164 * 2165 * <code> 2166 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2167 * </code> 2168 * 2169 * @return The createTime. 2170 */ getCreateTime()2171 public com.google.protobuf.Timestamp getCreateTime() { 2172 if (createTimeBuilder_ == null) { 2173 return createTime_ == null 2174 ? com.google.protobuf.Timestamp.getDefaultInstance() 2175 : createTime_; 2176 } else { 2177 return createTimeBuilder_.getMessage(); 2178 } 2179 } 2180 /** 2181 * 2182 * 2183 * <pre> 2184 * Output only. The time at which the 2185 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2186 * </pre> 2187 * 2188 * <code> 2189 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2190 * </code> 2191 */ setCreateTime(com.google.protobuf.Timestamp value)2192 public Builder setCreateTime(com.google.protobuf.Timestamp value) { 2193 if (createTimeBuilder_ == null) { 2194 if (value == null) { 2195 throw new NullPointerException(); 2196 } 2197 createTime_ = value; 2198 } else { 2199 createTimeBuilder_.setMessage(value); 2200 } 2201 bitField0_ |= 0x00000004; 2202 onChanged(); 2203 return this; 2204 } 2205 /** 2206 * 2207 * 2208 * <pre> 2209 * Output only. The time at which the 2210 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2211 * </pre> 2212 * 2213 * <code> 2214 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2215 * </code> 2216 */ setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue)2217 public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { 2218 if (createTimeBuilder_ == null) { 2219 createTime_ = builderForValue.build(); 2220 } else { 2221 createTimeBuilder_.setMessage(builderForValue.build()); 2222 } 2223 bitField0_ |= 0x00000004; 2224 onChanged(); 2225 return this; 2226 } 2227 /** 2228 * 2229 * 2230 * <pre> 2231 * Output only. The time at which the 2232 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2233 * </pre> 2234 * 2235 * <code> 2236 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2237 * </code> 2238 */ mergeCreateTime(com.google.protobuf.Timestamp value)2239 public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { 2240 if (createTimeBuilder_ == null) { 2241 if (((bitField0_ & 0x00000004) != 0) 2242 && createTime_ != null 2243 && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 2244 getCreateTimeBuilder().mergeFrom(value); 2245 } else { 2246 createTime_ = value; 2247 } 2248 } else { 2249 createTimeBuilder_.mergeFrom(value); 2250 } 2251 bitField0_ |= 0x00000004; 2252 onChanged(); 2253 return this; 2254 } 2255 /** 2256 * 2257 * 2258 * <pre> 2259 * Output only. The time at which the 2260 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2261 * </pre> 2262 * 2263 * <code> 2264 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2265 * </code> 2266 */ clearCreateTime()2267 public Builder clearCreateTime() { 2268 bitField0_ = (bitField0_ & ~0x00000004); 2269 createTime_ = null; 2270 if (createTimeBuilder_ != null) { 2271 createTimeBuilder_.dispose(); 2272 createTimeBuilder_ = null; 2273 } 2274 onChanged(); 2275 return this; 2276 } 2277 /** 2278 * 2279 * 2280 * <pre> 2281 * Output only. The time at which the 2282 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2283 * </pre> 2284 * 2285 * <code> 2286 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2287 * </code> 2288 */ getCreateTimeBuilder()2289 public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { 2290 bitField0_ |= 0x00000004; 2291 onChanged(); 2292 return getCreateTimeFieldBuilder().getBuilder(); 2293 } 2294 /** 2295 * 2296 * 2297 * <pre> 2298 * Output only. The time at which the 2299 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2300 * </pre> 2301 * 2302 * <code> 2303 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2304 * </code> 2305 */ getCreateTimeOrBuilder()2306 public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { 2307 if (createTimeBuilder_ != null) { 2308 return createTimeBuilder_.getMessageOrBuilder(); 2309 } else { 2310 return createTime_ == null 2311 ? com.google.protobuf.Timestamp.getDefaultInstance() 2312 : createTime_; 2313 } 2314 } 2315 /** 2316 * 2317 * 2318 * <pre> 2319 * Output only. The time at which the 2320 * [Secret][google.cloud.secretmanager.v1.Secret] was created. 2321 * </pre> 2322 * 2323 * <code> 2324 * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; 2325 * </code> 2326 */ 2327 private com.google.protobuf.SingleFieldBuilderV3< 2328 com.google.protobuf.Timestamp, 2329 com.google.protobuf.Timestamp.Builder, 2330 com.google.protobuf.TimestampOrBuilder> getCreateTimeFieldBuilder()2331 getCreateTimeFieldBuilder() { 2332 if (createTimeBuilder_ == null) { 2333 createTimeBuilder_ = 2334 new com.google.protobuf.SingleFieldBuilderV3< 2335 com.google.protobuf.Timestamp, 2336 com.google.protobuf.Timestamp.Builder, 2337 com.google.protobuf.TimestampOrBuilder>( 2338 getCreateTime(), getParentForChildren(), isClean()); 2339 createTime_ = null; 2340 } 2341 return createTimeBuilder_; 2342 } 2343 2344 private com.google.protobuf.MapField<java.lang.String, java.lang.String> labels_; 2345 internalGetLabels()2346 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetLabels() { 2347 if (labels_ == null) { 2348 return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); 2349 } 2350 return labels_; 2351 } 2352 2353 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableLabels()2354 internalGetMutableLabels() { 2355 if (labels_ == null) { 2356 labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); 2357 } 2358 if (!labels_.isMutable()) { 2359 labels_ = labels_.copy(); 2360 } 2361 bitField0_ |= 0x00000008; 2362 onChanged(); 2363 return labels_; 2364 } 2365 getLabelsCount()2366 public int getLabelsCount() { 2367 return internalGetLabels().getMap().size(); 2368 } 2369 /** 2370 * 2371 * 2372 * <pre> 2373 * The labels assigned to this Secret. 2374 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2375 * of maximum 128 bytes, and must conform to the following PCRE regular 2376 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2377 * Label values must be between 0 and 63 characters long, have a UTF-8 2378 * encoding of maximum 128 bytes, and must conform to the following PCRE 2379 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2380 * No more than 64 labels can be assigned to a given resource. 2381 * </pre> 2382 * 2383 * <code>map<string, string> labels = 4;</code> 2384 */ 2385 @java.lang.Override containsLabels(java.lang.String key)2386 public boolean containsLabels(java.lang.String key) { 2387 if (key == null) { 2388 throw new NullPointerException("map key"); 2389 } 2390 return internalGetLabels().getMap().containsKey(key); 2391 } 2392 /** Use {@link #getLabelsMap()} instead. */ 2393 @java.lang.Override 2394 @java.lang.Deprecated getLabels()2395 public java.util.Map<java.lang.String, java.lang.String> getLabels() { 2396 return getLabelsMap(); 2397 } 2398 /** 2399 * 2400 * 2401 * <pre> 2402 * The labels assigned to this Secret. 2403 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2404 * of maximum 128 bytes, and must conform to the following PCRE regular 2405 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2406 * Label values must be between 0 and 63 characters long, have a UTF-8 2407 * encoding of maximum 128 bytes, and must conform to the following PCRE 2408 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2409 * No more than 64 labels can be assigned to a given resource. 2410 * </pre> 2411 * 2412 * <code>map<string, string> labels = 4;</code> 2413 */ 2414 @java.lang.Override getLabelsMap()2415 public java.util.Map<java.lang.String, java.lang.String> getLabelsMap() { 2416 return internalGetLabels().getMap(); 2417 } 2418 /** 2419 * 2420 * 2421 * <pre> 2422 * The labels assigned to this Secret. 2423 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2424 * of maximum 128 bytes, and must conform to the following PCRE regular 2425 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2426 * Label values must be between 0 and 63 characters long, have a UTF-8 2427 * encoding of maximum 128 bytes, and must conform to the following PCRE 2428 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2429 * No more than 64 labels can be assigned to a given resource. 2430 * </pre> 2431 * 2432 * <code>map<string, string> labels = 4;</code> 2433 */ 2434 @java.lang.Override getLabelsOrDefault( java.lang.String key, java.lang.String defaultValue)2435 public /* nullable */ java.lang.String getLabelsOrDefault( 2436 java.lang.String key, 2437 /* nullable */ 2438 java.lang.String defaultValue) { 2439 if (key == null) { 2440 throw new NullPointerException("map key"); 2441 } 2442 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 2443 return map.containsKey(key) ? map.get(key) : defaultValue; 2444 } 2445 /** 2446 * 2447 * 2448 * <pre> 2449 * The labels assigned to this Secret. 2450 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2451 * of maximum 128 bytes, and must conform to the following PCRE regular 2452 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2453 * Label values must be between 0 and 63 characters long, have a UTF-8 2454 * encoding of maximum 128 bytes, and must conform to the following PCRE 2455 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2456 * No more than 64 labels can be assigned to a given resource. 2457 * </pre> 2458 * 2459 * <code>map<string, string> labels = 4;</code> 2460 */ 2461 @java.lang.Override getLabelsOrThrow(java.lang.String key)2462 public java.lang.String getLabelsOrThrow(java.lang.String key) { 2463 if (key == null) { 2464 throw new NullPointerException("map key"); 2465 } 2466 java.util.Map<java.lang.String, java.lang.String> map = internalGetLabels().getMap(); 2467 if (!map.containsKey(key)) { 2468 throw new java.lang.IllegalArgumentException(); 2469 } 2470 return map.get(key); 2471 } 2472 clearLabels()2473 public Builder clearLabels() { 2474 bitField0_ = (bitField0_ & ~0x00000008); 2475 internalGetMutableLabels().getMutableMap().clear(); 2476 return this; 2477 } 2478 /** 2479 * 2480 * 2481 * <pre> 2482 * The labels assigned to this Secret. 2483 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2484 * of maximum 128 bytes, and must conform to the following PCRE regular 2485 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2486 * Label values must be between 0 and 63 characters long, have a UTF-8 2487 * encoding of maximum 128 bytes, and must conform to the following PCRE 2488 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2489 * No more than 64 labels can be assigned to a given resource. 2490 * </pre> 2491 * 2492 * <code>map<string, string> labels = 4;</code> 2493 */ removeLabels(java.lang.String key)2494 public Builder removeLabels(java.lang.String key) { 2495 if (key == null) { 2496 throw new NullPointerException("map key"); 2497 } 2498 internalGetMutableLabels().getMutableMap().remove(key); 2499 return this; 2500 } 2501 /** Use alternate mutation accessors instead. */ 2502 @java.lang.Deprecated getMutableLabels()2503 public java.util.Map<java.lang.String, java.lang.String> getMutableLabels() { 2504 bitField0_ |= 0x00000008; 2505 return internalGetMutableLabels().getMutableMap(); 2506 } 2507 /** 2508 * 2509 * 2510 * <pre> 2511 * The labels assigned to this Secret. 2512 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2513 * of maximum 128 bytes, and must conform to the following PCRE regular 2514 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2515 * Label values must be between 0 and 63 characters long, have a UTF-8 2516 * encoding of maximum 128 bytes, and must conform to the following PCRE 2517 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2518 * No more than 64 labels can be assigned to a given resource. 2519 * </pre> 2520 * 2521 * <code>map<string, string> labels = 4;</code> 2522 */ putLabels(java.lang.String key, java.lang.String value)2523 public Builder putLabels(java.lang.String key, java.lang.String value) { 2524 if (key == null) { 2525 throw new NullPointerException("map key"); 2526 } 2527 if (value == null) { 2528 throw new NullPointerException("map value"); 2529 } 2530 internalGetMutableLabels().getMutableMap().put(key, value); 2531 bitField0_ |= 0x00000008; 2532 return this; 2533 } 2534 /** 2535 * 2536 * 2537 * <pre> 2538 * The labels assigned to this Secret. 2539 * Label keys must be between 1 and 63 characters long, have a UTF-8 encoding 2540 * of maximum 128 bytes, and must conform to the following PCRE regular 2541 * expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` 2542 * Label values must be between 0 and 63 characters long, have a UTF-8 2543 * encoding of maximum 128 bytes, and must conform to the following PCRE 2544 * regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` 2545 * No more than 64 labels can be assigned to a given resource. 2546 * </pre> 2547 * 2548 * <code>map<string, string> labels = 4;</code> 2549 */ putAllLabels(java.util.Map<java.lang.String, java.lang.String> values)2550 public Builder putAllLabels(java.util.Map<java.lang.String, java.lang.String> values) { 2551 internalGetMutableLabels().getMutableMap().putAll(values); 2552 bitField0_ |= 0x00000008; 2553 return this; 2554 } 2555 2556 private java.util.List<com.google.cloud.secretmanager.v1.Topic> topics_ = 2557 java.util.Collections.emptyList(); 2558 ensureTopicsIsMutable()2559 private void ensureTopicsIsMutable() { 2560 if (!((bitField0_ & 0x00000010) != 0)) { 2561 topics_ = new java.util.ArrayList<com.google.cloud.secretmanager.v1.Topic>(topics_); 2562 bitField0_ |= 0x00000010; 2563 } 2564 } 2565 2566 private com.google.protobuf.RepeatedFieldBuilderV3< 2567 com.google.cloud.secretmanager.v1.Topic, 2568 com.google.cloud.secretmanager.v1.Topic.Builder, 2569 com.google.cloud.secretmanager.v1.TopicOrBuilder> 2570 topicsBuilder_; 2571 2572 /** 2573 * 2574 * 2575 * <pre> 2576 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2577 * when control plane operations are called on the secret or its versions. 2578 * </pre> 2579 * 2580 * <code> 2581 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2582 * </code> 2583 */ getTopicsList()2584 public java.util.List<com.google.cloud.secretmanager.v1.Topic> getTopicsList() { 2585 if (topicsBuilder_ == null) { 2586 return java.util.Collections.unmodifiableList(topics_); 2587 } else { 2588 return topicsBuilder_.getMessageList(); 2589 } 2590 } 2591 /** 2592 * 2593 * 2594 * <pre> 2595 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2596 * when control plane operations are called on the secret or its versions. 2597 * </pre> 2598 * 2599 * <code> 2600 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2601 * </code> 2602 */ getTopicsCount()2603 public int getTopicsCount() { 2604 if (topicsBuilder_ == null) { 2605 return topics_.size(); 2606 } else { 2607 return topicsBuilder_.getCount(); 2608 } 2609 } 2610 /** 2611 * 2612 * 2613 * <pre> 2614 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2615 * when control plane operations are called on the secret or its versions. 2616 * </pre> 2617 * 2618 * <code> 2619 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2620 * </code> 2621 */ getTopics(int index)2622 public com.google.cloud.secretmanager.v1.Topic getTopics(int index) { 2623 if (topicsBuilder_ == null) { 2624 return topics_.get(index); 2625 } else { 2626 return topicsBuilder_.getMessage(index); 2627 } 2628 } 2629 /** 2630 * 2631 * 2632 * <pre> 2633 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2634 * when control plane operations are called on the secret or its versions. 2635 * </pre> 2636 * 2637 * <code> 2638 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2639 * </code> 2640 */ setTopics(int index, com.google.cloud.secretmanager.v1.Topic value)2641 public Builder setTopics(int index, com.google.cloud.secretmanager.v1.Topic value) { 2642 if (topicsBuilder_ == null) { 2643 if (value == null) { 2644 throw new NullPointerException(); 2645 } 2646 ensureTopicsIsMutable(); 2647 topics_.set(index, value); 2648 onChanged(); 2649 } else { 2650 topicsBuilder_.setMessage(index, value); 2651 } 2652 return this; 2653 } 2654 /** 2655 * 2656 * 2657 * <pre> 2658 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2659 * when control plane operations are called on the secret or its versions. 2660 * </pre> 2661 * 2662 * <code> 2663 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2664 * </code> 2665 */ setTopics( int index, com.google.cloud.secretmanager.v1.Topic.Builder builderForValue)2666 public Builder setTopics( 2667 int index, com.google.cloud.secretmanager.v1.Topic.Builder builderForValue) { 2668 if (topicsBuilder_ == null) { 2669 ensureTopicsIsMutable(); 2670 topics_.set(index, builderForValue.build()); 2671 onChanged(); 2672 } else { 2673 topicsBuilder_.setMessage(index, builderForValue.build()); 2674 } 2675 return this; 2676 } 2677 /** 2678 * 2679 * 2680 * <pre> 2681 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2682 * when control plane operations are called on the secret or its versions. 2683 * </pre> 2684 * 2685 * <code> 2686 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2687 * </code> 2688 */ addTopics(com.google.cloud.secretmanager.v1.Topic value)2689 public Builder addTopics(com.google.cloud.secretmanager.v1.Topic value) { 2690 if (topicsBuilder_ == null) { 2691 if (value == null) { 2692 throw new NullPointerException(); 2693 } 2694 ensureTopicsIsMutable(); 2695 topics_.add(value); 2696 onChanged(); 2697 } else { 2698 topicsBuilder_.addMessage(value); 2699 } 2700 return this; 2701 } 2702 /** 2703 * 2704 * 2705 * <pre> 2706 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2707 * when control plane operations are called on the secret or its versions. 2708 * </pre> 2709 * 2710 * <code> 2711 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2712 * </code> 2713 */ addTopics(int index, com.google.cloud.secretmanager.v1.Topic value)2714 public Builder addTopics(int index, com.google.cloud.secretmanager.v1.Topic value) { 2715 if (topicsBuilder_ == null) { 2716 if (value == null) { 2717 throw new NullPointerException(); 2718 } 2719 ensureTopicsIsMutable(); 2720 topics_.add(index, value); 2721 onChanged(); 2722 } else { 2723 topicsBuilder_.addMessage(index, value); 2724 } 2725 return this; 2726 } 2727 /** 2728 * 2729 * 2730 * <pre> 2731 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2732 * when control plane operations are called on the secret or its versions. 2733 * </pre> 2734 * 2735 * <code> 2736 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2737 * </code> 2738 */ addTopics(com.google.cloud.secretmanager.v1.Topic.Builder builderForValue)2739 public Builder addTopics(com.google.cloud.secretmanager.v1.Topic.Builder builderForValue) { 2740 if (topicsBuilder_ == null) { 2741 ensureTopicsIsMutable(); 2742 topics_.add(builderForValue.build()); 2743 onChanged(); 2744 } else { 2745 topicsBuilder_.addMessage(builderForValue.build()); 2746 } 2747 return this; 2748 } 2749 /** 2750 * 2751 * 2752 * <pre> 2753 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2754 * when control plane operations are called on the secret or its versions. 2755 * </pre> 2756 * 2757 * <code> 2758 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2759 * </code> 2760 */ addTopics( int index, com.google.cloud.secretmanager.v1.Topic.Builder builderForValue)2761 public Builder addTopics( 2762 int index, com.google.cloud.secretmanager.v1.Topic.Builder builderForValue) { 2763 if (topicsBuilder_ == null) { 2764 ensureTopicsIsMutable(); 2765 topics_.add(index, builderForValue.build()); 2766 onChanged(); 2767 } else { 2768 topicsBuilder_.addMessage(index, builderForValue.build()); 2769 } 2770 return this; 2771 } 2772 /** 2773 * 2774 * 2775 * <pre> 2776 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2777 * when control plane operations are called on the secret or its versions. 2778 * </pre> 2779 * 2780 * <code> 2781 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2782 * </code> 2783 */ addAllTopics( java.lang.Iterable<? extends com.google.cloud.secretmanager.v1.Topic> values)2784 public Builder addAllTopics( 2785 java.lang.Iterable<? extends com.google.cloud.secretmanager.v1.Topic> values) { 2786 if (topicsBuilder_ == null) { 2787 ensureTopicsIsMutable(); 2788 com.google.protobuf.AbstractMessageLite.Builder.addAll(values, topics_); 2789 onChanged(); 2790 } else { 2791 topicsBuilder_.addAllMessages(values); 2792 } 2793 return this; 2794 } 2795 /** 2796 * 2797 * 2798 * <pre> 2799 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2800 * when control plane operations are called on the secret or its versions. 2801 * </pre> 2802 * 2803 * <code> 2804 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2805 * </code> 2806 */ clearTopics()2807 public Builder clearTopics() { 2808 if (topicsBuilder_ == null) { 2809 topics_ = java.util.Collections.emptyList(); 2810 bitField0_ = (bitField0_ & ~0x00000010); 2811 onChanged(); 2812 } else { 2813 topicsBuilder_.clear(); 2814 } 2815 return this; 2816 } 2817 /** 2818 * 2819 * 2820 * <pre> 2821 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2822 * when control plane operations are called on the secret or its versions. 2823 * </pre> 2824 * 2825 * <code> 2826 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2827 * </code> 2828 */ removeTopics(int index)2829 public Builder removeTopics(int index) { 2830 if (topicsBuilder_ == null) { 2831 ensureTopicsIsMutable(); 2832 topics_.remove(index); 2833 onChanged(); 2834 } else { 2835 topicsBuilder_.remove(index); 2836 } 2837 return this; 2838 } 2839 /** 2840 * 2841 * 2842 * <pre> 2843 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2844 * when control plane operations are called on the secret or its versions. 2845 * </pre> 2846 * 2847 * <code> 2848 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2849 * </code> 2850 */ getTopicsBuilder(int index)2851 public com.google.cloud.secretmanager.v1.Topic.Builder getTopicsBuilder(int index) { 2852 return getTopicsFieldBuilder().getBuilder(index); 2853 } 2854 /** 2855 * 2856 * 2857 * <pre> 2858 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2859 * when control plane operations are called on the secret or its versions. 2860 * </pre> 2861 * 2862 * <code> 2863 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2864 * </code> 2865 */ getTopicsOrBuilder(int index)2866 public com.google.cloud.secretmanager.v1.TopicOrBuilder getTopicsOrBuilder(int index) { 2867 if (topicsBuilder_ == null) { 2868 return topics_.get(index); 2869 } else { 2870 return topicsBuilder_.getMessageOrBuilder(index); 2871 } 2872 } 2873 /** 2874 * 2875 * 2876 * <pre> 2877 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2878 * when control plane operations are called on the secret or its versions. 2879 * </pre> 2880 * 2881 * <code> 2882 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2883 * </code> 2884 */ 2885 public java.util.List<? extends com.google.cloud.secretmanager.v1.TopicOrBuilder> getTopicsOrBuilderList()2886 getTopicsOrBuilderList() { 2887 if (topicsBuilder_ != null) { 2888 return topicsBuilder_.getMessageOrBuilderList(); 2889 } else { 2890 return java.util.Collections.unmodifiableList(topics_); 2891 } 2892 } 2893 /** 2894 * 2895 * 2896 * <pre> 2897 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2898 * when control plane operations are called on the secret or its versions. 2899 * </pre> 2900 * 2901 * <code> 2902 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2903 * </code> 2904 */ addTopicsBuilder()2905 public com.google.cloud.secretmanager.v1.Topic.Builder addTopicsBuilder() { 2906 return getTopicsFieldBuilder() 2907 .addBuilder(com.google.cloud.secretmanager.v1.Topic.getDefaultInstance()); 2908 } 2909 /** 2910 * 2911 * 2912 * <pre> 2913 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2914 * when control plane operations are called on the secret or its versions. 2915 * </pre> 2916 * 2917 * <code> 2918 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2919 * </code> 2920 */ addTopicsBuilder(int index)2921 public com.google.cloud.secretmanager.v1.Topic.Builder addTopicsBuilder(int index) { 2922 return getTopicsFieldBuilder() 2923 .addBuilder(index, com.google.cloud.secretmanager.v1.Topic.getDefaultInstance()); 2924 } 2925 /** 2926 * 2927 * 2928 * <pre> 2929 * Optional. A list of up to 10 Pub/Sub topics to which messages are published 2930 * when control plane operations are called on the secret or its versions. 2931 * </pre> 2932 * 2933 * <code> 2934 * repeated .google.cloud.secretmanager.v1.Topic topics = 5 [(.google.api.field_behavior) = OPTIONAL]; 2935 * </code> 2936 */ getTopicsBuilderList()2937 public java.util.List<com.google.cloud.secretmanager.v1.Topic.Builder> getTopicsBuilderList() { 2938 return getTopicsFieldBuilder().getBuilderList(); 2939 } 2940 2941 private com.google.protobuf.RepeatedFieldBuilderV3< 2942 com.google.cloud.secretmanager.v1.Topic, 2943 com.google.cloud.secretmanager.v1.Topic.Builder, 2944 com.google.cloud.secretmanager.v1.TopicOrBuilder> getTopicsFieldBuilder()2945 getTopicsFieldBuilder() { 2946 if (topicsBuilder_ == null) { 2947 topicsBuilder_ = 2948 new com.google.protobuf.RepeatedFieldBuilderV3< 2949 com.google.cloud.secretmanager.v1.Topic, 2950 com.google.cloud.secretmanager.v1.Topic.Builder, 2951 com.google.cloud.secretmanager.v1.TopicOrBuilder>( 2952 topics_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); 2953 topics_ = null; 2954 } 2955 return topicsBuilder_; 2956 } 2957 2958 private com.google.protobuf.SingleFieldBuilderV3< 2959 com.google.protobuf.Timestamp, 2960 com.google.protobuf.Timestamp.Builder, 2961 com.google.protobuf.TimestampOrBuilder> 2962 expireTimeBuilder_; 2963 /** 2964 * 2965 * 2966 * <pre> 2967 * Optional. Timestamp in UTC when the 2968 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 2969 * This is always provided on output, regardless of what was sent on input. 2970 * </pre> 2971 * 2972 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 2973 * </code> 2974 * 2975 * @return Whether the expireTime field is set. 2976 */ 2977 @java.lang.Override hasExpireTime()2978 public boolean hasExpireTime() { 2979 return expirationCase_ == 6; 2980 } 2981 /** 2982 * 2983 * 2984 * <pre> 2985 * Optional. Timestamp in UTC when the 2986 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 2987 * This is always provided on output, regardless of what was sent on input. 2988 * </pre> 2989 * 2990 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 2991 * </code> 2992 * 2993 * @return The expireTime. 2994 */ 2995 @java.lang.Override getExpireTime()2996 public com.google.protobuf.Timestamp getExpireTime() { 2997 if (expireTimeBuilder_ == null) { 2998 if (expirationCase_ == 6) { 2999 return (com.google.protobuf.Timestamp) expiration_; 3000 } 3001 return com.google.protobuf.Timestamp.getDefaultInstance(); 3002 } else { 3003 if (expirationCase_ == 6) { 3004 return expireTimeBuilder_.getMessage(); 3005 } 3006 return com.google.protobuf.Timestamp.getDefaultInstance(); 3007 } 3008 } 3009 /** 3010 * 3011 * 3012 * <pre> 3013 * Optional. Timestamp in UTC when the 3014 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3015 * This is always provided on output, regardless of what was sent on input. 3016 * </pre> 3017 * 3018 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3019 * </code> 3020 */ setExpireTime(com.google.protobuf.Timestamp value)3021 public Builder setExpireTime(com.google.protobuf.Timestamp value) { 3022 if (expireTimeBuilder_ == null) { 3023 if (value == null) { 3024 throw new NullPointerException(); 3025 } 3026 expiration_ = value; 3027 onChanged(); 3028 } else { 3029 expireTimeBuilder_.setMessage(value); 3030 } 3031 expirationCase_ = 6; 3032 return this; 3033 } 3034 /** 3035 * 3036 * 3037 * <pre> 3038 * Optional. Timestamp in UTC when the 3039 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3040 * This is always provided on output, regardless of what was sent on input. 3041 * </pre> 3042 * 3043 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3044 * </code> 3045 */ setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue)3046 public Builder setExpireTime(com.google.protobuf.Timestamp.Builder builderForValue) { 3047 if (expireTimeBuilder_ == null) { 3048 expiration_ = builderForValue.build(); 3049 onChanged(); 3050 } else { 3051 expireTimeBuilder_.setMessage(builderForValue.build()); 3052 } 3053 expirationCase_ = 6; 3054 return this; 3055 } 3056 /** 3057 * 3058 * 3059 * <pre> 3060 * Optional. Timestamp in UTC when the 3061 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3062 * This is always provided on output, regardless of what was sent on input. 3063 * </pre> 3064 * 3065 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3066 * </code> 3067 */ mergeExpireTime(com.google.protobuf.Timestamp value)3068 public Builder mergeExpireTime(com.google.protobuf.Timestamp value) { 3069 if (expireTimeBuilder_ == null) { 3070 if (expirationCase_ == 6 3071 && expiration_ != com.google.protobuf.Timestamp.getDefaultInstance()) { 3072 expiration_ = 3073 com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) expiration_) 3074 .mergeFrom(value) 3075 .buildPartial(); 3076 } else { 3077 expiration_ = value; 3078 } 3079 onChanged(); 3080 } else { 3081 if (expirationCase_ == 6) { 3082 expireTimeBuilder_.mergeFrom(value); 3083 } else { 3084 expireTimeBuilder_.setMessage(value); 3085 } 3086 } 3087 expirationCase_ = 6; 3088 return this; 3089 } 3090 /** 3091 * 3092 * 3093 * <pre> 3094 * Optional. Timestamp in UTC when the 3095 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3096 * This is always provided on output, regardless of what was sent on input. 3097 * </pre> 3098 * 3099 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3100 * </code> 3101 */ clearExpireTime()3102 public Builder clearExpireTime() { 3103 if (expireTimeBuilder_ == null) { 3104 if (expirationCase_ == 6) { 3105 expirationCase_ = 0; 3106 expiration_ = null; 3107 onChanged(); 3108 } 3109 } else { 3110 if (expirationCase_ == 6) { 3111 expirationCase_ = 0; 3112 expiration_ = null; 3113 } 3114 expireTimeBuilder_.clear(); 3115 } 3116 return this; 3117 } 3118 /** 3119 * 3120 * 3121 * <pre> 3122 * Optional. Timestamp in UTC when the 3123 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3124 * This is always provided on output, regardless of what was sent on input. 3125 * </pre> 3126 * 3127 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3128 * </code> 3129 */ getExpireTimeBuilder()3130 public com.google.protobuf.Timestamp.Builder getExpireTimeBuilder() { 3131 return getExpireTimeFieldBuilder().getBuilder(); 3132 } 3133 /** 3134 * 3135 * 3136 * <pre> 3137 * Optional. Timestamp in UTC when the 3138 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3139 * This is always provided on output, regardless of what was sent on input. 3140 * </pre> 3141 * 3142 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3143 * </code> 3144 */ 3145 @java.lang.Override getExpireTimeOrBuilder()3146 public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder() { 3147 if ((expirationCase_ == 6) && (expireTimeBuilder_ != null)) { 3148 return expireTimeBuilder_.getMessageOrBuilder(); 3149 } else { 3150 if (expirationCase_ == 6) { 3151 return (com.google.protobuf.Timestamp) expiration_; 3152 } 3153 return com.google.protobuf.Timestamp.getDefaultInstance(); 3154 } 3155 } 3156 /** 3157 * 3158 * 3159 * <pre> 3160 * Optional. Timestamp in UTC when the 3161 * [Secret][google.cloud.secretmanager.v1.Secret] is scheduled to expire. 3162 * This is always provided on output, regardless of what was sent on input. 3163 * </pre> 3164 * 3165 * <code>.google.protobuf.Timestamp expire_time = 6 [(.google.api.field_behavior) = OPTIONAL]; 3166 * </code> 3167 */ 3168 private com.google.protobuf.SingleFieldBuilderV3< 3169 com.google.protobuf.Timestamp, 3170 com.google.protobuf.Timestamp.Builder, 3171 com.google.protobuf.TimestampOrBuilder> getExpireTimeFieldBuilder()3172 getExpireTimeFieldBuilder() { 3173 if (expireTimeBuilder_ == null) { 3174 if (!(expirationCase_ == 6)) { 3175 expiration_ = com.google.protobuf.Timestamp.getDefaultInstance(); 3176 } 3177 expireTimeBuilder_ = 3178 new com.google.protobuf.SingleFieldBuilderV3< 3179 com.google.protobuf.Timestamp, 3180 com.google.protobuf.Timestamp.Builder, 3181 com.google.protobuf.TimestampOrBuilder>( 3182 (com.google.protobuf.Timestamp) expiration_, getParentForChildren(), isClean()); 3183 expiration_ = null; 3184 } 3185 expirationCase_ = 6; 3186 onChanged(); 3187 return expireTimeBuilder_; 3188 } 3189 3190 private com.google.protobuf.SingleFieldBuilderV3< 3191 com.google.protobuf.Duration, 3192 com.google.protobuf.Duration.Builder, 3193 com.google.protobuf.DurationOrBuilder> 3194 ttlBuilder_; 3195 /** 3196 * 3197 * 3198 * <pre> 3199 * Input only. The TTL for the 3200 * [Secret][google.cloud.secretmanager.v1.Secret]. 3201 * </pre> 3202 * 3203 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3204 * 3205 * @return Whether the ttl field is set. 3206 */ 3207 @java.lang.Override hasTtl()3208 public boolean hasTtl() { 3209 return expirationCase_ == 7; 3210 } 3211 /** 3212 * 3213 * 3214 * <pre> 3215 * Input only. The TTL for the 3216 * [Secret][google.cloud.secretmanager.v1.Secret]. 3217 * </pre> 3218 * 3219 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3220 * 3221 * @return The ttl. 3222 */ 3223 @java.lang.Override getTtl()3224 public com.google.protobuf.Duration getTtl() { 3225 if (ttlBuilder_ == null) { 3226 if (expirationCase_ == 7) { 3227 return (com.google.protobuf.Duration) expiration_; 3228 } 3229 return com.google.protobuf.Duration.getDefaultInstance(); 3230 } else { 3231 if (expirationCase_ == 7) { 3232 return ttlBuilder_.getMessage(); 3233 } 3234 return com.google.protobuf.Duration.getDefaultInstance(); 3235 } 3236 } 3237 /** 3238 * 3239 * 3240 * <pre> 3241 * Input only. The TTL for the 3242 * [Secret][google.cloud.secretmanager.v1.Secret]. 3243 * </pre> 3244 * 3245 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3246 */ setTtl(com.google.protobuf.Duration value)3247 public Builder setTtl(com.google.protobuf.Duration value) { 3248 if (ttlBuilder_ == null) { 3249 if (value == null) { 3250 throw new NullPointerException(); 3251 } 3252 expiration_ = value; 3253 onChanged(); 3254 } else { 3255 ttlBuilder_.setMessage(value); 3256 } 3257 expirationCase_ = 7; 3258 return this; 3259 } 3260 /** 3261 * 3262 * 3263 * <pre> 3264 * Input only. The TTL for the 3265 * [Secret][google.cloud.secretmanager.v1.Secret]. 3266 * </pre> 3267 * 3268 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3269 */ setTtl(com.google.protobuf.Duration.Builder builderForValue)3270 public Builder setTtl(com.google.protobuf.Duration.Builder builderForValue) { 3271 if (ttlBuilder_ == null) { 3272 expiration_ = builderForValue.build(); 3273 onChanged(); 3274 } else { 3275 ttlBuilder_.setMessage(builderForValue.build()); 3276 } 3277 expirationCase_ = 7; 3278 return this; 3279 } 3280 /** 3281 * 3282 * 3283 * <pre> 3284 * Input only. The TTL for the 3285 * [Secret][google.cloud.secretmanager.v1.Secret]. 3286 * </pre> 3287 * 3288 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3289 */ mergeTtl(com.google.protobuf.Duration value)3290 public Builder mergeTtl(com.google.protobuf.Duration value) { 3291 if (ttlBuilder_ == null) { 3292 if (expirationCase_ == 7 3293 && expiration_ != com.google.protobuf.Duration.getDefaultInstance()) { 3294 expiration_ = 3295 com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) expiration_) 3296 .mergeFrom(value) 3297 .buildPartial(); 3298 } else { 3299 expiration_ = value; 3300 } 3301 onChanged(); 3302 } else { 3303 if (expirationCase_ == 7) { 3304 ttlBuilder_.mergeFrom(value); 3305 } else { 3306 ttlBuilder_.setMessage(value); 3307 } 3308 } 3309 expirationCase_ = 7; 3310 return this; 3311 } 3312 /** 3313 * 3314 * 3315 * <pre> 3316 * Input only. The TTL for the 3317 * [Secret][google.cloud.secretmanager.v1.Secret]. 3318 * </pre> 3319 * 3320 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3321 */ clearTtl()3322 public Builder clearTtl() { 3323 if (ttlBuilder_ == null) { 3324 if (expirationCase_ == 7) { 3325 expirationCase_ = 0; 3326 expiration_ = null; 3327 onChanged(); 3328 } 3329 } else { 3330 if (expirationCase_ == 7) { 3331 expirationCase_ = 0; 3332 expiration_ = null; 3333 } 3334 ttlBuilder_.clear(); 3335 } 3336 return this; 3337 } 3338 /** 3339 * 3340 * 3341 * <pre> 3342 * Input only. The TTL for the 3343 * [Secret][google.cloud.secretmanager.v1.Secret]. 3344 * </pre> 3345 * 3346 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3347 */ getTtlBuilder()3348 public com.google.protobuf.Duration.Builder getTtlBuilder() { 3349 return getTtlFieldBuilder().getBuilder(); 3350 } 3351 /** 3352 * 3353 * 3354 * <pre> 3355 * Input only. The TTL for the 3356 * [Secret][google.cloud.secretmanager.v1.Secret]. 3357 * </pre> 3358 * 3359 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3360 */ 3361 @java.lang.Override getTtlOrBuilder()3362 public com.google.protobuf.DurationOrBuilder getTtlOrBuilder() { 3363 if ((expirationCase_ == 7) && (ttlBuilder_ != null)) { 3364 return ttlBuilder_.getMessageOrBuilder(); 3365 } else { 3366 if (expirationCase_ == 7) { 3367 return (com.google.protobuf.Duration) expiration_; 3368 } 3369 return com.google.protobuf.Duration.getDefaultInstance(); 3370 } 3371 } 3372 /** 3373 * 3374 * 3375 * <pre> 3376 * Input only. The TTL for the 3377 * [Secret][google.cloud.secretmanager.v1.Secret]. 3378 * </pre> 3379 * 3380 * <code>.google.protobuf.Duration ttl = 7 [(.google.api.field_behavior) = INPUT_ONLY];</code> 3381 */ 3382 private com.google.protobuf.SingleFieldBuilderV3< 3383 com.google.protobuf.Duration, 3384 com.google.protobuf.Duration.Builder, 3385 com.google.protobuf.DurationOrBuilder> getTtlFieldBuilder()3386 getTtlFieldBuilder() { 3387 if (ttlBuilder_ == null) { 3388 if (!(expirationCase_ == 7)) { 3389 expiration_ = com.google.protobuf.Duration.getDefaultInstance(); 3390 } 3391 ttlBuilder_ = 3392 new com.google.protobuf.SingleFieldBuilderV3< 3393 com.google.protobuf.Duration, 3394 com.google.protobuf.Duration.Builder, 3395 com.google.protobuf.DurationOrBuilder>( 3396 (com.google.protobuf.Duration) expiration_, getParentForChildren(), isClean()); 3397 expiration_ = null; 3398 } 3399 expirationCase_ = 7; 3400 onChanged(); 3401 return ttlBuilder_; 3402 } 3403 3404 private java.lang.Object etag_ = ""; 3405 /** 3406 * 3407 * 3408 * <pre> 3409 * Optional. Etag of the currently stored 3410 * [Secret][google.cloud.secretmanager.v1.Secret]. 3411 * </pre> 3412 * 3413 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 3414 * 3415 * @return The etag. 3416 */ getEtag()3417 public java.lang.String getEtag() { 3418 java.lang.Object ref = etag_; 3419 if (!(ref instanceof java.lang.String)) { 3420 com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; 3421 java.lang.String s = bs.toStringUtf8(); 3422 etag_ = s; 3423 return s; 3424 } else { 3425 return (java.lang.String) ref; 3426 } 3427 } 3428 /** 3429 * 3430 * 3431 * <pre> 3432 * Optional. Etag of the currently stored 3433 * [Secret][google.cloud.secretmanager.v1.Secret]. 3434 * </pre> 3435 * 3436 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 3437 * 3438 * @return The bytes for etag. 3439 */ getEtagBytes()3440 public com.google.protobuf.ByteString getEtagBytes() { 3441 java.lang.Object ref = etag_; 3442 if (ref instanceof String) { 3443 com.google.protobuf.ByteString b = 3444 com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); 3445 etag_ = b; 3446 return b; 3447 } else { 3448 return (com.google.protobuf.ByteString) ref; 3449 } 3450 } 3451 /** 3452 * 3453 * 3454 * <pre> 3455 * Optional. Etag of the currently stored 3456 * [Secret][google.cloud.secretmanager.v1.Secret]. 3457 * </pre> 3458 * 3459 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 3460 * 3461 * @param value The etag to set. 3462 * @return This builder for chaining. 3463 */ setEtag(java.lang.String value)3464 public Builder setEtag(java.lang.String value) { 3465 if (value == null) { 3466 throw new NullPointerException(); 3467 } 3468 etag_ = value; 3469 bitField0_ |= 0x00000080; 3470 onChanged(); 3471 return this; 3472 } 3473 /** 3474 * 3475 * 3476 * <pre> 3477 * Optional. Etag of the currently stored 3478 * [Secret][google.cloud.secretmanager.v1.Secret]. 3479 * </pre> 3480 * 3481 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 3482 * 3483 * @return This builder for chaining. 3484 */ clearEtag()3485 public Builder clearEtag() { 3486 etag_ = getDefaultInstance().getEtag(); 3487 bitField0_ = (bitField0_ & ~0x00000080); 3488 onChanged(); 3489 return this; 3490 } 3491 /** 3492 * 3493 * 3494 * <pre> 3495 * Optional. Etag of the currently stored 3496 * [Secret][google.cloud.secretmanager.v1.Secret]. 3497 * </pre> 3498 * 3499 * <code>string etag = 8 [(.google.api.field_behavior) = OPTIONAL];</code> 3500 * 3501 * @param value The bytes for etag to set. 3502 * @return This builder for chaining. 3503 */ setEtagBytes(com.google.protobuf.ByteString value)3504 public Builder setEtagBytes(com.google.protobuf.ByteString value) { 3505 if (value == null) { 3506 throw new NullPointerException(); 3507 } 3508 checkByteStringIsUtf8(value); 3509 etag_ = value; 3510 bitField0_ |= 0x00000080; 3511 onChanged(); 3512 return this; 3513 } 3514 3515 private com.google.cloud.secretmanager.v1.Rotation rotation_; 3516 private com.google.protobuf.SingleFieldBuilderV3< 3517 com.google.cloud.secretmanager.v1.Rotation, 3518 com.google.cloud.secretmanager.v1.Rotation.Builder, 3519 com.google.cloud.secretmanager.v1.RotationOrBuilder> 3520 rotationBuilder_; 3521 /** 3522 * 3523 * 3524 * <pre> 3525 * Optional. Rotation policy attached to the 3526 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3527 * no rotation policy. 3528 * </pre> 3529 * 3530 * <code> 3531 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3532 * </code> 3533 * 3534 * @return Whether the rotation field is set. 3535 */ hasRotation()3536 public boolean hasRotation() { 3537 return ((bitField0_ & 0x00000100) != 0); 3538 } 3539 /** 3540 * 3541 * 3542 * <pre> 3543 * Optional. Rotation policy attached to the 3544 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3545 * no rotation policy. 3546 * </pre> 3547 * 3548 * <code> 3549 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3550 * </code> 3551 * 3552 * @return The rotation. 3553 */ getRotation()3554 public com.google.cloud.secretmanager.v1.Rotation getRotation() { 3555 if (rotationBuilder_ == null) { 3556 return rotation_ == null 3557 ? com.google.cloud.secretmanager.v1.Rotation.getDefaultInstance() 3558 : rotation_; 3559 } else { 3560 return rotationBuilder_.getMessage(); 3561 } 3562 } 3563 /** 3564 * 3565 * 3566 * <pre> 3567 * Optional. Rotation policy attached to the 3568 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3569 * no rotation policy. 3570 * </pre> 3571 * 3572 * <code> 3573 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3574 * </code> 3575 */ setRotation(com.google.cloud.secretmanager.v1.Rotation value)3576 public Builder setRotation(com.google.cloud.secretmanager.v1.Rotation value) { 3577 if (rotationBuilder_ == null) { 3578 if (value == null) { 3579 throw new NullPointerException(); 3580 } 3581 rotation_ = value; 3582 } else { 3583 rotationBuilder_.setMessage(value); 3584 } 3585 bitField0_ |= 0x00000100; 3586 onChanged(); 3587 return this; 3588 } 3589 /** 3590 * 3591 * 3592 * <pre> 3593 * Optional. Rotation policy attached to the 3594 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3595 * no rotation policy. 3596 * </pre> 3597 * 3598 * <code> 3599 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3600 * </code> 3601 */ setRotation(com.google.cloud.secretmanager.v1.Rotation.Builder builderForValue)3602 public Builder setRotation(com.google.cloud.secretmanager.v1.Rotation.Builder builderForValue) { 3603 if (rotationBuilder_ == null) { 3604 rotation_ = builderForValue.build(); 3605 } else { 3606 rotationBuilder_.setMessage(builderForValue.build()); 3607 } 3608 bitField0_ |= 0x00000100; 3609 onChanged(); 3610 return this; 3611 } 3612 /** 3613 * 3614 * 3615 * <pre> 3616 * Optional. Rotation policy attached to the 3617 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3618 * no rotation policy. 3619 * </pre> 3620 * 3621 * <code> 3622 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3623 * </code> 3624 */ mergeRotation(com.google.cloud.secretmanager.v1.Rotation value)3625 public Builder mergeRotation(com.google.cloud.secretmanager.v1.Rotation value) { 3626 if (rotationBuilder_ == null) { 3627 if (((bitField0_ & 0x00000100) != 0) 3628 && rotation_ != null 3629 && rotation_ != com.google.cloud.secretmanager.v1.Rotation.getDefaultInstance()) { 3630 getRotationBuilder().mergeFrom(value); 3631 } else { 3632 rotation_ = value; 3633 } 3634 } else { 3635 rotationBuilder_.mergeFrom(value); 3636 } 3637 bitField0_ |= 0x00000100; 3638 onChanged(); 3639 return this; 3640 } 3641 /** 3642 * 3643 * 3644 * <pre> 3645 * Optional. Rotation policy attached to the 3646 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3647 * no rotation policy. 3648 * </pre> 3649 * 3650 * <code> 3651 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3652 * </code> 3653 */ clearRotation()3654 public Builder clearRotation() { 3655 bitField0_ = (bitField0_ & ~0x00000100); 3656 rotation_ = null; 3657 if (rotationBuilder_ != null) { 3658 rotationBuilder_.dispose(); 3659 rotationBuilder_ = null; 3660 } 3661 onChanged(); 3662 return this; 3663 } 3664 /** 3665 * 3666 * 3667 * <pre> 3668 * Optional. Rotation policy attached to the 3669 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3670 * no rotation policy. 3671 * </pre> 3672 * 3673 * <code> 3674 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3675 * </code> 3676 */ getRotationBuilder()3677 public com.google.cloud.secretmanager.v1.Rotation.Builder getRotationBuilder() { 3678 bitField0_ |= 0x00000100; 3679 onChanged(); 3680 return getRotationFieldBuilder().getBuilder(); 3681 } 3682 /** 3683 * 3684 * 3685 * <pre> 3686 * Optional. Rotation policy attached to the 3687 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3688 * no rotation policy. 3689 * </pre> 3690 * 3691 * <code> 3692 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3693 * </code> 3694 */ getRotationOrBuilder()3695 public com.google.cloud.secretmanager.v1.RotationOrBuilder getRotationOrBuilder() { 3696 if (rotationBuilder_ != null) { 3697 return rotationBuilder_.getMessageOrBuilder(); 3698 } else { 3699 return rotation_ == null 3700 ? com.google.cloud.secretmanager.v1.Rotation.getDefaultInstance() 3701 : rotation_; 3702 } 3703 } 3704 /** 3705 * 3706 * 3707 * <pre> 3708 * Optional. Rotation policy attached to the 3709 * [Secret][google.cloud.secretmanager.v1.Secret]. May be excluded if there is 3710 * no rotation policy. 3711 * </pre> 3712 * 3713 * <code> 3714 * .google.cloud.secretmanager.v1.Rotation rotation = 9 [(.google.api.field_behavior) = OPTIONAL]; 3715 * </code> 3716 */ 3717 private com.google.protobuf.SingleFieldBuilderV3< 3718 com.google.cloud.secretmanager.v1.Rotation, 3719 com.google.cloud.secretmanager.v1.Rotation.Builder, 3720 com.google.cloud.secretmanager.v1.RotationOrBuilder> getRotationFieldBuilder()3721 getRotationFieldBuilder() { 3722 if (rotationBuilder_ == null) { 3723 rotationBuilder_ = 3724 new com.google.protobuf.SingleFieldBuilderV3< 3725 com.google.cloud.secretmanager.v1.Rotation, 3726 com.google.cloud.secretmanager.v1.Rotation.Builder, 3727 com.google.cloud.secretmanager.v1.RotationOrBuilder>( 3728 getRotation(), getParentForChildren(), isClean()); 3729 rotation_ = null; 3730 } 3731 return rotationBuilder_; 3732 } 3733 3734 private com.google.protobuf.MapField<java.lang.String, java.lang.Long> versionAliases_; 3735 3736 private com.google.protobuf.MapField<java.lang.String, java.lang.Long> internalGetVersionAliases()3737 internalGetVersionAliases() { 3738 if (versionAliases_ == null) { 3739 return com.google.protobuf.MapField.emptyMapField( 3740 VersionAliasesDefaultEntryHolder.defaultEntry); 3741 } 3742 return versionAliases_; 3743 } 3744 3745 private com.google.protobuf.MapField<java.lang.String, java.lang.Long> internalGetMutableVersionAliases()3746 internalGetMutableVersionAliases() { 3747 if (versionAliases_ == null) { 3748 versionAliases_ = 3749 com.google.protobuf.MapField.newMapField(VersionAliasesDefaultEntryHolder.defaultEntry); 3750 } 3751 if (!versionAliases_.isMutable()) { 3752 versionAliases_ = versionAliases_.copy(); 3753 } 3754 bitField0_ |= 0x00000200; 3755 onChanged(); 3756 return versionAliases_; 3757 } 3758 getVersionAliasesCount()3759 public int getVersionAliasesCount() { 3760 return internalGetVersionAliases().getMap().size(); 3761 } 3762 /** 3763 * 3764 * 3765 * <pre> 3766 * Optional. Mapping from version alias to version name. 3767 * A version alias is a string with a maximum length of 63 characters and can 3768 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3769 * and underscore ('_') characters. An alias string must start with a 3770 * letter and cannot be the string 'latest' or 'NEW'. 3771 * No more than 50 aliases can be assigned to a given secret. 3772 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3773 * UpdateSecret. At launch access by alias will only be supported on 3774 * GetSecretVersion and AccessSecretVersion. 3775 * </pre> 3776 * 3777 * <code> 3778 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3779 * </code> 3780 */ 3781 @java.lang.Override containsVersionAliases(java.lang.String key)3782 public boolean containsVersionAliases(java.lang.String key) { 3783 if (key == null) { 3784 throw new NullPointerException("map key"); 3785 } 3786 return internalGetVersionAliases().getMap().containsKey(key); 3787 } 3788 /** Use {@link #getVersionAliasesMap()} instead. */ 3789 @java.lang.Override 3790 @java.lang.Deprecated getVersionAliases()3791 public java.util.Map<java.lang.String, java.lang.Long> getVersionAliases() { 3792 return getVersionAliasesMap(); 3793 } 3794 /** 3795 * 3796 * 3797 * <pre> 3798 * Optional. Mapping from version alias to version name. 3799 * A version alias is a string with a maximum length of 63 characters and can 3800 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3801 * and underscore ('_') characters. An alias string must start with a 3802 * letter and cannot be the string 'latest' or 'NEW'. 3803 * No more than 50 aliases can be assigned to a given secret. 3804 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3805 * UpdateSecret. At launch access by alias will only be supported on 3806 * GetSecretVersion and AccessSecretVersion. 3807 * </pre> 3808 * 3809 * <code> 3810 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3811 * </code> 3812 */ 3813 @java.lang.Override getVersionAliasesMap()3814 public java.util.Map<java.lang.String, java.lang.Long> getVersionAliasesMap() { 3815 return internalGetVersionAliases().getMap(); 3816 } 3817 /** 3818 * 3819 * 3820 * <pre> 3821 * Optional. Mapping from version alias to version name. 3822 * A version alias is a string with a maximum length of 63 characters and can 3823 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3824 * and underscore ('_') characters. An alias string must start with a 3825 * letter and cannot be the string 'latest' or 'NEW'. 3826 * No more than 50 aliases can be assigned to a given secret. 3827 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3828 * UpdateSecret. At launch access by alias will only be supported on 3829 * GetSecretVersion and AccessSecretVersion. 3830 * </pre> 3831 * 3832 * <code> 3833 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3834 * </code> 3835 */ 3836 @java.lang.Override getVersionAliasesOrDefault(java.lang.String key, long defaultValue)3837 public long getVersionAliasesOrDefault(java.lang.String key, long defaultValue) { 3838 if (key == null) { 3839 throw new NullPointerException("map key"); 3840 } 3841 java.util.Map<java.lang.String, java.lang.Long> map = internalGetVersionAliases().getMap(); 3842 return map.containsKey(key) ? map.get(key) : defaultValue; 3843 } 3844 /** 3845 * 3846 * 3847 * <pre> 3848 * Optional. Mapping from version alias to version name. 3849 * A version alias is a string with a maximum length of 63 characters and can 3850 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3851 * and underscore ('_') characters. An alias string must start with a 3852 * letter and cannot be the string 'latest' or 'NEW'. 3853 * No more than 50 aliases can be assigned to a given secret. 3854 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3855 * UpdateSecret. At launch access by alias will only be supported on 3856 * GetSecretVersion and AccessSecretVersion. 3857 * </pre> 3858 * 3859 * <code> 3860 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3861 * </code> 3862 */ 3863 @java.lang.Override getVersionAliasesOrThrow(java.lang.String key)3864 public long getVersionAliasesOrThrow(java.lang.String key) { 3865 if (key == null) { 3866 throw new NullPointerException("map key"); 3867 } 3868 java.util.Map<java.lang.String, java.lang.Long> map = internalGetVersionAliases().getMap(); 3869 if (!map.containsKey(key)) { 3870 throw new java.lang.IllegalArgumentException(); 3871 } 3872 return map.get(key); 3873 } 3874 clearVersionAliases()3875 public Builder clearVersionAliases() { 3876 bitField0_ = (bitField0_ & ~0x00000200); 3877 internalGetMutableVersionAliases().getMutableMap().clear(); 3878 return this; 3879 } 3880 /** 3881 * 3882 * 3883 * <pre> 3884 * Optional. Mapping from version alias to version name. 3885 * A version alias is a string with a maximum length of 63 characters and can 3886 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3887 * and underscore ('_') characters. An alias string must start with a 3888 * letter and cannot be the string 'latest' or 'NEW'. 3889 * No more than 50 aliases can be assigned to a given secret. 3890 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3891 * UpdateSecret. At launch access by alias will only be supported on 3892 * GetSecretVersion and AccessSecretVersion. 3893 * </pre> 3894 * 3895 * <code> 3896 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3897 * </code> 3898 */ removeVersionAliases(java.lang.String key)3899 public Builder removeVersionAliases(java.lang.String key) { 3900 if (key == null) { 3901 throw new NullPointerException("map key"); 3902 } 3903 internalGetMutableVersionAliases().getMutableMap().remove(key); 3904 return this; 3905 } 3906 /** Use alternate mutation accessors instead. */ 3907 @java.lang.Deprecated getMutableVersionAliases()3908 public java.util.Map<java.lang.String, java.lang.Long> getMutableVersionAliases() { 3909 bitField0_ |= 0x00000200; 3910 return internalGetMutableVersionAliases().getMutableMap(); 3911 } 3912 /** 3913 * 3914 * 3915 * <pre> 3916 * Optional. Mapping from version alias to version name. 3917 * A version alias is a string with a maximum length of 63 characters and can 3918 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3919 * and underscore ('_') characters. An alias string must start with a 3920 * letter and cannot be the string 'latest' or 'NEW'. 3921 * No more than 50 aliases can be assigned to a given secret. 3922 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3923 * UpdateSecret. At launch access by alias will only be supported on 3924 * GetSecretVersion and AccessSecretVersion. 3925 * </pre> 3926 * 3927 * <code> 3928 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3929 * </code> 3930 */ putVersionAliases(java.lang.String key, long value)3931 public Builder putVersionAliases(java.lang.String key, long value) { 3932 if (key == null) { 3933 throw new NullPointerException("map key"); 3934 } 3935 3936 internalGetMutableVersionAliases().getMutableMap().put(key, value); 3937 bitField0_ |= 0x00000200; 3938 return this; 3939 } 3940 /** 3941 * 3942 * 3943 * <pre> 3944 * Optional. Mapping from version alias to version name. 3945 * A version alias is a string with a maximum length of 63 characters and can 3946 * contain uppercase and lowercase letters, numerals, and the hyphen (`-`) 3947 * and underscore ('_') characters. An alias string must start with a 3948 * letter and cannot be the string 'latest' or 'NEW'. 3949 * No more than 50 aliases can be assigned to a given secret. 3950 * Version-Alias pairs will be viewable via GetSecret and modifiable via 3951 * UpdateSecret. At launch access by alias will only be supported on 3952 * GetSecretVersion and AccessSecretVersion. 3953 * </pre> 3954 * 3955 * <code> 3956 * map<string, int64> version_aliases = 11 [(.google.api.field_behavior) = OPTIONAL]; 3957 * </code> 3958 */ putAllVersionAliases(java.util.Map<java.lang.String, java.lang.Long> values)3959 public Builder putAllVersionAliases(java.util.Map<java.lang.String, java.lang.Long> values) { 3960 internalGetMutableVersionAliases().getMutableMap().putAll(values); 3961 bitField0_ |= 0x00000200; 3962 return this; 3963 } 3964 3965 private com.google.protobuf.MapField<java.lang.String, java.lang.String> annotations_; 3966 3967 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetAnnotations()3968 internalGetAnnotations() { 3969 if (annotations_ == null) { 3970 return com.google.protobuf.MapField.emptyMapField( 3971 AnnotationsDefaultEntryHolder.defaultEntry); 3972 } 3973 return annotations_; 3974 } 3975 3976 private com.google.protobuf.MapField<java.lang.String, java.lang.String> internalGetMutableAnnotations()3977 internalGetMutableAnnotations() { 3978 if (annotations_ == null) { 3979 annotations_ = 3980 com.google.protobuf.MapField.newMapField(AnnotationsDefaultEntryHolder.defaultEntry); 3981 } 3982 if (!annotations_.isMutable()) { 3983 annotations_ = annotations_.copy(); 3984 } 3985 bitField0_ |= 0x00000400; 3986 onChanged(); 3987 return annotations_; 3988 } 3989 getAnnotationsCount()3990 public int getAnnotationsCount() { 3991 return internalGetAnnotations().getMap().size(); 3992 } 3993 /** 3994 * 3995 * 3996 * <pre> 3997 * Optional. Custom metadata about the secret. 3998 * Annotations are distinct from various forms of labels. 3999 * Annotations exist to allow client tools to store their own state 4000 * information without requiring a database. 4001 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4002 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4003 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4004 * alphanumerics in between these symbols. 4005 * The total size of annotation keys and values must be less than 16KiB. 4006 * </pre> 4007 * 4008 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4009 * </code> 4010 */ 4011 @java.lang.Override containsAnnotations(java.lang.String key)4012 public boolean containsAnnotations(java.lang.String key) { 4013 if (key == null) { 4014 throw new NullPointerException("map key"); 4015 } 4016 return internalGetAnnotations().getMap().containsKey(key); 4017 } 4018 /** Use {@link #getAnnotationsMap()} instead. */ 4019 @java.lang.Override 4020 @java.lang.Deprecated getAnnotations()4021 public java.util.Map<java.lang.String, java.lang.String> getAnnotations() { 4022 return getAnnotationsMap(); 4023 } 4024 /** 4025 * 4026 * 4027 * <pre> 4028 * Optional. Custom metadata about the secret. 4029 * Annotations are distinct from various forms of labels. 4030 * Annotations exist to allow client tools to store their own state 4031 * information without requiring a database. 4032 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4033 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4034 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4035 * alphanumerics in between these symbols. 4036 * The total size of annotation keys and values must be less than 16KiB. 4037 * </pre> 4038 * 4039 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4040 * </code> 4041 */ 4042 @java.lang.Override getAnnotationsMap()4043 public java.util.Map<java.lang.String, java.lang.String> getAnnotationsMap() { 4044 return internalGetAnnotations().getMap(); 4045 } 4046 /** 4047 * 4048 * 4049 * <pre> 4050 * Optional. Custom metadata about the secret. 4051 * Annotations are distinct from various forms of labels. 4052 * Annotations exist to allow client tools to store their own state 4053 * information without requiring a database. 4054 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4055 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4056 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4057 * alphanumerics in between these symbols. 4058 * The total size of annotation keys and values must be less than 16KiB. 4059 * </pre> 4060 * 4061 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4062 * </code> 4063 */ 4064 @java.lang.Override getAnnotationsOrDefault( java.lang.String key, java.lang.String defaultValue)4065 public /* nullable */ java.lang.String getAnnotationsOrDefault( 4066 java.lang.String key, 4067 /* nullable */ 4068 java.lang.String defaultValue) { 4069 if (key == null) { 4070 throw new NullPointerException("map key"); 4071 } 4072 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 4073 return map.containsKey(key) ? map.get(key) : defaultValue; 4074 } 4075 /** 4076 * 4077 * 4078 * <pre> 4079 * Optional. Custom metadata about the secret. 4080 * Annotations are distinct from various forms of labels. 4081 * Annotations exist to allow client tools to store their own state 4082 * information without requiring a database. 4083 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4084 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4085 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4086 * alphanumerics in between these symbols. 4087 * The total size of annotation keys and values must be less than 16KiB. 4088 * </pre> 4089 * 4090 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4091 * </code> 4092 */ 4093 @java.lang.Override getAnnotationsOrThrow(java.lang.String key)4094 public java.lang.String getAnnotationsOrThrow(java.lang.String key) { 4095 if (key == null) { 4096 throw new NullPointerException("map key"); 4097 } 4098 java.util.Map<java.lang.String, java.lang.String> map = internalGetAnnotations().getMap(); 4099 if (!map.containsKey(key)) { 4100 throw new java.lang.IllegalArgumentException(); 4101 } 4102 return map.get(key); 4103 } 4104 clearAnnotations()4105 public Builder clearAnnotations() { 4106 bitField0_ = (bitField0_ & ~0x00000400); 4107 internalGetMutableAnnotations().getMutableMap().clear(); 4108 return this; 4109 } 4110 /** 4111 * 4112 * 4113 * <pre> 4114 * Optional. Custom metadata about the secret. 4115 * Annotations are distinct from various forms of labels. 4116 * Annotations exist to allow client tools to store their own state 4117 * information without requiring a database. 4118 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4119 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4120 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4121 * alphanumerics in between these symbols. 4122 * The total size of annotation keys and values must be less than 16KiB. 4123 * </pre> 4124 * 4125 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4126 * </code> 4127 */ removeAnnotations(java.lang.String key)4128 public Builder removeAnnotations(java.lang.String key) { 4129 if (key == null) { 4130 throw new NullPointerException("map key"); 4131 } 4132 internalGetMutableAnnotations().getMutableMap().remove(key); 4133 return this; 4134 } 4135 /** Use alternate mutation accessors instead. */ 4136 @java.lang.Deprecated getMutableAnnotations()4137 public java.util.Map<java.lang.String, java.lang.String> getMutableAnnotations() { 4138 bitField0_ |= 0x00000400; 4139 return internalGetMutableAnnotations().getMutableMap(); 4140 } 4141 /** 4142 * 4143 * 4144 * <pre> 4145 * Optional. Custom metadata about the secret. 4146 * Annotations are distinct from various forms of labels. 4147 * Annotations exist to allow client tools to store their own state 4148 * information without requiring a database. 4149 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4150 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4151 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4152 * alphanumerics in between these symbols. 4153 * The total size of annotation keys and values must be less than 16KiB. 4154 * </pre> 4155 * 4156 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4157 * </code> 4158 */ putAnnotations(java.lang.String key, java.lang.String value)4159 public Builder putAnnotations(java.lang.String key, java.lang.String value) { 4160 if (key == null) { 4161 throw new NullPointerException("map key"); 4162 } 4163 if (value == null) { 4164 throw new NullPointerException("map value"); 4165 } 4166 internalGetMutableAnnotations().getMutableMap().put(key, value); 4167 bitField0_ |= 0x00000400; 4168 return this; 4169 } 4170 /** 4171 * 4172 * 4173 * <pre> 4174 * Optional. Custom metadata about the secret. 4175 * Annotations are distinct from various forms of labels. 4176 * Annotations exist to allow client tools to store their own state 4177 * information without requiring a database. 4178 * Annotation keys must be between 1 and 63 characters long, have a UTF-8 4179 * encoding of maximum 128 bytes, begin and end with an alphanumeric character 4180 * ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and 4181 * alphanumerics in between these symbols. 4182 * The total size of annotation keys and values must be less than 16KiB. 4183 * </pre> 4184 * 4185 * <code>map<string, string> annotations = 13 [(.google.api.field_behavior) = OPTIONAL]; 4186 * </code> 4187 */ putAllAnnotations(java.util.Map<java.lang.String, java.lang.String> values)4188 public Builder putAllAnnotations(java.util.Map<java.lang.String, java.lang.String> values) { 4189 internalGetMutableAnnotations().getMutableMap().putAll(values); 4190 bitField0_ |= 0x00000400; 4191 return this; 4192 } 4193 4194 @java.lang.Override setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields)4195 public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { 4196 return super.setUnknownFields(unknownFields); 4197 } 4198 4199 @java.lang.Override mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields)4200 public final Builder mergeUnknownFields( 4201 final com.google.protobuf.UnknownFieldSet unknownFields) { 4202 return super.mergeUnknownFields(unknownFields); 4203 } 4204 4205 // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.Secret) 4206 } 4207 4208 // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.Secret) 4209 private static final com.google.cloud.secretmanager.v1.Secret DEFAULT_INSTANCE; 4210 4211 static { 4212 DEFAULT_INSTANCE = new com.google.cloud.secretmanager.v1.Secret(); 4213 } 4214 getDefaultInstance()4215 public static com.google.cloud.secretmanager.v1.Secret getDefaultInstance() { 4216 return DEFAULT_INSTANCE; 4217 } 4218 4219 private static final com.google.protobuf.Parser<Secret> PARSER = 4220 new com.google.protobuf.AbstractParser<Secret>() { 4221 @java.lang.Override 4222 public Secret parsePartialFrom( 4223 com.google.protobuf.CodedInputStream input, 4224 com.google.protobuf.ExtensionRegistryLite extensionRegistry) 4225 throws com.google.protobuf.InvalidProtocolBufferException { 4226 Builder builder = newBuilder(); 4227 try { 4228 builder.mergeFrom(input, extensionRegistry); 4229 } catch (com.google.protobuf.InvalidProtocolBufferException e) { 4230 throw e.setUnfinishedMessage(builder.buildPartial()); 4231 } catch (com.google.protobuf.UninitializedMessageException e) { 4232 throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); 4233 } catch (java.io.IOException e) { 4234 throw new com.google.protobuf.InvalidProtocolBufferException(e) 4235 .setUnfinishedMessage(builder.buildPartial()); 4236 } 4237 return builder.buildPartial(); 4238 } 4239 }; 4240 parser()4241 public static com.google.protobuf.Parser<Secret> parser() { 4242 return PARSER; 4243 } 4244 4245 @java.lang.Override getParserForType()4246 public com.google.protobuf.Parser<Secret> getParserForType() { 4247 return PARSER; 4248 } 4249 4250 @java.lang.Override getDefaultInstanceForType()4251 public com.google.cloud.secretmanager.v1.Secret getDefaultInstanceForType() { 4252 return DEFAULT_INSTANCE; 4253 } 4254 } 4255