From 0d306e8e6eee7bdf96fb6d80d7a67c4181d87f4c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 11 Sep 2020 19:52:02 -0700 Subject: [PATCH] feat: add CustomerManagedEncryptionKey support, ReplicationStatus to SecretVersion (#217) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4359b16b-f8e6-4341-827e-2f6e6fe82214/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 330793532 Source-Link: https://github.com/googleapis/googleapis/commit/f17ea338b502b967101ca71e4ff0f11d8d1e4518 --- README.md | 4 +- .../clirr-ignored-differences.xml | 19 + .../v1/CustomerManagedEncryption.java | 688 +++ .../CustomerManagedEncryptionOrBuilder.java | 64 + .../v1/CustomerManagedEncryptionStatus.java | 661 +++ ...tomerManagedEncryptionStatusOrBuilder.java | 54 + .../cloud/secretmanager/v1/Replication.java | 859 +++- .../secretmanager/v1/ReplicationStatus.java | 4374 +++++++++++++++++ .../v1/ReplicationStatusOrBuilder.java | 121 + .../secretmanager/v1/ResourcesProto.java | 157 +- .../cloud/secretmanager/v1/SecretVersion.java | 283 ++ .../v1/SecretVersionOrBuilder.java | 35 + .../cloud/secretmanager/v1/resources.proto | 99 +- .../clirr-ignored-differences.xml | 15 +- synth.metadata | 12 +- 15 files changed, 7406 insertions(+), 39 deletions(-) create mode 100644 proto-google-cloud-secretmanager-v1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryption.java create mode 100644 proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionOrBuilder.java create mode 100644 proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatus.java create mode 100644 proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatusOrBuilder.java create mode 100644 proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatus.java create mode 100644 proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatusOrBuilder.java diff --git a/README.md b/README.md index bb1dec51..bd058867 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file com.google.cloud libraries-bom - 9.1.0 + 10.1.0 pom import @@ -39,7 +39,7 @@ If you are using Maven without BOM, add this to your dependencies: com.google.cloud google-cloud-secretmanager - 1.1.0 + 1.1.1 ``` diff --git a/proto-google-cloud-secretmanager-v1/clirr-ignored-differences.xml b/proto-google-cloud-secretmanager-v1/clirr-ignored-differences.xml new file mode 100644 index 00000000..4229c5ab --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/secretmanager/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/secretmanager/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/secretmanager/v1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryption.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryption.java new file mode 100644 index 00000000..30c74bbb --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryption.java @@ -0,0 +1,688 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/secretmanager/v1/resources.proto + +package com.google.cloud.secretmanager.v1; + +/** + * + * + *
+ * Configuration for encrypting secret payloads using customer-managed
+ * encryption keys (CMEK).
+ * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.CustomerManagedEncryption} + */ +public final class CustomerManagedEncryption extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.CustomerManagedEncryption) + CustomerManagedEncryptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerManagedEncryption.newBuilder() to construct. + private CustomerManagedEncryption(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerManagedEncryption() { + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerManagedEncryption(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomerManagedEncryption( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.class, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+   * payloads.
+   * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+   * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+   * [replica location][Secret.UserManaged.Replica.location].
+   * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+   * type, Cloud KMS CryptoKeys must reside in `global`.
+   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+   * payloads.
+   * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+   * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+   * [replica location][Secret.UserManaged.Replica.location].
+   * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+   * type, Cloud KMS CryptoKeys must reside in `global`.
+   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKmsKeyNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKmsKeyNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.secretmanager.v1.CustomerManagedEncryption)) { + return super.equals(obj); + } + com.google.cloud.secretmanager.v1.CustomerManagedEncryption other = + (com.google.cloud.secretmanager.v1.CustomerManagedEncryption) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Configuration for encrypting secret payloads using customer-managed
+   * encryption keys (CMEK).
+   * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.CustomerManagedEncryption} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.CustomerManagedEncryption) + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.class, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder.class); + } + + // Construct using com.google.cloud.secretmanager.v1.CustomerManagedEncryption.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + kmsKeyName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_descriptor; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption getDefaultInstanceForType() { + return com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption build() { + com.google.cloud.secretmanager.v1.CustomerManagedEncryption result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption buildPartial() { + com.google.cloud.secretmanager.v1.CustomerManagedEncryption result = + new com.google.cloud.secretmanager.v1.CustomerManagedEncryption(this); + result.kmsKeyName_ = kmsKeyName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.secretmanager.v1.CustomerManagedEncryption) { + return mergeFrom((com.google.cloud.secretmanager.v1.CustomerManagedEncryption) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.secretmanager.v1.CustomerManagedEncryption other) { + if (other == com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.secretmanager.v1.CustomerManagedEncryption parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.secretmanager.v1.CustomerManagedEncryption) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+     * payloads.
+     * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+     * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+     * [replica location][Secret.UserManaged.Replica.location].
+     * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+     * type, Cloud KMS CryptoKeys must reside in `global`.
+     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+     * payloads.
+     * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+     * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+     * [replica location][Secret.UserManaged.Replica.location].
+     * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+     * type, Cloud KMS CryptoKeys must reside in `global`.
+     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+     * payloads.
+     * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+     * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+     * [replica location][Secret.UserManaged.Replica.location].
+     * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+     * type, Cloud KMS CryptoKeys must reside in `global`.
+     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+     * payloads.
+     * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+     * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+     * [replica location][Secret.UserManaged.Replica.location].
+     * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+     * type, Cloud KMS CryptoKeys must reside in `global`.
+     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+     * payloads.
+     * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+     * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+     * [replica location][Secret.UserManaged.Replica.location].
+     * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+     * type, Cloud KMS CryptoKeys must reside in `global`.
+     * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.CustomerManagedEncryption) + } + + // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.CustomerManagedEncryption) + private static final com.google.cloud.secretmanager.v1.CustomerManagedEncryption DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.secretmanager.v1.CustomerManagedEncryption(); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryption getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerManagedEncryption parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomerManagedEncryption(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionOrBuilder.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionOrBuilder.java new file mode 100644 index 00000000..726412bf --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionOrBuilder.java @@ -0,0 +1,64 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/secretmanager/v1/resources.proto + +package com.google.cloud.secretmanager.v1; + +public interface CustomerManagedEncryptionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.CustomerManagedEncryption) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+   * payloads.
+   * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+   * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+   * [replica location][Secret.UserManaged.Replica.location].
+   * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+   * type, Cloud KMS CryptoKeys must reside in `global`.
+   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret
+   * payloads.
+   * For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication
+   * policy type, Cloud KMS CryptoKeys must reside in the same location as the
+   * [replica location][Secret.UserManaged.Replica.location].
+   * For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy
+   * type, Cloud KMS CryptoKeys must reside in `global`.
+   * The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
+   * 
+ * + * string kms_key_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); +} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatus.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatus.java new file mode 100644 index 00000000..72bf8030 --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatus.java @@ -0,0 +1,661 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/secretmanager/v1/resources.proto + +package com.google.cloud.secretmanager.v1; + +/** + * + * + *
+ * Describes the status of customer-managed encryption.
+ * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus} + */ +public final class CustomerManagedEncryptionStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) + CustomerManagedEncryptionStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomerManagedEncryptionStatus.newBuilder() to construct. + private CustomerManagedEncryptionStatus( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomerManagedEncryptionStatus() { + kmsKeyVersionName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomerManagedEncryptionStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomerManagedEncryptionStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyVersionName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.class, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder.class); + } + + public static final int KMS_KEY_VERSION_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object kmsKeyVersionName_; + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+   * secret payload, in the following format:
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+   * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyVersionName. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+   * secret payload, in the following format:
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+   * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyVersionName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKmsKeyVersionNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyVersionName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKmsKeyVersionNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyVersionName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus)) { + return super.equals(obj); + } + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus other = + (com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) obj; + + if (!getKmsKeyVersionName().equals(other.getKmsKeyVersionName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_VERSION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersionName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Describes the status of customer-managed encryption.
+   * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.class, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder.class); + } + + // Construct using + // com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + kmsKeyVersionName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getDefaultInstanceForType() { + return com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus build() { + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus buildPartial() { + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus result = + new com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus(this); + result.kmsKeyVersionName_ = kmsKeyVersionName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) { + return mergeFrom((com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus other) { + if (other + == com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.getDefaultInstance()) + return this; + if (!other.getKmsKeyVersionName().isEmpty()) { + kmsKeyVersionName_ = other.kmsKeyVersionName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kmsKeyVersionName_ = ""; + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+     * secret payload, in the following format:
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+     * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyVersionName. + */ + public java.lang.String getKmsKeyVersionName() { + java.lang.Object ref = kmsKeyVersionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+     * secret payload, in the following format:
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+     * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyVersionName. + */ + public com.google.protobuf.ByteString getKmsKeyVersionNameBytes() { + java.lang.Object ref = kmsKeyVersionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+     * secret payload, in the following format:
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+     * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyVersionName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+     * secret payload, in the following format:
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+     * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersionName() { + + kmsKeyVersionName_ = getDefaultInstance().getKmsKeyVersionName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+     * secret payload, in the following format:
+     * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+     * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for kmsKeyVersionName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyVersionName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) + private static final com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus(); + } + + public static com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomerManagedEncryptionStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomerManagedEncryptionStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatusOrBuilder.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatusOrBuilder.java new file mode 100644 index 00000000..21b36579 --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatusOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/secretmanager/v1/resources.proto + +package com.google.cloud.secretmanager.v1; + +public interface CustomerManagedEncryptionStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+   * secret payload, in the following format:
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+   * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The kmsKeyVersionName. + */ + java.lang.String getKmsKeyVersionName(); + /** + * + * + *
+   * Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the
+   * secret payload, in the following format:
+   * `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`.
+   * 
+ * + * string kms_key_version_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for kmsKeyVersionName. + */ + com.google.protobuf.ByteString getKmsKeyVersionNameBytes(); +} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/Replication.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/Replication.java index 16cc5fde..f6adb2b1 100644 --- a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/Replication.java +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/Replication.java @@ -22,7 +22,7 @@ * * *
- * A policy that defines the replication configuration of data.
+ * A policy that defines the replication and encryption configuration of data.
  * 
* * Protobuf type {@code google.cloud.secretmanager.v1.Replication} @@ -145,7 +145,62 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { public interface AutomaticOrBuilder extends // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.Replication.Automatic) - com.google.protobuf.MessageOrBuilder {} + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+     * configuration is provided, Google-managed default encryption is used.
+     * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+     * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+     * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + boolean hasCustomerManagedEncryption(); + /** + * + * + *
+     * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+     * configuration is provided, Google-managed default encryption is used.
+     * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+     * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+     * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customerManagedEncryption. + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryption getCustomerManagedEncryption(); + /** + * + * + *
+     * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+     * configuration is provided, Google-managed default encryption is used.
+     * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+     * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+     * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder + getCustomerManagedEncryptionOrBuilder(); + } /** * * @@ -197,6 +252,24 @@ private Automatic( case 0: done = true; break; + case 10: + { + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder subBuilder = + null; + if (customerManagedEncryption_ != null) { + subBuilder = customerManagedEncryption_.toBuilder(); + } + customerManagedEncryption_ = + input.readMessage( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customerManagedEncryption_); + customerManagedEncryption_ = subBuilder.buildPartial(); + } + + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -231,6 +304,74 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { com.google.cloud.secretmanager.v1.Replication.Automatic.Builder.class); } + public static final int CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER = 1; + private com.google.cloud.secretmanager.v1.CustomerManagedEncryption customerManagedEncryption_; + /** + * + * + *
+     * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+     * configuration is provided, Google-managed default encryption is used.
+     * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+     * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+     * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + @java.lang.Override + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryption_ != null; + } + /** + * + * + *
+     * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+     * configuration is provided, Google-managed default encryption is used.
+     * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+     * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+     * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customerManagedEncryption. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption + getCustomerManagedEncryption() { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance() + : customerManagedEncryption_; + } + /** + * + * + *
+     * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+     * configuration is provided, Google-managed default encryption is used.
+     * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+     * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+     * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder + getCustomerManagedEncryptionOrBuilder() { + return getCustomerManagedEncryption(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -245,6 +386,9 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (customerManagedEncryption_ != null) { + output.writeMessage(1, getCustomerManagedEncryption()); + } unknownFields.writeTo(output); } @@ -254,6 +398,11 @@ public int getSerializedSize() { if (size != -1) return size; size = 0; + if (customerManagedEncryption_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getCustomerManagedEncryption()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -270,6 +419,11 @@ public boolean equals(final java.lang.Object obj) { com.google.cloud.secretmanager.v1.Replication.Automatic other = (com.google.cloud.secretmanager.v1.Replication.Automatic) obj; + if (hasCustomerManagedEncryption() != other.hasCustomerManagedEncryption()) return false; + if (hasCustomerManagedEncryption()) { + if (!getCustomerManagedEncryption().equals(other.getCustomerManagedEncryption())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -281,6 +435,10 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCustomerManagedEncryption()) { + hash = (37 * hash) + CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER; + hash = (53 * hash) + getCustomerManagedEncryption().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -430,6 +588,12 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } return this; } @@ -457,6 +621,11 @@ public com.google.cloud.secretmanager.v1.Replication.Automatic build() { public com.google.cloud.secretmanager.v1.Replication.Automatic buildPartial() { com.google.cloud.secretmanager.v1.Replication.Automatic result = new com.google.cloud.secretmanager.v1.Replication.Automatic(this); + if (customerManagedEncryptionBuilder_ == null) { + result.customerManagedEncryption_ = customerManagedEncryption_; + } else { + result.customerManagedEncryption_ = customerManagedEncryptionBuilder_.build(); + } onBuilt(); return result; } @@ -509,6 +678,9 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.secretmanager.v1.Replication.Automatic other) { if (other == com.google.cloud.secretmanager.v1.Replication.Automatic.getDefaultInstance()) return this; + if (other.hasCustomerManagedEncryption()) { + mergeCustomerManagedEncryption(other.getCustomerManagedEncryption()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -539,6 +711,253 @@ public Builder mergeFrom( return this; } + private com.google.cloud.secretmanager.v1.CustomerManagedEncryption + customerManagedEncryption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryption, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder> + customerManagedEncryptionBuilder_; + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryptionBuilder_ != null || customerManagedEncryption_ != null; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customerManagedEncryption. + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption + getCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance() + : customerManagedEncryption_; + } else { + return customerManagedEncryptionBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption value) { + if (customerManagedEncryptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerManagedEncryption_ = value; + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder builderForValue) { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = builderForValue.build(); + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption value) { + if (customerManagedEncryptionBuilder_ == null) { + if (customerManagedEncryption_ != null) { + customerManagedEncryption_ = + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.newBuilder( + customerManagedEncryption_) + .mergeFrom(value) + .buildPartial(); + } else { + customerManagedEncryption_ = value; + } + onChanged(); + } else { + customerManagedEncryptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + onChanged(); + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder + getCustomerManagedEncryptionBuilder() { + + onChanged(); + return getCustomerManagedEncryptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder + getCustomerManagedEncryptionOrBuilder() { + if (customerManagedEncryptionBuilder_ != null) { + return customerManagedEncryptionBuilder_.getMessageOrBuilder(); + } else { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance() + : customerManagedEncryption_; + } + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no
+       * configuration is provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryption, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder> + getCustomerManagedEncryptionFieldBuilder() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryption, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder>( + getCustomerManagedEncryption(), getParentForChildren(), isClean()); + customerManagedEncryption_ = null; + } + return customerManagedEncryptionBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -802,6 +1221,63 @@ public interface ReplicaOrBuilder * @return The bytes for location. */ com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [User-Managed
+       * Replica][Replication.UserManaged.Replica]. If no configuration is
+       * provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + boolean hasCustomerManagedEncryption(); + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [User-Managed
+       * Replica][Replication.UserManaged.Replica]. If no configuration is
+       * provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customerManagedEncryption. + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryption getCustomerManagedEncryption(); + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [User-Managed
+       * Replica][Replication.UserManaged.Replica]. If no configuration is
+       * provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder + getCustomerManagedEncryptionOrBuilder(); } /** * @@ -860,6 +1336,24 @@ private Replica( java.lang.String s = input.readStringRequireUtf8(); location_ = s; + break; + } + case 18: + { + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder subBuilder = + null; + if (customerManagedEncryption_ != null) { + subBuilder = customerManagedEncryption_.toBuilder(); + } + customerManagedEncryption_ = + input.readMessage( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customerManagedEncryption_); + customerManagedEncryption_ = subBuilder.buildPartial(); + } + break; } default: @@ -948,6 +1442,78 @@ public com.google.protobuf.ByteString getLocationBytes() { } } + public static final int CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER = 2; + private com.google.cloud.secretmanager.v1.CustomerManagedEncryption + customerManagedEncryption_; + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [User-Managed
+       * Replica][Replication.UserManaged.Replica]. If no configuration is
+       * provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + @java.lang.Override + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryption_ != null; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [User-Managed
+       * Replica][Replication.UserManaged.Replica]. If no configuration is
+       * provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customerManagedEncryption. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption + getCustomerManagedEncryption() { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance() + : customerManagedEncryption_; + } + /** + * + * + *
+       * Optional. The customer-managed encryption configuration of the [User-Managed
+       * Replica][Replication.UserManaged.Replica]. If no configuration is
+       * provided, Google-managed default encryption is used.
+       * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+       * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+       * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder + getCustomerManagedEncryptionOrBuilder() { + return getCustomerManagedEncryption(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -965,6 +1531,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getLocationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); } + if (customerManagedEncryption_ != null) { + output.writeMessage(2, getCustomerManagedEncryption()); + } unknownFields.writeTo(output); } @@ -977,6 +1546,11 @@ public int getSerializedSize() { if (!getLocationBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); } + if (customerManagedEncryption_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getCustomerManagedEncryption()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -994,6 +1568,11 @@ public boolean equals(final java.lang.Object obj) { (com.google.cloud.secretmanager.v1.Replication.UserManaged.Replica) obj; if (!getLocation().equals(other.getLocation())) return false; + if (hasCustomerManagedEncryption() != other.hasCustomerManagedEncryption()) return false; + if (hasCustomerManagedEncryption()) { + if (!getCustomerManagedEncryption().equals(other.getCustomerManagedEncryption())) + return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1007,6 +1586,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + LOCATION_FIELD_NUMBER; hash = (53 * hash) + getLocation().hashCode(); + if (hasCustomerManagedEncryption()) { + hash = (37 * hash) + CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER; + hash = (53 * hash) + getCustomerManagedEncryption().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1160,6 +1743,12 @@ public Builder clear() { super.clear(); location_ = ""; + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } return this; } @@ -1190,6 +1779,11 @@ public com.google.cloud.secretmanager.v1.Replication.UserManaged.Replica buildPa com.google.cloud.secretmanager.v1.Replication.UserManaged.Replica result = new com.google.cloud.secretmanager.v1.Replication.UserManaged.Replica(this); result.location_ = location_; + if (customerManagedEncryptionBuilder_ == null) { + result.customerManagedEncryption_ = customerManagedEncryption_; + } else { + result.customerManagedEncryption_ = customerManagedEncryptionBuilder_.build(); + } onBuilt(); return result; } @@ -1249,6 +1843,9 @@ public Builder mergeFrom( location_ = other.location_; onChanged(); } + if (other.hasCustomerManagedEncryption()) { + mergeCustomerManagedEncryption(other.getCustomerManagedEncryption()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1391,6 +1988,262 @@ public Builder setLocationBytes(com.google.protobuf.ByteString value) { return this; } + private com.google.cloud.secretmanager.v1.CustomerManagedEncryption + customerManagedEncryption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryption, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder> + customerManagedEncryptionBuilder_; + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryptionBuilder_ != null || customerManagedEncryption_ != null; + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The customerManagedEncryption. + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption + getCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance() + : customerManagedEncryption_; + } else { + return customerManagedEncryptionBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption value) { + if (customerManagedEncryptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerManagedEncryption_ = value; + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder builderForValue) { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = builderForValue.build(); + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryption value) { + if (customerManagedEncryptionBuilder_ == null) { + if (customerManagedEncryption_ != null) { + customerManagedEncryption_ = + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.newBuilder( + customerManagedEncryption_) + .mergeFrom(value) + .buildPartial(); + } else { + customerManagedEncryption_ = value; + } + onChanged(); + } else { + customerManagedEncryptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + onChanged(); + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder + getCustomerManagedEncryptionBuilder() { + + onChanged(); + return getCustomerManagedEncryptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder + getCustomerManagedEncryptionOrBuilder() { + if (customerManagedEncryptionBuilder_ != null) { + return customerManagedEncryptionBuilder_.getMessageOrBuilder(); + } else { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryption.getDefaultInstance() + : customerManagedEncryption_; + } + } + /** + * + * + *
+         * Optional. The customer-managed encryption configuration of the [User-Managed
+         * Replica][Replication.UserManaged.Replica]. If no configuration is
+         * provided, Google-managed default encryption is used.
+         * Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to
+         * [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply
+         * retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion].
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryption customer_managed_encryption = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryption, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder> + getCustomerManagedEncryptionFieldBuilder() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryption, + com.google.cloud.secretmanager.v1.CustomerManagedEncryption.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionOrBuilder>( + getCustomerManagedEncryption(), getParentForChildren(), isClean()); + customerManagedEncryption_ = null; + } + return customerManagedEncryptionBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -2727,7 +3580,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * A policy that defines the replication configuration of data.
+   * A policy that defines the replication and encryption configuration of data.
    * 
* * Protobuf type {@code google.cloud.secretmanager.v1.Replication} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatus.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatus.java new file mode 100644 index 00000000..3377dd2d --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatus.java @@ -0,0 +1,4374 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/secretmanager/v1/resources.proto + +package com.google.cloud.secretmanager.v1; + +/** + * + * + *
+ * The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+ * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.ReplicationStatus} + */ +public final class ReplicationStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.ReplicationStatus) + ReplicationStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReplicationStatus.newBuilder() to construct. + private ReplicationStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReplicationStatus() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReplicationStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReplicationStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder + subBuilder = null; + if (replicationStatusCase_ == 1) { + subBuilder = + ((com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_) + .toBuilder(); + } + replicationStatus_ = + input.readMessage( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_); + replicationStatus_ = subBuilder.buildPartial(); + } + replicationStatusCase_ = 1; + break; + } + case 18: + { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder + subBuilder = null; + if (replicationStatusCase_ == 2) { + subBuilder = + ((com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_) + .toBuilder(); + } + replicationStatus_ = + input.readMessage( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_); + replicationStatus_ = subBuilder.buildPartial(); + } + replicationStatusCase_ = 2; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder.class); + } + + public interface AutomaticStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+     * populated if customer-managed encryption is used.
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + boolean hasCustomerManagedEncryption(); + /** + * + * + *
+     * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+     * populated if customer-managed encryption is used.
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customerManagedEncryption. + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getCustomerManagedEncryption(); + /** + * + * + *
+     * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+     * populated if customer-managed encryption is used.
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder + getCustomerManagedEncryptionOrBuilder(); + } + /** + * + * + *
+   * The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus} + */ + public static final class AutomaticStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + AutomaticStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use AutomaticStatus.newBuilder() to construct. + private AutomaticStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AutomaticStatus() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AutomaticStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AutomaticStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder + subBuilder = null; + if (customerManagedEncryption_ != null) { + subBuilder = customerManagedEncryption_.toBuilder(); + } + customerManagedEncryption_ = + input.readMessage( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customerManagedEncryption_); + customerManagedEncryption_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder.class); + } + + public static final int CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER = 1; + private com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + customerManagedEncryption_; + /** + * + * + *
+     * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+     * populated if customer-managed encryption is used.
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + @java.lang.Override + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryption_ != null; + } + /** + * + * + *
+     * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+     * populated if customer-managed encryption is used.
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customerManagedEncryption. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getCustomerManagedEncryption() { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.getDefaultInstance() + : customerManagedEncryption_; + } + /** + * + * + *
+     * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+     * populated if customer-managed encryption is used.
+     * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder + getCustomerManagedEncryptionOrBuilder() { + return getCustomerManagedEncryption(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (customerManagedEncryption_ != null) { + output.writeMessage(1, getCustomerManagedEncryption()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (customerManagedEncryption_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, getCustomerManagedEncryption()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus)) { + return super.equals(obj); + } + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus other = + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) obj; + + if (hasCustomerManagedEncryption() != other.hasCustomerManagedEncryption()) return false; + if (hasCustomerManagedEncryption()) { + if (!getCustomerManagedEncryption().equals(other.getCustomerManagedEncryption())) + return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasCustomerManagedEncryption()) { + hash = (37 * hash) + CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER; + hash = (53 * hash) + getCustomerManagedEncryption().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder.class); + } + + // Construct using + // com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + getDefaultInstanceForType() { + return com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus build() { + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus buildPartial() { + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus result = + new com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus(this); + if (customerManagedEncryptionBuilder_ == null) { + result.customerManagedEncryption_ = customerManagedEncryption_; + } else { + result.customerManagedEncryption_ = customerManagedEncryptionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) { + return mergeFrom( + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus other) { + if (other + == com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance()) return this; + if (other.hasCustomerManagedEncryption()) { + mergeCustomerManagedEncryption(other.getCustomerManagedEncryption()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + customerManagedEncryption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder> + customerManagedEncryptionBuilder_; + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryptionBuilder_ != null || customerManagedEncryption_ != null; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customerManagedEncryption. + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + .getDefaultInstance() + : customerManagedEncryption_; + } else { + return customerManagedEncryptionBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus value) { + if (customerManagedEncryptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerManagedEncryption_ = value; + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder + builderForValue) { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = builderForValue.build(); + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus value) { + if (customerManagedEncryptionBuilder_ == null) { + if (customerManagedEncryption_ != null) { + customerManagedEncryption_ = + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.newBuilder( + customerManagedEncryption_) + .mergeFrom(value) + .buildPartial(); + } else { + customerManagedEncryption_ = value; + } + onChanged(); + } else { + customerManagedEncryptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + onChanged(); + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder + getCustomerManagedEncryptionBuilder() { + + onChanged(); + return getCustomerManagedEncryptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder + getCustomerManagedEncryptionOrBuilder() { + if (customerManagedEncryptionBuilder_ != null) { + return customerManagedEncryptionBuilder_.getMessageOrBuilder(); + } else { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + .getDefaultInstance() + : customerManagedEncryption_; + } + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder> + getCustomerManagedEncryptionFieldBuilder() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder>( + getCustomerManagedEncryption(), getParentForChildren(), isClean()); + customerManagedEncryption_ = null; + } + return customerManagedEncryptionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + private static final com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus(); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AutomaticStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AutomaticStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface UserManagedStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus> + getReplicasList(); + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus getReplicas( + int index); + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getReplicasCount(); + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List< + ? extends + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder> + getReplicasOrBuilderList(); + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusOrBuilder + getReplicasOrBuilder(int index); + } + /** + * + * + *
+   * The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using user-managed
+   * replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus} + */ + public static final class UserManagedStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + UserManagedStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use UserManagedStatus.newBuilder() to construct. + private UserManagedStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UserManagedStatus() { + replicas_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UserManagedStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UserManagedStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + replicas_ = + new java.util.ArrayList< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus>(); + mutable_bitField0_ |= 0x00000001; + } + replicas_.add( + input.readMessage( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + replicas_ = java.util.Collections.unmodifiableList(replicas_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder.class); + } + + public interface ReplicaStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Output only. The canonical ID of the replica location.
+       * For example: `"us-east1"`.
+       * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+       * Output only. The canonical ID of the replica location.
+       * For example: `"us-east1"`.
+       * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); + + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + boolean hasCustomerManagedEncryption(); + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customerManagedEncryption. + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getCustomerManagedEncryption(); + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder + getCustomerManagedEncryptionOrBuilder(); + } + /** + * + * + *
+     * Describes the status of a user-managed replica for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * Protobuf type {@code + * google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus} + */ + public static final class ReplicaStatus extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) + ReplicaStatusOrBuilder { + private static final long serialVersionUID = 0L; + // Use ReplicaStatus.newBuilder() to construct. + private ReplicaStatus(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ReplicaStatus() { + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ReplicaStatus(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ReplicaStatus( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + location_ = s; + break; + } + case 18: + { + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder + subBuilder = null; + if (customerManagedEncryption_ != null) { + subBuilder = customerManagedEncryption_.toBuilder(); + } + customerManagedEncryption_ = + input.readMessage( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(customerManagedEncryption_); + customerManagedEncryption_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .class, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder.class); + } + + public static final int LOCATION_FIELD_NUMBER = 1; + private volatile java.lang.Object location_; + /** + * + * + *
+       * Output only. The canonical ID of the replica location.
+       * For example: `"us-east1"`.
+       * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } + } + /** + * + * + *
+       * Output only. The canonical ID of the replica location.
+       * For example: `"us-east1"`.
+       * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER = 2; + private com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + customerManagedEncryption_; + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + @java.lang.Override + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryption_ != null; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customerManagedEncryption. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getCustomerManagedEncryption() { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.getDefaultInstance() + : customerManagedEncryption_; + } + /** + * + * + *
+       * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+       * populated if customer-managed encryption is used.
+       * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder + getCustomerManagedEncryptionOrBuilder() { + return getCustomerManagedEncryption(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getLocationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, location_); + } + if (customerManagedEncryption_ != null) { + output.writeMessage(2, getCustomerManagedEncryption()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLocationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, location_); + } + if (customerManagedEncryption_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, getCustomerManagedEncryption()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus)) { + return super.equals(obj); + } + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus other = + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) + obj; + + if (!getLocation().equals(other.getLocation())) return false; + if (hasCustomerManagedEncryption() != other.hasCustomerManagedEncryption()) return false; + if (hasCustomerManagedEncryption()) { + if (!getCustomerManagedEncryption().equals(other.getCustomerManagedEncryption())) + return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + if (hasCustomerManagedEncryption()) { + hash = (37 * hash) + CUSTOMER_MANAGED_ENCRYPTION_FIELD_NUMBER; + hash = (53 * hash) + getCustomerManagedEncryption().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Describes the status of a user-managed replica for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * Protobuf type {@code + * google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus.Builder.class); + } + + // Construct using + // com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + location_ = ""; + + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + getDefaultInstanceForType() { + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + build() { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + buildPartial() { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + result = + new com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus(this); + result.location_ = location_; + if (customerManagedEncryptionBuilder_ == null) { + result.customerManagedEncryption_ = customerManagedEncryption_; + } else { + result.customerManagedEncryption_ = customerManagedEncryptionBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) { + return mergeFrom( + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + other) { + if (other + == com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .getDefaultInstance()) return this; + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + onChanged(); + } + if (other.hasCustomerManagedEncryption()) { + mergeCustomerManagedEncryption(other.getCustomerManagedEncryption()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+         * Output only. The canonical ID of the replica location.
+         * For example: `"us-east1"`.
+         * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Output only. The canonical ID of the replica location.
+         * For example: `"us-east1"`.
+         * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Output only. The canonical ID of the replica location.
+         * For example: `"us-east1"`.
+         * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. The canonical ID of the replica location.
+         * For example: `"us-east1"`.
+         * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. The canonical ID of the replica location.
+         * For example: `"us-east1"`.
+         * 
+ * + * string location = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = value; + onChanged(); + return this; + } + + private com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + customerManagedEncryption_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder> + customerManagedEncryptionBuilder_; + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the customerManagedEncryption field is set. + */ + public boolean hasCustomerManagedEncryption() { + return customerManagedEncryptionBuilder_ != null || customerManagedEncryption_ != null; + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The customerManagedEncryption. + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + getCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + .getDefaultInstance() + : customerManagedEncryption_; + } else { + return customerManagedEncryptionBuilder_.getMessage(); + } + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus value) { + if (customerManagedEncryptionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + customerManagedEncryption_ = value; + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder + builderForValue) { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = builderForValue.build(); + onChanged(); + } else { + customerManagedEncryptionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeCustomerManagedEncryption( + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus value) { + if (customerManagedEncryptionBuilder_ == null) { + if (customerManagedEncryption_ != null) { + customerManagedEncryption_ = + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.newBuilder( + customerManagedEncryption_) + .mergeFrom(value) + .buildPartial(); + } else { + customerManagedEncryption_ = value; + } + onChanged(); + } else { + customerManagedEncryptionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearCustomerManagedEncryption() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryption_ = null; + onChanged(); + } else { + customerManagedEncryption_ = null; + customerManagedEncryptionBuilder_ = null; + } + + return this; + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder + getCustomerManagedEncryptionBuilder() { + + onChanged(); + return getCustomerManagedEncryptionFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder + getCustomerManagedEncryptionOrBuilder() { + if (customerManagedEncryptionBuilder_ != null) { + return customerManagedEncryptionBuilder_.getMessageOrBuilder(); + } else { + return customerManagedEncryption_ == null + ? com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus + .getDefaultInstance() + : customerManagedEncryption_; + } + } + /** + * + * + *
+         * Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only
+         * populated if customer-managed encryption is used.
+         * 
+ * + * + * .google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder> + getCustomerManagedEncryptionFieldBuilder() { + if (customerManagedEncryptionBuilder_ == null) { + customerManagedEncryptionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus.Builder, + com.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusOrBuilder>( + getCustomerManagedEncryption(), getParentForChildren(), isClean()); + customerManagedEncryption_ = null; + } + return customerManagedEncryptionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus) + private static final com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus(); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplicaStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReplicaStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int REPLICAS_FIELD_NUMBER = 1; + private java.util.List< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus> + replicas_; + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus> + getReplicasList() { + return replicas_; + } + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder> + getReplicasOrBuilderList() { + return replicas_; + } + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getReplicasCount() { + return replicas_.size(); + } + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + getReplicas(int index) { + return replicas_.get(index); + } + /** + * + * + *
+     * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder + getReplicasOrBuilder(int index) { + return replicas_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < replicas_.size(); i++) { + output.writeMessage(1, replicas_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < replicas_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, replicas_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus)) { + return super.equals(obj); + } + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus other = + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) obj; + + if (!getReplicasList().equals(other.getReplicasList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getReplicasCount() > 0) { + hash = (37 * hash) + REPLICAS_FIELD_NUMBER; + hash = (53 * hash) + getReplicasList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using user-managed
+     * replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder + .class); + } + + // Construct using + // com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReplicasFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (replicasBuilder_ == null) { + replicas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + replicasBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + getDefaultInstanceForType() { + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus build() { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus buildPartial() { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus result = + new com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus(this); + int from_bitField0_ = bitField0_; + if (replicasBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + replicas_ = java.util.Collections.unmodifiableList(replicas_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.replicas_ = replicas_; + } else { + result.replicas_ = replicasBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) { + return mergeFrom( + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus other) { + if (other + == com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance()) return this; + if (replicasBuilder_ == null) { + if (!other.replicas_.isEmpty()) { + if (replicas_.isEmpty()) { + replicas_ = other.replicas_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReplicasIsMutable(); + replicas_.addAll(other.replicas_); + } + onChanged(); + } + } else { + if (!other.replicas_.isEmpty()) { + if (replicasBuilder_.isEmpty()) { + replicasBuilder_.dispose(); + replicasBuilder_ = null; + replicas_ = other.replicas_; + bitField0_ = (bitField0_ & ~0x00000001); + replicasBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReplicasFieldBuilder() + : null; + } else { + replicasBuilder_.addAllMessages(other.replicas_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus> + replicas_ = java.util.Collections.emptyList(); + + private void ensureReplicasIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + replicas_ = + new java.util.ArrayList< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus>(replicas_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder> + replicasBuilder_; + + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus> + getReplicasList() { + if (replicasBuilder_ == null) { + return java.util.Collections.unmodifiableList(replicas_); + } else { + return replicasBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getReplicasCount() { + if (replicasBuilder_ == null) { + return replicas_.size(); + } else { + return replicasBuilder_.getCount(); + } + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + getReplicas(int index) { + if (replicasBuilder_ == null) { + return replicas_.get(index); + } else { + return replicasBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReplicas( + int index, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + value) { + if (replicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicasIsMutable(); + replicas_.set(index, value); + onChanged(); + } else { + replicasBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setReplicas( + int index, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder + builderForValue) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.set(index, builderForValue.build()); + onChanged(); + } else { + replicasBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReplicas( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + value) { + if (replicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicasIsMutable(); + replicas_.add(value); + onChanged(); + } else { + replicasBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReplicas( + int index, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + value) { + if (replicasBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReplicasIsMutable(); + replicas_.add(index, value); + onChanged(); + } else { + replicasBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReplicas( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder + builderForValue) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.add(builderForValue.build()); + onChanged(); + } else { + replicasBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addReplicas( + int index, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder + builderForValue) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.add(index, builderForValue.build()); + onChanged(); + } else { + replicasBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllReplicas( + java.lang.Iterable< + ? extends + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus> + values) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, replicas_); + onChanged(); + } else { + replicasBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearReplicas() { + if (replicasBuilder_ == null) { + replicas_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + replicasBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeReplicas(int index) { + if (replicasBuilder_ == null) { + ensureReplicasIsMutable(); + replicas_.remove(index); + onChanged(); + } else { + replicasBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder + getReplicasBuilder(int index) { + return getReplicasFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder + getReplicasOrBuilder(int index) { + if (replicasBuilder_ == null) { + return replicas_.get(index); + } else { + return replicasBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder> + getReplicasOrBuilderList() { + if (replicasBuilder_ != null) { + return replicasBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(replicas_); + } + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder + addReplicasBuilder() { + return getReplicasFieldBuilder() + .addBuilder( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .getDefaultInstance()); + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder + addReplicasBuilder(int index) { + return getReplicasFieldBuilder() + .addBuilder( + index, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .getDefaultInstance()); + } + /** + * + * + *
+       * Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+       * 
+ * + * + * repeated .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus replicas = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder> + getReplicasBuilderList() { + return getReplicasFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus + .Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder> + getReplicasFieldBuilder() { + if (replicasBuilder_ == null) { + replicasBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .ReplicaStatusOrBuilder>( + replicas_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + replicas_ = null; + } + return replicasBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + private static final com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus(); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UserManagedStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UserManagedStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int replicationStatusCase_ = 0; + private java.lang.Object replicationStatus_; + + public enum ReplicationStatusCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + AUTOMATIC(1), + USER_MANAGED(2), + REPLICATIONSTATUS_NOT_SET(0); + private final int value; + + private ReplicationStatusCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReplicationStatusCase valueOf(int value) { + return forNumber(value); + } + + public static ReplicationStatusCase forNumber(int value) { + switch (value) { + case 1: + return AUTOMATIC; + case 2: + return USER_MANAGED; + case 0: + return REPLICATIONSTATUS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ReplicationStatusCase getReplicationStatusCase() { + return ReplicationStatusCase.forNumber(replicationStatusCase_); + } + + public static final int AUTOMATIC_FIELD_NUMBER = 1; + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + * + * @return Whether the automatic field is set. + */ + @java.lang.Override + public boolean hasAutomatic() { + return replicationStatusCase_ == 1; + } + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + * + * @return The automatic. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus getAutomatic() { + if (replicationStatusCase_ == 1) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.getDefaultInstance(); + } + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder + getAutomaticOrBuilder() { + if (replicationStatusCase_ == 1) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.getDefaultInstance(); + } + + public static final int USER_MANAGED_FIELD_NUMBER = 2; + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * user-managed replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + * + * @return Whether the userManaged field is set. + */ + @java.lang.Override + public boolean hasUserManaged() { + return replicationStatusCase_ == 2; + } + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * user-managed replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + * + * @return The userManaged. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus getUserManaged() { + if (replicationStatusCase_ == 2) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * user-managed replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder + getUserManagedOrBuilder() { + if (replicationStatusCase_ == 2) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (replicationStatusCase_ == 1) { + output.writeMessage( + 1, + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) replicationStatus_); + } + if (replicationStatusCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (replicationStatusCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_); + } + if (replicationStatusCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.secretmanager.v1.ReplicationStatus)) { + return super.equals(obj); + } + com.google.cloud.secretmanager.v1.ReplicationStatus other = + (com.google.cloud.secretmanager.v1.ReplicationStatus) obj; + + if (!getReplicationStatusCase().equals(other.getReplicationStatusCase())) return false; + switch (replicationStatusCase_) { + case 1: + if (!getAutomatic().equals(other.getAutomatic())) return false; + break; + case 2: + if (!getUserManaged().equals(other.getUserManaged())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (replicationStatusCase_) { + case 1: + hash = (37 * hash) + AUTOMATIC_FIELD_NUMBER; + hash = (53 * hash) + getAutomatic().hashCode(); + break; + case 2: + hash = (37 * hash) + USER_MANAGED_FIELD_NUMBER; + hash = (53 * hash) + getUserManaged().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.secretmanager.v1.ReplicationStatus prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * Protobuf type {@code google.cloud.secretmanager.v1.ReplicationStatus} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.secretmanager.v1.ReplicationStatus) + com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.secretmanager.v1.ReplicationStatus.class, + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder.class); + } + + // Construct using com.google.cloud.secretmanager.v1.ReplicationStatus.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + replicationStatusCase_ = 0; + replicationStatus_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.secretmanager.v1.ResourcesProto + .internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus getDefaultInstanceForType() { + return com.google.cloud.secretmanager.v1.ReplicationStatus.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus build() { + com.google.cloud.secretmanager.v1.ReplicationStatus result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus buildPartial() { + com.google.cloud.secretmanager.v1.ReplicationStatus result = + new com.google.cloud.secretmanager.v1.ReplicationStatus(this); + if (replicationStatusCase_ == 1) { + if (automaticBuilder_ == null) { + result.replicationStatus_ = replicationStatus_; + } else { + result.replicationStatus_ = automaticBuilder_.build(); + } + } + if (replicationStatusCase_ == 2) { + if (userManagedBuilder_ == null) { + result.replicationStatus_ = replicationStatus_; + } else { + result.replicationStatus_ = userManagedBuilder_.build(); + } + } + result.replicationStatusCase_ = replicationStatusCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.secretmanager.v1.ReplicationStatus) { + return mergeFrom((com.google.cloud.secretmanager.v1.ReplicationStatus) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.secretmanager.v1.ReplicationStatus other) { + if (other == com.google.cloud.secretmanager.v1.ReplicationStatus.getDefaultInstance()) + return this; + switch (other.getReplicationStatusCase()) { + case AUTOMATIC: + { + mergeAutomatic(other.getAutomatic()); + break; + } + case USER_MANAGED: + { + mergeUserManaged(other.getUserManaged()); + break; + } + case REPLICATIONSTATUS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.secretmanager.v1.ReplicationStatus parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.secretmanager.v1.ReplicationStatus) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int replicationStatusCase_ = 0; + private java.lang.Object replicationStatus_; + + public ReplicationStatusCase getReplicationStatusCase() { + return ReplicationStatusCase.forNumber(replicationStatusCase_); + } + + public Builder clearReplicationStatus() { + replicationStatusCase_ = 0; + replicationStatus_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder> + automaticBuilder_; + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + * + * @return Whether the automatic field is set. + */ + @java.lang.Override + public boolean hasAutomatic() { + return replicationStatusCase_ == 1; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + * + * @return The automatic. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus getAutomatic() { + if (automaticBuilder_ == null) { + if (replicationStatusCase_ == 1) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance(); + } else { + if (replicationStatusCase_ == 1) { + return automaticBuilder_.getMessage(); + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + public Builder setAutomatic( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus value) { + if (automaticBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationStatus_ = value; + onChanged(); + } else { + automaticBuilder_.setMessage(value); + } + replicationStatusCase_ = 1; + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + public Builder setAutomatic( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder + builderForValue) { + if (automaticBuilder_ == null) { + replicationStatus_ = builderForValue.build(); + onChanged(); + } else { + automaticBuilder_.setMessage(builderForValue.build()); + } + replicationStatusCase_ = 1; + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + public Builder mergeAutomatic( + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus value) { + if (automaticBuilder_ == null) { + if (replicationStatusCase_ == 1 + && replicationStatus_ + != com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance()) { + replicationStatus_ = + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.newBuilder( + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_) + .mergeFrom(value) + .buildPartial(); + } else { + replicationStatus_ = value; + } + onChanged(); + } else { + if (replicationStatusCase_ == 1) { + automaticBuilder_.mergeFrom(value); + } + automaticBuilder_.setMessage(value); + } + replicationStatusCase_ = 1; + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + public Builder clearAutomatic() { + if (automaticBuilder_ == null) { + if (replicationStatusCase_ == 1) { + replicationStatusCase_ = 0; + replicationStatus_ = null; + onChanged(); + } + } else { + if (replicationStatusCase_ == 1) { + replicationStatusCase_ = 0; + replicationStatus_ = null; + } + automaticBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder + getAutomaticBuilder() { + return getAutomaticFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder + getAutomaticOrBuilder() { + if ((replicationStatusCase_ == 1) && (automaticBuilder_ != null)) { + return automaticBuilder_.getMessageOrBuilder(); + } else { + if (replicationStatusCase_ == 1) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * automatic replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder> + getAutomaticFieldBuilder() { + if (automaticBuilder_ == null) { + if (!(replicationStatusCase_ == 1)) { + replicationStatus_ = + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus + .getDefaultInstance(); + } + automaticBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder>( + (com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus) + replicationStatus_, + getParentForChildren(), + isClean()); + replicationStatus_ = null; + } + replicationStatusCase_ = 1; + onChanged(); + ; + return automaticBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder> + userManagedBuilder_; + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + * + * @return Whether the userManaged field is set. + */ + @java.lang.Override + public boolean hasUserManaged() { + return replicationStatusCase_ == 2; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + * + * @return The userManaged. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus getUserManaged() { + if (userManagedBuilder_ == null) { + if (replicationStatusCase_ == 2) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } else { + if (replicationStatusCase_ == 2) { + return userManagedBuilder_.getMessage(); + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + public Builder setUserManaged( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus value) { + if (userManagedBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationStatus_ = value; + onChanged(); + } else { + userManagedBuilder_.setMessage(value); + } + replicationStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + public Builder setUserManaged( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder + builderForValue) { + if (userManagedBuilder_ == null) { + replicationStatus_ = builderForValue.build(); + onChanged(); + } else { + userManagedBuilder_.setMessage(builderForValue.build()); + } + replicationStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + public Builder mergeUserManaged( + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus value) { + if (userManagedBuilder_ == null) { + if (replicationStatusCase_ == 2 + && replicationStatus_ + != com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance()) { + replicationStatus_ = + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.newBuilder( + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_) + .mergeFrom(value) + .buildPartial(); + } else { + replicationStatus_ = value; + } + onChanged(); + } else { + if (replicationStatusCase_ == 2) { + userManagedBuilder_.mergeFrom(value); + } + userManagedBuilder_.setMessage(value); + } + replicationStatusCase_ = 2; + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + public Builder clearUserManaged() { + if (userManagedBuilder_ == null) { + if (replicationStatusCase_ == 2) { + replicationStatusCase_ = 0; + replicationStatus_ = null; + onChanged(); + } + } else { + if (replicationStatusCase_ == 2) { + replicationStatusCase_ = 0; + replicationStatus_ = null; + } + userManagedBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder + getUserManagedBuilder() { + return getUserManagedFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder + getUserManagedOrBuilder() { + if ((replicationStatusCase_ == 2) && (userManagedBuilder_ != null)) { + return userManagedBuilder_.getMessageOrBuilder(); + } else { + if (replicationStatusCase_ == 2) { + return (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_; + } + return com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } + } + /** + * + * + *
+     * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+     * user-managed replication.
+     * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+     * policy.
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder> + getUserManagedFieldBuilder() { + if (userManagedBuilder_ == null) { + if (!(replicationStatusCase_ == 2)) { + replicationStatus_ = + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus + .getDefaultInstance(); + } + userManagedBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder>( + (com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus) + replicationStatus_, + getParentForChildren(), + isClean()); + replicationStatus_ = null; + } + replicationStatusCase_ = 2; + onChanged(); + ; + return userManagedBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.secretmanager.v1.ReplicationStatus) + } + + // @@protoc_insertion_point(class_scope:google.cloud.secretmanager.v1.ReplicationStatus) + private static final com.google.cloud.secretmanager.v1.ReplicationStatus DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.secretmanager.v1.ReplicationStatus(); + } + + public static com.google.cloud.secretmanager.v1.ReplicationStatus getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ReplicationStatus parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ReplicationStatus(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatusOrBuilder.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatusOrBuilder.java new file mode 100644 index 00000000..4cc51dbd --- /dev/null +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatusOrBuilder.java @@ -0,0 +1,121 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/secretmanager/v1/resources.proto + +package com.google.cloud.secretmanager.v1; + +public interface ReplicationStatusOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.secretmanager.v1.ReplicationStatus) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + * + * @return Whether the automatic field is set. + */ + boolean hasAutomatic(); + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + * + * @return The automatic. + */ + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus getAutomatic(); + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * automatic replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus automatic = 1; + */ + com.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusOrBuilder + getAutomaticOrBuilder(); + + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * user-managed replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + * + * @return Whether the userManaged field is set. + */ + boolean hasUserManaged(); + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * user-managed replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + * + * @return The userManaged. + */ + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus getUserManaged(); + /** + * + * + *
+   * Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with
+   * user-managed replication.
+   * Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication
+   * policy.
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus user_managed = 2; + * + */ + com.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusOrBuilder + getUserManagedOrBuilder(); + + public com.google.cloud.secretmanager.v1.ReplicationStatus.ReplicationStatusCase + getReplicationStatusCase(); +} diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ResourcesProto.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ResourcesProto.java index 98ff7999..91c616cd 100644 --- a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ResourcesProto.java +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ResourcesProto.java @@ -55,6 +55,30 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_secretmanager_v1_Replication_UserManaged_Replica_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_secretmanager_v1_Replication_UserManaged_Replica_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -81,33 +105,58 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ger.v1.Secret.LabelsEntry\032-\n\013LabelsEntry" + "\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001:M\352AJ\n#s" + "ecretmanager.googleapis.com/Secret\022#proj" - + "ects/{project}/secrets/{secret}\"\221\003\n\rSecr" + + "ects/{project}/secrets/{secret}\"\337\003\n\rSecr" + "etVersion\022\021\n\004name\030\001 \001(\tB\003\340A\003\0224\n\013create_t" + "ime\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340" + "A\003\0225\n\014destroy_time\030\003 \001(\0132\032.google.protob" + "uf.TimestampB\003\340A\003\022F\n\005state\030\004 \001(\01622.googl" + "e.cloud.secretmanager.v1.SecretVersion.S" - + "tateB\003\340A\003\"H\n\005State\022\025\n\021STATE_UNSPECIFIED\020" - + "\000\022\013\n\007ENABLED\020\001\022\014\n\010DISABLED\020\002\022\r\n\tDESTROYE" - + "D\020\003:n\352Ak\n*secretmanager.googleapis.com/S" - + "ecretVersion\022=projects/{project}/secrets" - + "/{secret}/versions/{secret_version}\"\310\002\n\013" - + "Replication\022I\n\tautomatic\030\001 \001(\01324.google." - + "cloud.secretmanager.v1.Replication.Autom" - + "aticH\000\022N\n\014user_managed\030\002 \001(\01326.google.cl" - + "oud.secretmanager.v1.Replication.UserMan" - + "agedH\000\032\013\n\tAutomatic\032\201\001\n\013UserManaged\022U\n\010r" - + "eplicas\030\001 \003(\0132>.google.cloud.secretmanag" - + "er.v1.Replication.UserManaged.ReplicaB\003\340" - + "A\002\032\033\n\007Replica\022\020\n\010location\030\001 \001(\tB\r\n\013repli" - + "cation\"\035\n\rSecretPayload\022\014\n\004data\030\001 \001(\014B\355\001" - + "\n!com.google.cloud.secretmanager.v1B\016Res" - + "ourcesProtoP\001ZJgoogle.golang.org/genprot" - + "o/googleapis/cloud/secretmanager/v1;secr" - + "etmanager\370\001\001\242\002\003GSM\252\002\035Google.Cloud.Secret" - + "Manager.V1\312\002\035Google\\Cloud\\SecretManager\\" - + "V1\352\002 Google::Cloud::SecretManager::V1b\006p" - + "roto3" + + "tateB\003\340A\003\022L\n\022replication_status\030\005 \001(\01320." + + "google.cloud.secretmanager.v1.Replicatio" + + "nStatus\"H\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022" + + "\013\n\007ENABLED\020\001\022\014\n\010DISABLED\020\002\022\r\n\tDESTROYED\020" + + "\003:n\352Ak\n*secretmanager.googleapis.com/Sec" + + "retVersion\022=projects/{project}/secrets/{" + + "secret}/versions/{secret_version}\"\220\004\n\013Re" + + "plication\022I\n\tautomatic\030\001 \001(\01324.google.cl" + + "oud.secretmanager.v1.Replication.Automat" + + "icH\000\022N\n\014user_managed\030\002 \001(\01326.google.clou" + + "d.secretmanager.v1.Replication.UserManag" + + "edH\000\032o\n\tAutomatic\022b\n\033customer_managed_en" + + "cryption\030\001 \001(\01328.google.cloud.secretmana" + + "ger.v1.CustomerManagedEncryptionB\003\340A\001\032\345\001" + + "\n\013UserManaged\022U\n\010replicas\030\001 \003(\0132>.google" + + ".cloud.secretmanager.v1.Replication.User" + + "Managed.ReplicaB\003\340A\002\032\177\n\007Replica\022\020\n\010locat" + + "ion\030\001 \001(\t\022b\n\033customer_managed_encryption" + + "\030\002 \001(\01328.google.cloud.secretmanager.v1.C" + + "ustomerManagedEncryptionB\003\340A\001B\r\n\013replica" + + "tion\"6\n\031CustomerManagedEncryption\022\031\n\014kms" + + "_key_name\030\001 \001(\tB\003\340A\002\"\353\004\n\021ReplicationStat" + + "us\022U\n\tautomatic\030\001 \001(\0132@.google.cloud.sec" + + "retmanager.v1.ReplicationStatus.Automati" + + "cStatusH\000\022Z\n\014user_managed\030\002 \001(\0132B.google" + + ".cloud.secretmanager.v1.ReplicationStatu" + + "s.UserManagedStatusH\000\032{\n\017AutomaticStatus" + + "\022h\n\033customer_managed_encryption\030\001 \001(\0132>." + + "google.cloud.secretmanager.v1.CustomerMa" + + "nagedEncryptionStatusB\003\340A\003\032\217\002\n\021UserManag" + + "edStatus\022g\n\010replicas\030\001 \003(\0132P.google.clou" + + "d.secretmanager.v1.ReplicationStatus.Use" + + "rManagedStatus.ReplicaStatusB\003\340A\003\032\220\001\n\rRe" + + "plicaStatus\022\025\n\010location\030\001 \001(\tB\003\340A\003\022h\n\033cu" + + "stomer_managed_encryption\030\002 \001(\0132>.google" + + ".cloud.secretmanager.v1.CustomerManagedE" + + "ncryptionStatusB\003\340A\003B\024\n\022replication_stat" + + "us\"D\n\037CustomerManagedEncryptionStatus\022!\n" + + "\024kms_key_version_name\030\001 \001(\tB\003\340A\002\"\035\n\rSecr" + + "etPayload\022\014\n\004data\030\001 \001(\014B\355\001\n!com.google.c" + + "loud.secretmanager.v1B\016ResourcesProtoP\001Z" + + "Jgoogle.golang.org/genproto/googleapis/c" + + "loud/secretmanager/v1;secretmanager\370\001\001\242\002" + + "\003GSM\252\002\035Google.Cloud.SecretManager.V1\312\002\035G" + + "oogle\\Cloud\\SecretManager\\V1\352\002 Google::C" + + "loud::SecretManager::V1b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -140,7 +189,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_secretmanager_v1_SecretVersion_descriptor, new java.lang.String[] { - "Name", "CreateTime", "DestroyTime", "State", + "Name", "CreateTime", "DestroyTime", "State", "ReplicationStatus", }); internal_static_google_cloud_secretmanager_v1_Replication_descriptor = getDescriptor().getMessageTypes().get(2); @@ -157,7 +206,9 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { internal_static_google_cloud_secretmanager_v1_Replication_Automatic_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_secretmanager_v1_Replication_Automatic_descriptor, - new java.lang.String[] {}); + new java.lang.String[] { + "CustomerManagedEncryption", + }); internal_static_google_cloud_secretmanager_v1_Replication_UserManaged_descriptor = internal_static_google_cloud_secretmanager_v1_Replication_descriptor .getNestedTypes() @@ -176,10 +227,64 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_secretmanager_v1_Replication_UserManaged_Replica_descriptor, new java.lang.String[] { - "Location", + "Location", "CustomerManagedEncryption", }); - internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor = + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_descriptor = getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryption_descriptor, + new java.lang.String[] { + "KmsKeyName", + }); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor, + new java.lang.String[] { + "Automatic", "UserManaged", "ReplicationStatus", + }); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_descriptor = + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_AutomaticStatus_descriptor, + new java.lang.String[] { + "CustomerManagedEncryption", + }); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor = + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor, + new java.lang.String[] { + "Replicas", + }); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_descriptor = + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_secretmanager_v1_ReplicationStatus_UserManagedStatus_ReplicaStatus_descriptor, + new java.lang.String[] { + "Location", "CustomerManagedEncryption", + }); + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_secretmanager_v1_CustomerManagedEncryptionStatus_descriptor, + new java.lang.String[] { + "KmsKeyVersionName", + }); + internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor = + getDescriptor().getMessageTypes().get(6); internal_static_google_cloud_secretmanager_v1_SecretPayload_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_secretmanager_v1_SecretPayload_descriptor, diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersion.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersion.java index 62af630c..12a8720c 100644 --- a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersion.java +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersion.java @@ -113,6 +113,23 @@ private SecretVersion( int rawValue = input.readEnum(); state_ = rawValue; + break; + } + case 42: + { + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder subBuilder = null; + if (replicationStatus_ != null) { + subBuilder = replicationStatus_.toBuilder(); + } + replicationStatus_ = + input.readMessage( + com.google.cloud.secretmanager.v1.ReplicationStatus.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(replicationStatus_); + replicationStatus_ = subBuilder.buildPartial(); + } + break; } default: @@ -535,6 +552,55 @@ public com.google.cloud.secretmanager.v1.SecretVersion.State getState() { : result; } + public static final int REPLICATION_STATUS_FIELD_NUMBER = 5; + private com.google.cloud.secretmanager.v1.ReplicationStatus replicationStatus_; + /** + * + * + *
+   * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + * + * @return Whether the replicationStatus field is set. + */ + @java.lang.Override + public boolean hasReplicationStatus() { + return replicationStatus_ != null; + } + /** + * + * + *
+   * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + * + * @return The replicationStatus. + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatus getReplicationStatus() { + return replicationStatus_ == null + ? com.google.cloud.secretmanager.v1.ReplicationStatus.getDefaultInstance() + : replicationStatus_; + } + /** + * + * + *
+   * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + @java.lang.Override + public com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder + getReplicationStatusOrBuilder() { + return getReplicationStatus(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -562,6 +628,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.cloud.secretmanager.v1.SecretVersion.State.STATE_UNSPECIFIED.getNumber()) { output.writeEnum(4, state_); } + if (replicationStatus_ != null) { + output.writeMessage(5, getReplicationStatus()); + } unknownFields.writeTo(output); } @@ -584,6 +653,9 @@ public int getSerializedSize() { != com.google.cloud.secretmanager.v1.SecretVersion.State.STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); } + if (replicationStatus_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getReplicationStatus()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -610,6 +682,10 @@ public boolean equals(final java.lang.Object obj) { if (!getDestroyTime().equals(other.getDestroyTime())) return false; } if (state_ != other.state_) return false; + if (hasReplicationStatus() != other.hasReplicationStatus()) return false; + if (hasReplicationStatus()) { + if (!getReplicationStatus().equals(other.getReplicationStatus())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -633,6 +709,10 @@ public int hashCode() { } hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; + if (hasReplicationStatus()) { + hash = (37 * hash) + REPLICATION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getReplicationStatus().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -794,6 +874,12 @@ public Builder clear() { } state_ = 0; + if (replicationStatusBuilder_ == null) { + replicationStatus_ = null; + } else { + replicationStatus_ = null; + replicationStatusBuilder_ = null; + } return this; } @@ -833,6 +919,11 @@ public com.google.cloud.secretmanager.v1.SecretVersion buildPartial() { result.destroyTime_ = destroyTimeBuilder_.build(); } result.state_ = state_; + if (replicationStatusBuilder_ == null) { + result.replicationStatus_ = replicationStatus_; + } else { + result.replicationStatus_ = replicationStatusBuilder_.build(); + } onBuilt(); return result; } @@ -896,6 +987,9 @@ public Builder mergeFrom(com.google.cloud.secretmanager.v1.SecretVersion other) if (other.state_ != 0) { setStateValue(other.getStateValue()); } + if (other.hasReplicationStatus()) { + mergeReplicationStatus(other.getReplicationStatus()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1571,6 +1665,195 @@ public Builder clearState() { return this; } + private com.google.cloud.secretmanager.v1.ReplicationStatus replicationStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder> + replicationStatusBuilder_; + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + * + * @return Whether the replicationStatus field is set. + */ + public boolean hasReplicationStatus() { + return replicationStatusBuilder_ != null || replicationStatus_ != null; + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + * + * @return The replicationStatus. + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus getReplicationStatus() { + if (replicationStatusBuilder_ == null) { + return replicationStatus_ == null + ? com.google.cloud.secretmanager.v1.ReplicationStatus.getDefaultInstance() + : replicationStatus_; + } else { + return replicationStatusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + public Builder setReplicationStatus(com.google.cloud.secretmanager.v1.ReplicationStatus value) { + if (replicationStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + replicationStatus_ = value; + onChanged(); + } else { + replicationStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + public Builder setReplicationStatus( + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder builderForValue) { + if (replicationStatusBuilder_ == null) { + replicationStatus_ = builderForValue.build(); + onChanged(); + } else { + replicationStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + public Builder mergeReplicationStatus( + com.google.cloud.secretmanager.v1.ReplicationStatus value) { + if (replicationStatusBuilder_ == null) { + if (replicationStatus_ != null) { + replicationStatus_ = + com.google.cloud.secretmanager.v1.ReplicationStatus.newBuilder(replicationStatus_) + .mergeFrom(value) + .buildPartial(); + } else { + replicationStatus_ = value; + } + onChanged(); + } else { + replicationStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + public Builder clearReplicationStatus() { + if (replicationStatusBuilder_ == null) { + replicationStatus_ = null; + onChanged(); + } else { + replicationStatus_ = null; + replicationStatusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + public com.google.cloud.secretmanager.v1.ReplicationStatus.Builder + getReplicationStatusBuilder() { + + onChanged(); + return getReplicationStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + public com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder + getReplicationStatusOrBuilder() { + if (replicationStatusBuilder_ != null) { + return replicationStatusBuilder_.getMessageOrBuilder(); + } else { + return replicationStatus_ == null + ? com.google.cloud.secretmanager.v1.ReplicationStatus.getDefaultInstance() + : replicationStatus_; + } + } + /** + * + * + *
+     * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+     * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder> + getReplicationStatusFieldBuilder() { + if (replicationStatusBuilder_ == null) { + replicationStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.secretmanager.v1.ReplicationStatus, + com.google.cloud.secretmanager.v1.ReplicationStatus.Builder, + com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder>( + getReplicationStatus(), getParentForChildren(), isClean()); + replicationStatus_ = null; + } + return replicationStatusBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersionOrBuilder.java b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersionOrBuilder.java index 1de22f37..652b6e27 100644 --- a/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersionOrBuilder.java +++ b/proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretVersionOrBuilder.java @@ -164,4 +164,39 @@ public interface SecretVersionOrBuilder * @return The state. */ com.google.cloud.secretmanager.v1.SecretVersion.State getState(); + + /** + * + * + *
+   * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + * + * @return Whether the replicationStatus field is set. + */ + boolean hasReplicationStatus(); + /** + * + * + *
+   * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + * + * @return The replicationStatus. + */ + com.google.cloud.secretmanager.v1.ReplicationStatus getReplicationStatus(); + /** + * + * + *
+   * The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion].
+   * 
+ * + * .google.cloud.secretmanager.v1.ReplicationStatus replication_status = 5; + */ + com.google.cloud.secretmanager.v1.ReplicationStatusOrBuilder getReplicationStatusOrBuilder(); } diff --git a/proto-google-cloud-secretmanager-v1/src/main/proto/google/cloud/secretmanager/v1/resources.proto b/proto-google-cloud-secretmanager-v1/src/main/proto/google/cloud/secretmanager/v1/resources.proto index d4bf4b7e..fa51c26a 100644 --- a/proto-google-cloud-secretmanager-v1/src/main/proto/google/cloud/secretmanager/v1/resources.proto +++ b/proto-google-cloud-secretmanager-v1/src/main/proto/google/cloud/secretmanager/v1/resources.proto @@ -112,15 +112,23 @@ message SecretVersion { // Output only. The current state of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. + ReplicationStatus replication_status = 5; } -// A policy that defines the replication configuration of data. -// +// A policy that defines the replication and encryption configuration of data. message Replication { // A replication policy that replicates the [Secret][google.cloud.secretmanager.v1.Secret] payload without any // restrictions. message Automatic { - + // Optional. The customer-managed encryption configuration of the [Secret][google.cloud.secretmanager.v1.Secret]. If no + // configuration is provided, Google-managed default encryption is used. + // + // Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to + // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply + // retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. + CustomerManagedEncryption customer_managed_encryption = 1 [(google.api.field_behavior) = OPTIONAL]; } // A replication policy that replicates the [Secret][google.cloud.secretmanager.v1.Secret] payload into the @@ -131,6 +139,15 @@ message Replication { // The canonical IDs of the location to replicate data. // For example: `"us-east1"`. string location = 1; + + // Optional. The customer-managed encryption configuration of the [User-Managed + // Replica][Replication.UserManaged.Replica]. If no configuration is + // provided, Google-managed default encryption is used. + // + // Updates to the [Secret][google.cloud.secretmanager.v1.Secret] encryption configuration only apply to + // [SecretVersions][google.cloud.secretmanager.v1.SecretVersion] added afterwards. They do not apply + // retroactively to existing [SecretVersions][google.cloud.secretmanager.v1.SecretVersion]. + CustomerManagedEncryption customer_managed_encryption = 2 [(google.api.field_behavior) = OPTIONAL]; } // Required. The list of Replicas for this [Secret][google.cloud.secretmanager.v1.Secret]. @@ -149,6 +166,82 @@ message Replication { } } +// Configuration for encrypting secret payloads using customer-managed +// encryption keys (CMEK). +message CustomerManagedEncryption { + // Required. The resource name of the Cloud KMS CryptoKey used to encrypt secret + // payloads. + // + // For secrets using the [UserManaged][google.cloud.secretmanager.v1.Replication.UserManaged] replication + // policy type, Cloud KMS CryptoKeys must reside in the same location as the + // [replica location][Secret.UserManaged.Replica.location]. + // + // For secrets using the [Automatic][google.cloud.secretmanager.v1.Replication.Automatic] replication policy + // type, Cloud KMS CryptoKeys must reside in `global`. + // + // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string kms_key_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. +message ReplicationStatus { + // The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using automatic replication. + // + // Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication + // policy. + message AutomaticStatus { + // Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only + // populated if customer-managed encryption is used. + CustomerManagedEncryptionStatus customer_managed_encryption = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] using user-managed + // replication. + // + // Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication + // policy. + message UserManagedStatus { + // Describes the status of a user-managed replica for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. + message ReplicaStatus { + // Output only. The canonical ID of the replica location. + // For example: `"us-east1"`. + string location = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The customer-managed encryption status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. Only + // populated if customer-managed encryption is used. + CustomerManagedEncryptionStatus customer_managed_encryption = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The list of replica statuses for the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. + repeated ReplicaStatus replicas = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The replication status of the [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. + oneof replication_status { + // Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with + // automatic replication. + // + // Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has an automatic replication + // policy. + AutomaticStatus automatic = 1; + + // Describes the replication status of a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion] with + // user-managed replication. + // + // Only populated if the parent [Secret][google.cloud.secretmanager.v1.Secret] has a user-managed replication + // policy. + UserManagedStatus user_managed = 2; + } +} + +// Describes the status of customer-managed encryption. +message CustomerManagedEncryptionStatus { + // Required. The resource name of the Cloud KMS CryptoKeyVersion used to encrypt the + // secret payload, in the following format: + // `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. + string kms_key_version_name = 1 [(google.api.field_behavior) = REQUIRED]; +} + // A secret payload resource in the Secret Manager API. This contains the // sensitive secret payload that is associated with a [SecretVersion][google.cloud.secretmanager.v1.SecretVersion]. message SecretPayload { diff --git a/proto-google-cloud-secretmanager-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-secretmanager-v1beta1/clirr-ignored-differences.xml index eb5e8814..4229c5ab 100644 --- a/proto-google-cloud-secretmanager-v1beta1/clirr-ignored-differences.xml +++ b/proto-google-cloud-secretmanager-v1beta1/clirr-ignored-differences.xml @@ -2,7 +2,18 @@ - 8001 - com/google/cloud/secrets/*/* + 7012 + com/google/cloud/secretmanager/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/secretmanager/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/secretmanager/v1/*OrBuilder + boolean has*(*) diff --git a/synth.metadata b/synth.metadata index 1119cfa6..07f9cb7e 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-secretmanager.git", - "sha": "ca6817d28a7e70d50bab918956699ae48340893b" + "sha": "23dc9cdec39c8d64edd0d47c442af680aaf28eb4" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "a8c73212a73d460b1edcd0830c4c3e31de33bdc5", - "internalRef": "329973402" + "sha": "f17ea338b502b967101ca71e4ff0f11d8d1e4518", + "internalRef": "330793532" } }, { @@ -134,6 +134,10 @@ "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/AddSecretVersionRequestOrBuilder.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CreateSecretRequest.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CreateSecretRequestOrBuilder.java", + "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryption.java", + "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionOrBuilder.java", + "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatus.java", + "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/CustomerManagedEncryptionStatusOrBuilder.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/DeleteSecretRequest.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/DeleteSecretRequestOrBuilder.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/DestroySecretVersionRequest.java", @@ -157,6 +161,8 @@ "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ProjectName.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/Replication.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationOrBuilder.java", + "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatus.java", + "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ReplicationStatusOrBuilder.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/ResourcesProto.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/Secret.java", "proto-google-cloud-secretmanager-v1/src/main/java/com/google/cloud/secretmanager/v1/SecretName.java",