diff --git a/google-api-grpc/grpc-google-cloud-kms-v1/pom.xml b/google-api-grpc/grpc-google-cloud-kms-v1/pom.xml
new file mode 100644
index 000000000000..85a99078d4e9
--- /dev/null
+++ b/google-api-grpc/grpc-google-cloud-kms-v1/pom.xml
@@ -0,0 +1,31 @@
+
+ * Google Cloud Key Management Service + * Manages cryptographic keys and operations using those keys. Implements a REST + * model with the following objects: + * * [KeyRing][google.cloud.kms.v1.KeyRing] + * * [CryptoKey][google.cloud.kms.v1.CryptoKey] + * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + *+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/kms/v1/service.proto") +public final class KeyManagementServiceGrpc { + + private KeyManagementServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.kms.v1.KeyManagementService"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListKeyRingsMethod()} instead. + public static final io.grpc.MethodDescriptor
+ * Google Cloud Key Management Service + * Manages cryptographic keys and operations using those keys. Implements a REST + * model with the following objects: + * * [KeyRing][google.cloud.kms.v1.KeyRing] + * * [CryptoKey][google.cloud.kms.v1.CryptoKey] + * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + *+ */ + public static abstract class KeyManagementServiceImplBase implements io.grpc.BindableService { + + /** + *
+ * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + *+ */ + public void listKeyRings(com.google.cloud.kms.v1.ListKeyRingsRequest request, + io.grpc.stub.StreamObserver
+ * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ */ + public void listCryptoKeys(com.google.cloud.kms.v1.ListCryptoKeysRequest request, + io.grpc.stub.StreamObserver
+ * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public void listCryptoKeyVersions(com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest request, + io.grpc.stub.StreamObserver
+ * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + *+ */ + public void getKeyRing(com.google.cloud.kms.v1.GetKeyRingRequest request, + io.grpc.stub.StreamObserver
+ * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its + * [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public void getCryptoKey(com.google.cloud.kms.v1.GetCryptoKeyRequest request, + io.grpc.stub.StreamObserver
+ * Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public void getCryptoKeyVersion(com.google.cloud.kms.v1.GetCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location. + *+ */ + public void createKeyRing(com.google.cloud.kms.v1.CreateKeyRingRequest request, + io.grpc.stub.StreamObserver
+ * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *+ */ + public void createCryptoKey(com.google.cloud.kms.v1.CreateCryptoKeyRequest request, + io.grpc.stub.StreamObserver
+ * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + *+ */ + public void createCryptoKeyVersion(com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + *+ */ + public void updateCryptoKey(com.google.cloud.kms.v1.UpdateCryptoKeyRequest request, + io.grpc.stub.StreamObserver
+ * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this + * method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to + * move between other states. + *+ */ + public void updateCryptoKeyVersion(com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ */ + public void encrypt(com.google.cloud.kms.v1.EncryptRequest request, + io.grpc.stub.StreamObserver
+ * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + *+ */ + public void decrypt(com.google.cloud.kms.v1.DecryptRequest request, + io.grpc.stub.StreamObserver
+ * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + *+ */ + public void updateCryptoKeyPrimaryVersion(com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest request, + io.grpc.stub.StreamObserver
+ * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. + * Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to a time 24 + * hours in the future, at which point the [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be changed to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key + * material will be irrevocably destroyed. + * Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process. + *+ */ + public void destroyCryptoKeyVersion(com.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * state. + * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared. + *+ */ + public void restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Google Cloud Key Management Service + * Manages cryptographic keys and operations using those keys. Implements a REST + * model with the following objects: + * * [KeyRing][google.cloud.kms.v1.KeyRing] + * * [CryptoKey][google.cloud.kms.v1.CryptoKey] + * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + *+ */ + public static final class KeyManagementServiceStub extends io.grpc.stub.AbstractStub
+ * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + *+ */ + public void listKeyRings(com.google.cloud.kms.v1.ListKeyRingsRequest request, + io.grpc.stub.StreamObserver
+ * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ */ + public void listCryptoKeys(com.google.cloud.kms.v1.ListCryptoKeysRequest request, + io.grpc.stub.StreamObserver
+ * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public void listCryptoKeyVersions(com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest request, + io.grpc.stub.StreamObserver
+ * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + *+ */ + public void getKeyRing(com.google.cloud.kms.v1.GetKeyRingRequest request, + io.grpc.stub.StreamObserver
+ * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its + * [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public void getCryptoKey(com.google.cloud.kms.v1.GetCryptoKeyRequest request, + io.grpc.stub.StreamObserver
+ * Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public void getCryptoKeyVersion(com.google.cloud.kms.v1.GetCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location. + *+ */ + public void createKeyRing(com.google.cloud.kms.v1.CreateKeyRingRequest request, + io.grpc.stub.StreamObserver
+ * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *+ */ + public void createCryptoKey(com.google.cloud.kms.v1.CreateCryptoKeyRequest request, + io.grpc.stub.StreamObserver
+ * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + *+ */ + public void createCryptoKeyVersion(com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + *+ */ + public void updateCryptoKey(com.google.cloud.kms.v1.UpdateCryptoKeyRequest request, + io.grpc.stub.StreamObserver
+ * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this + * method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to + * move between other states. + *+ */ + public void updateCryptoKeyVersion(com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ */ + public void encrypt(com.google.cloud.kms.v1.EncryptRequest request, + io.grpc.stub.StreamObserver
+ * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + *+ */ + public void decrypt(com.google.cloud.kms.v1.DecryptRequest request, + io.grpc.stub.StreamObserver
+ * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + *+ */ + public void updateCryptoKeyPrimaryVersion(com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest request, + io.grpc.stub.StreamObserver
+ * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. + * Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to a time 24 + * hours in the future, at which point the [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be changed to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key + * material will be irrevocably destroyed. + * Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process. + *+ */ + public void destroyCryptoKeyVersion(com.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * state. + * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared. + *+ */ + public void restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest request, + io.grpc.stub.StreamObserver
+ * Google Cloud Key Management Service + * Manages cryptographic keys and operations using those keys. Implements a REST + * model with the following objects: + * * [KeyRing][google.cloud.kms.v1.KeyRing] + * * [CryptoKey][google.cloud.kms.v1.CryptoKey] + * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + *+ */ + public static final class KeyManagementServiceBlockingStub extends io.grpc.stub.AbstractStub
+ * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + *+ */ + public com.google.cloud.kms.v1.ListKeyRingsResponse listKeyRings(com.google.cloud.kms.v1.ListKeyRingsRequest request) { + return blockingUnaryCall( + getChannel(), getListKeyRingsMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ */ + public com.google.cloud.kms.v1.ListCryptoKeysResponse listCryptoKeys(com.google.cloud.kms.v1.ListCryptoKeysRequest request) { + return blockingUnaryCall( + getChannel(), getListCryptoKeysMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public com.google.cloud.kms.v1.ListCryptoKeyVersionsResponse listCryptoKeyVersions(com.google.cloud.kms.v1.ListCryptoKeyVersionsRequest request) { + return blockingUnaryCall( + getChannel(), getListCryptoKeyVersionsMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + *+ */ + public com.google.cloud.kms.v1.KeyRing getKeyRing(com.google.cloud.kms.v1.GetKeyRingRequest request) { + return blockingUnaryCall( + getChannel(), getGetKeyRingMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its + * [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public com.google.cloud.kms.v1.CryptoKey getCryptoKey(com.google.cloud.kms.v1.GetCryptoKeyRequest request) { + return blockingUnaryCall( + getChannel(), getGetCryptoKeyMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public com.google.cloud.kms.v1.CryptoKeyVersion getCryptoKeyVersion(com.google.cloud.kms.v1.GetCryptoKeyVersionRequest request) { + return blockingUnaryCall( + getChannel(), getGetCryptoKeyVersionMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location. + *+ */ + public com.google.cloud.kms.v1.KeyRing createKeyRing(com.google.cloud.kms.v1.CreateKeyRingRequest request) { + return blockingUnaryCall( + getChannel(), getCreateKeyRingMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *+ */ + public com.google.cloud.kms.v1.CryptoKey createCryptoKey(com.google.cloud.kms.v1.CreateCryptoKeyRequest request) { + return blockingUnaryCall( + getChannel(), getCreateCryptoKeyMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + *+ */ + public com.google.cloud.kms.v1.CryptoKeyVersion createCryptoKeyVersion(com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest request) { + return blockingUnaryCall( + getChannel(), getCreateCryptoKeyVersionMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + *+ */ + public com.google.cloud.kms.v1.CryptoKey updateCryptoKey(com.google.cloud.kms.v1.UpdateCryptoKeyRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateCryptoKeyMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this + * method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to + * move between other states. + *+ */ + public com.google.cloud.kms.v1.CryptoKeyVersion updateCryptoKeyVersion(com.google.cloud.kms.v1.UpdateCryptoKeyVersionRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateCryptoKeyVersionMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ */ + public com.google.cloud.kms.v1.EncryptResponse encrypt(com.google.cloud.kms.v1.EncryptRequest request) { + return blockingUnaryCall( + getChannel(), getEncryptMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + *+ */ + public com.google.cloud.kms.v1.DecryptResponse decrypt(com.google.cloud.kms.v1.DecryptRequest request) { + return blockingUnaryCall( + getChannel(), getDecryptMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + *+ */ + public com.google.cloud.kms.v1.CryptoKey updateCryptoKeyPrimaryVersion(com.google.cloud.kms.v1.UpdateCryptoKeyPrimaryVersionRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateCryptoKeyPrimaryVersionMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. + * Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to a time 24 + * hours in the future, at which point the [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be changed to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key + * material will be irrevocably destroyed. + * Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process. + *+ */ + public com.google.cloud.kms.v1.CryptoKeyVersion destroyCryptoKeyVersion(com.google.cloud.kms.v1.DestroyCryptoKeyVersionRequest request) { + return blockingUnaryCall( + getChannel(), getDestroyCryptoKeyVersionMethodHelper(), getCallOptions(), request); + } + + /** + *
+ * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * state. + * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared. + *+ */ + public com.google.cloud.kms.v1.CryptoKeyVersion restoreCryptoKeyVersion(com.google.cloud.kms.v1.RestoreCryptoKeyVersionRequest request) { + return blockingUnaryCall( + getChannel(), getRestoreCryptoKeyVersionMethodHelper(), getCallOptions(), request); + } + } + + /** + *
+ * Google Cloud Key Management Service + * Manages cryptographic keys and operations using those keys. Implements a REST + * model with the following objects: + * * [KeyRing][google.cloud.kms.v1.KeyRing] + * * [CryptoKey][google.cloud.kms.v1.CryptoKey] + * * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] + *+ */ + public static final class KeyManagementServiceFutureStub extends io.grpc.stub.AbstractStub
+ * Lists [KeyRings][google.cloud.kms.v1.KeyRing]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Lists [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Lists [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Returns metadata for a given [KeyRing][google.cloud.kms.v1.KeyRing]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Returns metadata for a given [CryptoKey][google.cloud.kms.v1.CryptoKey], as well as its + * [primary][google.cloud.kms.v1.CryptoKey.primary] [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Returns metadata for a given [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Create a new [KeyRing][google.cloud.kms.v1.KeyRing] in a given Project and Location. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Create a new [CryptoKey][google.cloud.kms.v1.CryptoKey] within a [KeyRing][google.cloud.kms.v1.KeyRing]. + * [CryptoKey.purpose][google.cloud.kms.v1.CryptoKey.purpose] is required. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Create a new [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * The server will assign the next sequential id. If unset, + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Update a [CryptoKey][google.cloud.kms.v1.CryptoKey]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Update a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s metadata. + * [state][google.cloud.kms.v1.CryptoKeyVersion.state] may be changed between + * [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] and + * [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] using this + * method. See [DestroyCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.DestroyCryptoKeyVersion] and [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] to + * move between other states. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Encrypts data, so that it can only be recovered by a call to [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Decrypts data that was protected by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt]. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Update the version of a [CryptoKey][google.cloud.kms.v1.CryptoKey] that will be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Schedule a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] for destruction. + * Upon calling this method, [CryptoKeyVersion.state][google.cloud.kms.v1.CryptoKeyVersion.state] will be set to + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED] + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be set to a time 24 + * hours in the future, at which point the [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be changed to + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED], and the key + * material will be irrevocably destroyed. + * Before the [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] is reached, + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] may be called to reverse the process. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Restore a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED], + * state. + * Upon restoration of the CryptoKeyVersion, [state][google.cloud.kms.v1.CryptoKeyVersion.state] + * will be set to [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED], + * and [destroy_time][google.cloud.kms.v1.CryptoKeyVersion.destroy_time] will be cleared. + *+ */ + public com.google.common.util.concurrent.ListenableFuture
+ * Request message for [KeyManagementService.CreateCryptoKey][google.cloud.kms.v1.KeyManagementService.CreateCryptoKey]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CreateCryptoKeyRequest} + */ +public final class CreateCryptoKeyRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CreateCryptoKeyRequest) + CreateCryptoKeyRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateCryptoKeyRequest.newBuilder() to construct. + private CreateCryptoKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private CreateCryptoKeyRequest() { + parent_ = ""; + cryptoKeyId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateCryptoKeyRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + cryptoKeyId_ = s; + break; + } + case 26: { + com.google.cloud.kms.v1.CryptoKey.Builder subBuilder = null; + if (cryptoKey_ != null) { + subBuilder = cryptoKey_.toBuilder(); + } + cryptoKey_ = input.readMessage(com.google.cloud.kms.v1.CryptoKey.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cryptoKey_); + cryptoKey_ = subBuilder.buildPartial(); + } + + 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.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_CreateCryptoKeyRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_CreateCryptoKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.CreateCryptoKeyRequest.class, com.google.cloud.kms.v1.CreateCryptoKeyRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+ * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ 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();
+ parent_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public com.google.protobuf.ByteString
+ getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int CRYPTO_KEY_ID_FIELD_NUMBER = 2;
+ private volatile java.lang.Object cryptoKeyId_;
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public java.lang.String getCryptoKeyId() {
+ java.lang.Object ref = cryptoKeyId_;
+ 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();
+ cryptoKeyId_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public com.google.protobuf.ByteString
+ getCryptoKeyIdBytes() {
+ java.lang.Object ref = cryptoKeyId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ cryptoKeyId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int CRYPTO_KEY_FIELD_NUMBER = 3;
+ private com.google.cloud.kms.v1.CryptoKey cryptoKey_;
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public boolean hasCryptoKey() {
+ return cryptoKey_ != null;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKey getCryptoKey() {
+ return cryptoKey_ == null ? com.google.cloud.kms.v1.CryptoKey.getDefaultInstance() : cryptoKey_;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyOrBuilder getCryptoKeyOrBuilder() {
+ return getCryptoKey();
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!getParentBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
+ }
+ if (!getCryptoKeyIdBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, cryptoKeyId_);
+ }
+ if (cryptoKey_ != null) {
+ output.writeMessage(3, getCryptoKey());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getParentBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
+ }
+ if (!getCryptoKeyIdBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, cryptoKeyId_);
+ }
+ if (cryptoKey_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getCryptoKey());
+ }
+ 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.kms.v1.CreateCryptoKeyRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.kms.v1.CreateCryptoKeyRequest other = (com.google.cloud.kms.v1.CreateCryptoKeyRequest) obj;
+
+ boolean result = true;
+ result = result && getParent()
+ .equals(other.getParent());
+ result = result && getCryptoKeyId()
+ .equals(other.getCryptoKeyId());
+ result = result && (hasCryptoKey() == other.hasCryptoKey());
+ if (hasCryptoKey()) {
+ result = result && getCryptoKey()
+ .equals(other.getCryptoKey());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PARENT_FIELD_NUMBER;
+ hash = (53 * hash) + getParent().hashCode();
+ hash = (37 * hash) + CRYPTO_KEY_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getCryptoKeyId().hashCode();
+ if (hasCryptoKey()) {
+ hash = (37 * hash) + CRYPTO_KEY_FIELD_NUMBER;
+ hash = (53 * hash) + getCryptoKey().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest 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.kms.v1.CreateCryptoKeyRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest 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.kms.v1.CreateCryptoKeyRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest 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.kms.v1.CreateCryptoKeyRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest 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.kms.v1.CreateCryptoKeyRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.cloud.kms.v1.CreateCryptoKeyRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ 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;
+ }
+ /**
+ * + * Request message for [KeyManagementService.CreateCryptoKey][google.cloud.kms.v1.KeyManagementService.CreateCryptoKey]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CreateCryptoKeyRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ parent_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public com.google.protobuf.ByteString
+ getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public Builder setParent(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ public Builder setParentBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object cryptoKeyId_ = "";
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public java.lang.String getCryptoKeyId() {
+ java.lang.Object ref = cryptoKeyId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ cryptoKeyId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public com.google.protobuf.ByteString
+ getCryptoKeyIdBytes() {
+ java.lang.Object ref = cryptoKeyId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ cryptoKeyId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public Builder setCryptoKeyId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ cryptoKeyId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public Builder clearCryptoKeyId() {
+
+ cryptoKeyId_ = getDefaultInstance().getCryptoKeyId();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ public Builder setCryptoKeyIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ cryptoKeyId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.kms.v1.CryptoKey cryptoKey_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKey, com.google.cloud.kms.v1.CryptoKey.Builder, com.google.cloud.kms.v1.CryptoKeyOrBuilder> cryptoKeyBuilder_;
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public boolean hasCryptoKey() {
+ return cryptoKeyBuilder_ != null || cryptoKey_ != null;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKey getCryptoKey() {
+ if (cryptoKeyBuilder_ == null) {
+ return cryptoKey_ == null ? com.google.cloud.kms.v1.CryptoKey.getDefaultInstance() : cryptoKey_;
+ } else {
+ return cryptoKeyBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public Builder setCryptoKey(com.google.cloud.kms.v1.CryptoKey value) {
+ if (cryptoKeyBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ cryptoKey_ = value;
+ onChanged();
+ } else {
+ cryptoKeyBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public Builder setCryptoKey(
+ com.google.cloud.kms.v1.CryptoKey.Builder builderForValue) {
+ if (cryptoKeyBuilder_ == null) {
+ cryptoKey_ = builderForValue.build();
+ onChanged();
+ } else {
+ cryptoKeyBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public Builder mergeCryptoKey(com.google.cloud.kms.v1.CryptoKey value) {
+ if (cryptoKeyBuilder_ == null) {
+ if (cryptoKey_ != null) {
+ cryptoKey_ =
+ com.google.cloud.kms.v1.CryptoKey.newBuilder(cryptoKey_).mergeFrom(value).buildPartial();
+ } else {
+ cryptoKey_ = value;
+ }
+ onChanged();
+ } else {
+ cryptoKeyBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public Builder clearCryptoKey() {
+ if (cryptoKeyBuilder_ == null) {
+ cryptoKey_ = null;
+ onChanged();
+ } else {
+ cryptoKey_ = null;
+ cryptoKeyBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKey.Builder getCryptoKeyBuilder() {
+
+ onChanged();
+ return getCryptoKeyFieldBuilder().getBuilder();
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyOrBuilder getCryptoKeyOrBuilder() {
+ if (cryptoKeyBuilder_ != null) {
+ return cryptoKeyBuilder_.getMessageOrBuilder();
+ } else {
+ return cryptoKey_ == null ?
+ com.google.cloud.kms.v1.CryptoKey.getDefaultInstance() : cryptoKey_;
+ }
+ }
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKey, com.google.cloud.kms.v1.CryptoKey.Builder, com.google.cloud.kms.v1.CryptoKeyOrBuilder>
+ getCryptoKeyFieldBuilder() {
+ if (cryptoKeyBuilder_ == null) {
+ cryptoKeyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKey, com.google.cloud.kms.v1.CryptoKey.Builder, com.google.cloud.kms.v1.CryptoKeyOrBuilder>(
+ getCryptoKey(),
+ getParentForChildren(),
+ isClean());
+ cryptoKey_ = null;
+ }
+ return cryptoKeyBuilder_;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.CreateCryptoKeyRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.CreateCryptoKeyRequest)
+ private static final com.google.cloud.kms.v1.CreateCryptoKeyRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.kms.v1.CreateCryptoKeyRequest();
+ }
+
+ public static com.google.cloud.kms.v1.CreateCryptoKeyRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ java.lang.String getParent();
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.KeyRing.name] of the KeyRing associated with the + * [CryptoKeys][google.cloud.kms.v1.CryptoKey]. + *+ * + *
string parent = 1;
+ */
+ com.google.protobuf.ByteString
+ getParentBytes();
+
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ java.lang.String getCryptoKeyId();
+ /**
+ * + * Required. It must be unique within a KeyRing and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string crypto_key_id = 2;
+ */
+ com.google.protobuf.ByteString
+ getCryptoKeyIdBytes();
+
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ boolean hasCryptoKey();
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ com.google.cloud.kms.v1.CryptoKey getCryptoKey();
+ /**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKey crypto_key = 3;
+ */
+ com.google.cloud.kms.v1.CryptoKeyOrBuilder getCryptoKeyOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CreateCryptoKeyVersionRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CreateCryptoKeyVersionRequest.java
new file mode 100644
index 000000000000..e1856e62ba56
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CreateCryptoKeyVersionRequest.java
@@ -0,0 +1,788 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/kms/v1/service.proto
+
+package com.google.cloud.kms.v1;
+
+/**
+ * + * Request message for [KeyManagementService.CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CreateCryptoKeyVersionRequest} + */ +public final class CreateCryptoKeyVersionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CreateCryptoKeyVersionRequest) + CreateCryptoKeyVersionRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateCryptoKeyVersionRequest.newBuilder() to construct. + private CreateCryptoKeyVersionRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private CreateCryptoKeyVersionRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateCryptoKeyVersionRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + com.google.cloud.kms.v1.CryptoKeyVersion.Builder subBuilder = null; + if (cryptoKeyVersion_ != null) { + subBuilder = cryptoKeyVersion_.toBuilder(); + } + cryptoKeyVersion_ = input.readMessage(com.google.cloud.kms.v1.CryptoKeyVersion.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cryptoKeyVersion_); + cryptoKeyVersion_ = subBuilder.buildPartial(); + } + + 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.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_CreateCryptoKeyVersionRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_CreateCryptoKeyVersionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest.class, com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+ * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ 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();
+ parent_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public com.google.protobuf.ByteString
+ getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int CRYPTO_KEY_VERSION_FIELD_NUMBER = 2;
+ private com.google.cloud.kms.v1.CryptoKeyVersion cryptoKeyVersion_;
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public boolean hasCryptoKeyVersion() {
+ return cryptoKeyVersion_ != null;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion getCryptoKeyVersion() {
+ return cryptoKeyVersion_ == null ? com.google.cloud.kms.v1.CryptoKeyVersion.getDefaultInstance() : cryptoKeyVersion_;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getCryptoKeyVersionOrBuilder() {
+ return getCryptoKeyVersion();
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!getParentBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
+ }
+ if (cryptoKeyVersion_ != null) {
+ output.writeMessage(2, getCryptoKeyVersion());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getParentBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
+ }
+ if (cryptoKeyVersion_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(2, getCryptoKeyVersion());
+ }
+ 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.kms.v1.CreateCryptoKeyVersionRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest other = (com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest) obj;
+
+ boolean result = true;
+ result = result && getParent()
+ .equals(other.getParent());
+ result = result && (hasCryptoKeyVersion() == other.hasCryptoKeyVersion());
+ if (hasCryptoKeyVersion()) {
+ result = result && getCryptoKeyVersion()
+ .equals(other.getCryptoKeyVersion());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PARENT_FIELD_NUMBER;
+ hash = (53 * hash) + getParent().hashCode();
+ if (hasCryptoKeyVersion()) {
+ hash = (37 * hash) + CRYPTO_KEY_VERSION_FIELD_NUMBER;
+ hash = (53 * hash) + getCryptoKeyVersion().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest 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.kms.v1.CreateCryptoKeyVersionRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest 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.kms.v1.CreateCryptoKeyVersionRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest 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.kms.v1.CreateCryptoKeyVersionRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest 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.kms.v1.CreateCryptoKeyVersionRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ 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;
+ }
+ /**
+ * + * Request message for [KeyManagementService.CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CreateCryptoKeyVersionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ parent_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public com.google.protobuf.ByteString
+ getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public Builder setParent(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ public Builder setParentBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.kms.v1.CryptoKeyVersion cryptoKeyVersion_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKeyVersion, com.google.cloud.kms.v1.CryptoKeyVersion.Builder, com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder> cryptoKeyVersionBuilder_;
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public boolean hasCryptoKeyVersion() {
+ return cryptoKeyVersionBuilder_ != null || cryptoKeyVersion_ != null;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion getCryptoKeyVersion() {
+ if (cryptoKeyVersionBuilder_ == null) {
+ return cryptoKeyVersion_ == null ? com.google.cloud.kms.v1.CryptoKeyVersion.getDefaultInstance() : cryptoKeyVersion_;
+ } else {
+ return cryptoKeyVersionBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public Builder setCryptoKeyVersion(com.google.cloud.kms.v1.CryptoKeyVersion value) {
+ if (cryptoKeyVersionBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ cryptoKeyVersion_ = value;
+ onChanged();
+ } else {
+ cryptoKeyVersionBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public Builder setCryptoKeyVersion(
+ com.google.cloud.kms.v1.CryptoKeyVersion.Builder builderForValue) {
+ if (cryptoKeyVersionBuilder_ == null) {
+ cryptoKeyVersion_ = builderForValue.build();
+ onChanged();
+ } else {
+ cryptoKeyVersionBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public Builder mergeCryptoKeyVersion(com.google.cloud.kms.v1.CryptoKeyVersion value) {
+ if (cryptoKeyVersionBuilder_ == null) {
+ if (cryptoKeyVersion_ != null) {
+ cryptoKeyVersion_ =
+ com.google.cloud.kms.v1.CryptoKeyVersion.newBuilder(cryptoKeyVersion_).mergeFrom(value).buildPartial();
+ } else {
+ cryptoKeyVersion_ = value;
+ }
+ onChanged();
+ } else {
+ cryptoKeyVersionBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public Builder clearCryptoKeyVersion() {
+ if (cryptoKeyVersionBuilder_ == null) {
+ cryptoKeyVersion_ = null;
+ onChanged();
+ } else {
+ cryptoKeyVersion_ = null;
+ cryptoKeyVersionBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion.Builder getCryptoKeyVersionBuilder() {
+
+ onChanged();
+ return getCryptoKeyVersionFieldBuilder().getBuilder();
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getCryptoKeyVersionOrBuilder() {
+ if (cryptoKeyVersionBuilder_ != null) {
+ return cryptoKeyVersionBuilder_.getMessageOrBuilder();
+ } else {
+ return cryptoKeyVersion_ == null ?
+ com.google.cloud.kms.v1.CryptoKeyVersion.getDefaultInstance() : cryptoKeyVersion_;
+ }
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKeyVersion, com.google.cloud.kms.v1.CryptoKeyVersion.Builder, com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder>
+ getCryptoKeyVersionFieldBuilder() {
+ if (cryptoKeyVersionBuilder_ == null) {
+ cryptoKeyVersionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKeyVersion, com.google.cloud.kms.v1.CryptoKeyVersion.Builder, com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder>(
+ getCryptoKeyVersion(),
+ getParentForChildren(),
+ isClean());
+ cryptoKeyVersion_ = null;
+ }
+ return cryptoKeyVersionBuilder_;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.CreateCryptoKeyVersionRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.CreateCryptoKeyVersionRequest)
+ private static final com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest();
+ }
+
+ public static com.google.cloud.kms.v1.CreateCryptoKeyVersionRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ java.lang.String getParent();
+ /**
+ * + * Required. The [name][google.cloud.kms.v1.CryptoKey.name] of the [CryptoKey][google.cloud.kms.v1.CryptoKey] associated with + * the [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
string parent = 1;
+ */
+ com.google.protobuf.ByteString
+ getParentBytes();
+
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ boolean hasCryptoKeyVersion();
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ com.google.cloud.kms.v1.CryptoKeyVersion getCryptoKeyVersion();
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] with initial field values. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion crypto_key_version = 2;
+ */
+ com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getCryptoKeyVersionOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CreateKeyRingRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CreateKeyRingRequest.java
new file mode 100644
index 000000000000..16a70a04e9bb
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CreateKeyRingRequest.java
@@ -0,0 +1,950 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/kms/v1/service.proto
+
+package com.google.cloud.kms.v1;
+
+/**
+ * + * Request message for [KeyManagementService.CreateKeyRing][google.cloud.kms.v1.KeyManagementService.CreateKeyRing]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CreateKeyRingRequest} + */ +public final class CreateKeyRingRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CreateKeyRingRequest) + CreateKeyRingRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use CreateKeyRingRequest.newBuilder() to construct. + private CreateKeyRingRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private CreateKeyRingRequest() { + parent_ = ""; + keyRingId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CreateKeyRingRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + keyRingId_ = s; + break; + } + case 26: { + com.google.cloud.kms.v1.KeyRing.Builder subBuilder = null; + if (keyRing_ != null) { + subBuilder = keyRing_.toBuilder(); + } + keyRing_ = input.readMessage(com.google.cloud.kms.v1.KeyRing.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(keyRing_); + keyRing_ = subBuilder.buildPartial(); + } + + 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.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_CreateKeyRingRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_CreateKeyRingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.CreateKeyRingRequest.class, com.google.cloud.kms.v1.CreateKeyRingRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + *
+ * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ 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();
+ parent_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public com.google.protobuf.ByteString
+ getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int KEY_RING_ID_FIELD_NUMBER = 2;
+ private volatile java.lang.Object keyRingId_;
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public java.lang.String getKeyRingId() {
+ java.lang.Object ref = keyRingId_;
+ 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();
+ keyRingId_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public com.google.protobuf.ByteString
+ getKeyRingIdBytes() {
+ java.lang.Object ref = keyRingId_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ keyRingId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int KEY_RING_FIELD_NUMBER = 3;
+ private com.google.cloud.kms.v1.KeyRing keyRing_;
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public boolean hasKeyRing() {
+ return keyRing_ != null;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public com.google.cloud.kms.v1.KeyRing getKeyRing() {
+ return keyRing_ == null ? com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public com.google.cloud.kms.v1.KeyRingOrBuilder getKeyRingOrBuilder() {
+ return getKeyRing();
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!getParentBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_);
+ }
+ if (!getKeyRingIdBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keyRingId_);
+ }
+ if (keyRing_ != null) {
+ output.writeMessage(3, getKeyRing());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getParentBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_);
+ }
+ if (!getKeyRingIdBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, keyRingId_);
+ }
+ if (keyRing_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(3, getKeyRing());
+ }
+ 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.kms.v1.CreateKeyRingRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.kms.v1.CreateKeyRingRequest other = (com.google.cloud.kms.v1.CreateKeyRingRequest) obj;
+
+ boolean result = true;
+ result = result && getParent()
+ .equals(other.getParent());
+ result = result && getKeyRingId()
+ .equals(other.getKeyRingId());
+ result = result && (hasKeyRing() == other.hasKeyRing());
+ if (hasKeyRing()) {
+ result = result && getKeyRing()
+ .equals(other.getKeyRing());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + PARENT_FIELD_NUMBER;
+ hash = (53 * hash) + getParent().hashCode();
+ hash = (37 * hash) + KEY_RING_ID_FIELD_NUMBER;
+ hash = (53 * hash) + getKeyRingId().hashCode();
+ if (hasKeyRing()) {
+ hash = (37 * hash) + KEY_RING_FIELD_NUMBER;
+ hash = (53 * hash) + getKeyRing().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest 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.kms.v1.CreateKeyRingRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest 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.kms.v1.CreateKeyRingRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest 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.kms.v1.CreateKeyRingRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest 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.kms.v1.CreateKeyRingRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.cloud.kms.v1.CreateKeyRingRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ 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;
+ }
+ /**
+ * + * Request message for [KeyManagementService.CreateKeyRing][google.cloud.kms.v1.KeyManagementService.CreateKeyRing]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CreateKeyRingRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public java.lang.String getParent() {
+ java.lang.Object ref = parent_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ parent_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public com.google.protobuf.ByteString
+ getParentBytes() {
+ java.lang.Object ref = parent_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ parent_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public Builder setParent(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public Builder clearParent() {
+
+ parent_ = getDefaultInstance().getParent();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ public Builder setParentBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ parent_ = value;
+ onChanged();
+ return this;
+ }
+
+ private java.lang.Object keyRingId_ = "";
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public java.lang.String getKeyRingId() {
+ java.lang.Object ref = keyRingId_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ keyRingId_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public com.google.protobuf.ByteString
+ getKeyRingIdBytes() {
+ java.lang.Object ref = keyRingId_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ keyRingId_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public Builder setKeyRingId(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ keyRingId_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public Builder clearKeyRingId() {
+
+ keyRingId_ = getDefaultInstance().getKeyRingId();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ public Builder setKeyRingIdBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ keyRingId_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.kms.v1.KeyRing keyRing_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.KeyRing, com.google.cloud.kms.v1.KeyRing.Builder, com.google.cloud.kms.v1.KeyRingOrBuilder> keyRingBuilder_;
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public boolean hasKeyRing() {
+ return keyRingBuilder_ != null || keyRing_ != null;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public com.google.cloud.kms.v1.KeyRing getKeyRing() {
+ if (keyRingBuilder_ == null) {
+ return keyRing_ == null ? com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_;
+ } else {
+ return keyRingBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public Builder setKeyRing(com.google.cloud.kms.v1.KeyRing value) {
+ if (keyRingBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ keyRing_ = value;
+ onChanged();
+ } else {
+ keyRingBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public Builder setKeyRing(
+ com.google.cloud.kms.v1.KeyRing.Builder builderForValue) {
+ if (keyRingBuilder_ == null) {
+ keyRing_ = builderForValue.build();
+ onChanged();
+ } else {
+ keyRingBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public Builder mergeKeyRing(com.google.cloud.kms.v1.KeyRing value) {
+ if (keyRingBuilder_ == null) {
+ if (keyRing_ != null) {
+ keyRing_ =
+ com.google.cloud.kms.v1.KeyRing.newBuilder(keyRing_).mergeFrom(value).buildPartial();
+ } else {
+ keyRing_ = value;
+ }
+ onChanged();
+ } else {
+ keyRingBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public Builder clearKeyRing() {
+ if (keyRingBuilder_ == null) {
+ keyRing_ = null;
+ onChanged();
+ } else {
+ keyRing_ = null;
+ keyRingBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public com.google.cloud.kms.v1.KeyRing.Builder getKeyRingBuilder() {
+
+ onChanged();
+ return getKeyRingFieldBuilder().getBuilder();
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ public com.google.cloud.kms.v1.KeyRingOrBuilder getKeyRingOrBuilder() {
+ if (keyRingBuilder_ != null) {
+ return keyRingBuilder_.getMessageOrBuilder();
+ } else {
+ return keyRing_ == null ?
+ com.google.cloud.kms.v1.KeyRing.getDefaultInstance() : keyRing_;
+ }
+ }
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.KeyRing, com.google.cloud.kms.v1.KeyRing.Builder, com.google.cloud.kms.v1.KeyRingOrBuilder>
+ getKeyRingFieldBuilder() {
+ if (keyRingBuilder_ == null) {
+ keyRingBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.KeyRing, com.google.cloud.kms.v1.KeyRing.Builder, com.google.cloud.kms.v1.KeyRingOrBuilder>(
+ getKeyRing(),
+ getParentForChildren(),
+ isClean());
+ keyRing_ = null;
+ }
+ return keyRingBuilder_;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.CreateKeyRingRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.CreateKeyRingRequest)
+ private static final com.google.cloud.kms.v1.CreateKeyRingRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.kms.v1.CreateKeyRingRequest();
+ }
+
+ public static com.google.cloud.kms.v1.CreateKeyRingRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ java.lang.String getParent();
+ /**
+ * + * Required. The resource name of the location associated with the + * [KeyRings][google.cloud.kms.v1.KeyRing], in the format `projects/*/locations/*`. + *+ * + *
string parent = 1;
+ */
+ com.google.protobuf.ByteString
+ getParentBytes();
+
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ java.lang.String getKeyRingId();
+ /**
+ * + * Required. It must be unique within a location and match the regular + * expression `[a-zA-Z0-9_-]{1,63}` + *+ * + *
string key_ring_id = 2;
+ */
+ com.google.protobuf.ByteString
+ getKeyRingIdBytes();
+
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ boolean hasKeyRing();
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ com.google.cloud.kms.v1.KeyRing getKeyRing();
+ /**
+ * + * A [KeyRing][google.cloud.kms.v1.KeyRing] with initial field values. + *+ * + *
.google.cloud.kms.v1.KeyRing key_ring = 3;
+ */
+ com.google.cloud.kms.v1.KeyRingOrBuilder getKeyRingOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java
new file mode 100644
index 000000000000..a578652fdb9d
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKey.java
@@ -0,0 +1,2290 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/kms/v1/resources.proto
+
+package com.google.cloud.kms.v1;
+
+/**
+ * + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] represents a logical key that can be used for cryptographic + * operations. + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] is made up of one or more [versions][google.cloud.kms.v1.CryptoKeyVersion], which + * represent the actual key material used in cryptographic operations. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CryptoKey} + */ +public final class CryptoKey extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CryptoKey) + CryptoKeyOrBuilder { +private static final long serialVersionUID = 0L; + // Use CryptoKey.newBuilder() to construct. + private CryptoKey(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private CryptoKey() { + name_ = ""; + purpose_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CryptoKey( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + com.google.cloud.kms.v1.CryptoKeyVersion.Builder subBuilder = null; + if (primary_ != null) { + subBuilder = primary_.toBuilder(); + } + primary_ = input.readMessage(com.google.cloud.kms.v1.CryptoKeyVersion.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(primary_); + primary_ = subBuilder.buildPartial(); + } + + break; + } + case 24: { + int rawValue = input.readEnum(); + + purpose_ = rawValue; + break; + } + case 42: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (nextRotationTime_ != null) { + subBuilder = nextRotationTime_.toBuilder(); + } + nextRotationTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(nextRotationTime_); + nextRotationTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (rotationScheduleCase_ == 8) { + subBuilder = ((com.google.protobuf.Duration) rotationSchedule_).toBuilder(); + } + rotationSchedule_ = + input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.protobuf.Duration) rotationSchedule_); + rotationSchedule_ = subBuilder.buildPartial(); + } + rotationScheduleCase_ = 8; + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + labels_ = com.google.protobuf.MapField.newMapField( + LabelsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000040; + } + com.google.protobuf.MapEntry
+ * [CryptoKeyPurpose][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose] describes the capabilities of a [CryptoKey][google.cloud.kms.v1.CryptoKey]. Two + * keys with the same purpose may use different underlying algorithms, but + * must support the same set of operations. + *+ * + * Protobuf enum {@code google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose} + */ + public enum CryptoKeyPurpose + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+ * Not specified. + *+ * + *
CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0;
+ */
+ CRYPTO_KEY_PURPOSE_UNSPECIFIED(0),
+ /**
+ * + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ * + *
ENCRYPT_DECRYPT = 1;
+ */
+ ENCRYPT_DECRYPT(1),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ * + * Not specified. + *+ * + *
CRYPTO_KEY_PURPOSE_UNSPECIFIED = 0;
+ */
+ public static final int CRYPTO_KEY_PURPOSE_UNSPECIFIED_VALUE = 0;
+ /**
+ * + * [CryptoKeys][google.cloud.kms.v1.CryptoKey] with this purpose may be used with + * [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ * + *
ENCRYPT_DECRYPT = 1;
+ */
+ public static final int ENCRYPT_DECRYPT_VALUE = 1;
+
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static CryptoKeyPurpose valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static CryptoKeyPurpose forNumber(int value) {
+ switch (value) {
+ case 0: return CRYPTO_KEY_PURPOSE_UNSPECIFIED;
+ case 1: return ENCRYPT_DECRYPT;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ 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();
+ name_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int PRIMARY_FIELD_NUMBER = 2;
+ private com.google.cloud.kms.v1.CryptoKeyVersion primary_;
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public boolean hasPrimary() {
+ return primary_ != null;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion getPrimary() {
+ return primary_ == null ? com.google.cloud.kms.v1.CryptoKeyVersion.getDefaultInstance() : primary_;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getPrimaryOrBuilder() {
+ return getPrimary();
+ }
+
+ public static final int PURPOSE_FIELD_NUMBER = 3;
+ private int purpose_;
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public int getPurposeValue() {
+ return purpose_;
+ }
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose getPurpose() {
+ com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose result = com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.valueOf(purpose_);
+ return result == null ? com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.UNRECOGNIZED : result;
+ }
+
+ public static final int CREATE_TIME_FIELD_NUMBER = 5;
+ private com.google.protobuf.Timestamp createTime_;
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public boolean hasCreateTime() {
+ return createTime_ != null;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public com.google.protobuf.Timestamp getCreateTime() {
+ return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
+ return getCreateTime();
+ }
+
+ public static final int NEXT_ROTATION_TIME_FIELD_NUMBER = 7;
+ private com.google.protobuf.Timestamp nextRotationTime_;
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public boolean hasNextRotationTime() {
+ return nextRotationTime_ != null;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public com.google.protobuf.Timestamp getNextRotationTime() {
+ return nextRotationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : nextRotationTime_;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() {
+ return getNextRotationTime();
+ }
+
+ public static final int ROTATION_PERIOD_FIELD_NUMBER = 8;
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public boolean hasRotationPeriod() {
+ return rotationScheduleCase_ == 8;
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public com.google.protobuf.Duration getRotationPeriod() {
+ if (rotationScheduleCase_ == 8) {
+ return (com.google.protobuf.Duration) rotationSchedule_;
+ }
+ return com.google.protobuf.Duration.getDefaultInstance();
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() {
+ if (rotationScheduleCase_ == 8) {
+ return (com.google.protobuf.Duration) rotationSchedule_;
+ }
+ return com.google.protobuf.Duration.getDefaultInstance();
+ }
+
+ public static final int LABELS_FIELD_NUMBER = 10;
+ private static final class LabelsDefaultEntryHolder {
+ static final com.google.protobuf.MapEntry<
+ java.lang.String, java.lang.String> defaultEntry =
+ com.google.protobuf.MapEntry
+ .+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public boolean containsLabels(
+ java.lang.String key) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ return internalGetLabels().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getLabelsMap()} instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public java.lang.String getLabelsOrDefault(
+ java.lang.String key,
+ java.lang.String defaultValue) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public java.lang.String getLabelsOrThrow(
+ java.lang.String key) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ java.util.Map+ * A [CryptoKey][google.cloud.kms.v1.CryptoKey] represents a logical key that can be used for cryptographic + * operations. + * A [CryptoKey][google.cloud.kms.v1.CryptoKey] is made up of one or more [versions][google.cloud.kms.v1.CryptoKeyVersion], which + * represent the actual key material used in cryptographic operations. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CryptoKey} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public Builder setName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ public Builder setNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.cloud.kms.v1.CryptoKeyVersion primary_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKeyVersion, com.google.cloud.kms.v1.CryptoKeyVersion.Builder, com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder> primaryBuilder_;
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public boolean hasPrimary() {
+ return primaryBuilder_ != null || primary_ != null;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion getPrimary() {
+ if (primaryBuilder_ == null) {
+ return primary_ == null ? com.google.cloud.kms.v1.CryptoKeyVersion.getDefaultInstance() : primary_;
+ } else {
+ return primaryBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public Builder setPrimary(com.google.cloud.kms.v1.CryptoKeyVersion value) {
+ if (primaryBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ primary_ = value;
+ onChanged();
+ } else {
+ primaryBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public Builder setPrimary(
+ com.google.cloud.kms.v1.CryptoKeyVersion.Builder builderForValue) {
+ if (primaryBuilder_ == null) {
+ primary_ = builderForValue.build();
+ onChanged();
+ } else {
+ primaryBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public Builder mergePrimary(com.google.cloud.kms.v1.CryptoKeyVersion value) {
+ if (primaryBuilder_ == null) {
+ if (primary_ != null) {
+ primary_ =
+ com.google.cloud.kms.v1.CryptoKeyVersion.newBuilder(primary_).mergeFrom(value).buildPartial();
+ } else {
+ primary_ = value;
+ }
+ onChanged();
+ } else {
+ primaryBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public Builder clearPrimary() {
+ if (primaryBuilder_ == null) {
+ primary_ = null;
+ onChanged();
+ } else {
+ primary_ = null;
+ primaryBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion.Builder getPrimaryBuilder() {
+
+ onChanged();
+ return getPrimaryFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getPrimaryOrBuilder() {
+ if (primaryBuilder_ != null) {
+ return primaryBuilder_.getMessageOrBuilder();
+ } else {
+ return primary_ == null ?
+ com.google.cloud.kms.v1.CryptoKeyVersion.getDefaultInstance() : primary_;
+ }
+ }
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKeyVersion, com.google.cloud.kms.v1.CryptoKeyVersion.Builder, com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder>
+ getPrimaryFieldBuilder() {
+ if (primaryBuilder_ == null) {
+ primaryBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.cloud.kms.v1.CryptoKeyVersion, com.google.cloud.kms.v1.CryptoKeyVersion.Builder, com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder>(
+ getPrimary(),
+ getParentForChildren(),
+ isClean());
+ primary_ = null;
+ }
+ return primaryBuilder_;
+ }
+
+ private int purpose_ = 0;
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public int getPurposeValue() {
+ return purpose_;
+ }
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public Builder setPurposeValue(int value) {
+ purpose_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose getPurpose() {
+ com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose result = com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.valueOf(purpose_);
+ return result == null ? com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.UNRECOGNIZED : result;
+ }
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public Builder setPurpose(com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ purpose_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ public Builder clearPurpose() {
+
+ purpose_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.Timestamp createTime_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_;
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public boolean hasCreateTime() {
+ return createTimeBuilder_ != null || createTime_ != null;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public com.google.protobuf.Timestamp getCreateTime() {
+ if (createTimeBuilder_ == null) {
+ return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
+ } else {
+ return createTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public Builder setCreateTime(com.google.protobuf.Timestamp value) {
+ if (createTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ createTime_ = value;
+ onChanged();
+ } else {
+ createTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public Builder setCreateTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (createTimeBuilder_ == null) {
+ createTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ createTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
+ if (createTimeBuilder_ == null) {
+ if (createTime_ != null) {
+ createTime_ =
+ com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial();
+ } else {
+ createTime_ = value;
+ }
+ onChanged();
+ } else {
+ createTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public Builder clearCreateTime() {
+ if (createTimeBuilder_ == null) {
+ createTime_ = null;
+ onChanged();
+ } else {
+ createTime_ = null;
+ createTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
+
+ onChanged();
+ return getCreateTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
+ if (createTimeBuilder_ != null) {
+ return createTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return createTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
+ }
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getCreateTimeFieldBuilder() {
+ if (createTimeBuilder_ == null) {
+ createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getCreateTime(),
+ getParentForChildren(),
+ isClean());
+ createTime_ = null;
+ }
+ return createTimeBuilder_;
+ }
+
+ private com.google.protobuf.Timestamp nextRotationTime_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> nextRotationTimeBuilder_;
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public boolean hasNextRotationTime() {
+ return nextRotationTimeBuilder_ != null || nextRotationTime_ != null;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public com.google.protobuf.Timestamp getNextRotationTime() {
+ if (nextRotationTimeBuilder_ == null) {
+ return nextRotationTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : nextRotationTime_;
+ } else {
+ return nextRotationTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public Builder setNextRotationTime(com.google.protobuf.Timestamp value) {
+ if (nextRotationTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ nextRotationTime_ = value;
+ onChanged();
+ } else {
+ nextRotationTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public Builder setNextRotationTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (nextRotationTimeBuilder_ == null) {
+ nextRotationTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ nextRotationTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public Builder mergeNextRotationTime(com.google.protobuf.Timestamp value) {
+ if (nextRotationTimeBuilder_ == null) {
+ if (nextRotationTime_ != null) {
+ nextRotationTime_ =
+ com.google.protobuf.Timestamp.newBuilder(nextRotationTime_).mergeFrom(value).buildPartial();
+ } else {
+ nextRotationTime_ = value;
+ }
+ onChanged();
+ } else {
+ nextRotationTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public Builder clearNextRotationTime() {
+ if (nextRotationTimeBuilder_ == null) {
+ nextRotationTime_ = null;
+ onChanged();
+ } else {
+ nextRotationTime_ = null;
+ nextRotationTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public com.google.protobuf.Timestamp.Builder getNextRotationTimeBuilder() {
+
+ onChanged();
+ return getNextRotationTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ public com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder() {
+ if (nextRotationTimeBuilder_ != null) {
+ return nextRotationTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return nextRotationTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : nextRotationTime_;
+ }
+ }
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getNextRotationTimeFieldBuilder() {
+ if (nextRotationTimeBuilder_ == null) {
+ nextRotationTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getNextRotationTime(),
+ getParentForChildren(),
+ isClean());
+ nextRotationTime_ = null;
+ }
+ return nextRotationTimeBuilder_;
+ }
+
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> rotationPeriodBuilder_;
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public boolean hasRotationPeriod() {
+ return rotationScheduleCase_ == 8;
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public com.google.protobuf.Duration getRotationPeriod() {
+ if (rotationPeriodBuilder_ == null) {
+ if (rotationScheduleCase_ == 8) {
+ return (com.google.protobuf.Duration) rotationSchedule_;
+ }
+ return com.google.protobuf.Duration.getDefaultInstance();
+ } else {
+ if (rotationScheduleCase_ == 8) {
+ return rotationPeriodBuilder_.getMessage();
+ }
+ return com.google.protobuf.Duration.getDefaultInstance();
+ }
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public Builder setRotationPeriod(com.google.protobuf.Duration value) {
+ if (rotationPeriodBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ rotationSchedule_ = value;
+ onChanged();
+ } else {
+ rotationPeriodBuilder_.setMessage(value);
+ }
+ rotationScheduleCase_ = 8;
+ return this;
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public Builder setRotationPeriod(
+ com.google.protobuf.Duration.Builder builderForValue) {
+ if (rotationPeriodBuilder_ == null) {
+ rotationSchedule_ = builderForValue.build();
+ onChanged();
+ } else {
+ rotationPeriodBuilder_.setMessage(builderForValue.build());
+ }
+ rotationScheduleCase_ = 8;
+ return this;
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public Builder mergeRotationPeriod(com.google.protobuf.Duration value) {
+ if (rotationPeriodBuilder_ == null) {
+ if (rotationScheduleCase_ == 8 &&
+ rotationSchedule_ != com.google.protobuf.Duration.getDefaultInstance()) {
+ rotationSchedule_ = com.google.protobuf.Duration.newBuilder((com.google.protobuf.Duration) rotationSchedule_)
+ .mergeFrom(value).buildPartial();
+ } else {
+ rotationSchedule_ = value;
+ }
+ onChanged();
+ } else {
+ if (rotationScheduleCase_ == 8) {
+ rotationPeriodBuilder_.mergeFrom(value);
+ }
+ rotationPeriodBuilder_.setMessage(value);
+ }
+ rotationScheduleCase_ = 8;
+ return this;
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public Builder clearRotationPeriod() {
+ if (rotationPeriodBuilder_ == null) {
+ if (rotationScheduleCase_ == 8) {
+ rotationScheduleCase_ = 0;
+ rotationSchedule_ = null;
+ onChanged();
+ }
+ } else {
+ if (rotationScheduleCase_ == 8) {
+ rotationScheduleCase_ = 0;
+ rotationSchedule_ = null;
+ }
+ rotationPeriodBuilder_.clear();
+ }
+ return this;
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public com.google.protobuf.Duration.Builder getRotationPeriodBuilder() {
+ return getRotationPeriodFieldBuilder().getBuilder();
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ public com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder() {
+ if ((rotationScheduleCase_ == 8) && (rotationPeriodBuilder_ != null)) {
+ return rotationPeriodBuilder_.getMessageOrBuilder();
+ } else {
+ if (rotationScheduleCase_ == 8) {
+ return (com.google.protobuf.Duration) rotationSchedule_;
+ }
+ return com.google.protobuf.Duration.getDefaultInstance();
+ }
+ }
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>
+ getRotationPeriodFieldBuilder() {
+ if (rotationPeriodBuilder_ == null) {
+ if (!(rotationScheduleCase_ == 8)) {
+ rotationSchedule_ = com.google.protobuf.Duration.getDefaultInstance();
+ }
+ rotationPeriodBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>(
+ (com.google.protobuf.Duration) rotationSchedule_,
+ getParentForChildren(),
+ isClean());
+ rotationSchedule_ = null;
+ }
+ rotationScheduleCase_ = 8;
+ onChanged();;
+ return rotationPeriodBuilder_;
+ }
+
+ private com.google.protobuf.MapField<
+ java.lang.String, java.lang.String> labels_;
+ private com.google.protobuf.MapField+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public boolean containsLabels(
+ java.lang.String key) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ return internalGetLabels().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getLabelsMap()} instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public java.lang.String getLabelsOrDefault(
+ java.lang.String key,
+ java.lang.String defaultValue) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public java.lang.String getLabelsOrThrow(
+ java.lang.String key) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public Builder removeLabels(
+ java.lang.String key) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ internalGetMutableLabels().getMutableMap()
+ .remove(key);
+ return this;
+ }
+ /**
+ * Use alternate mutation accessors instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+ public Builder putLabels(
+ java.lang.String key,
+ java.lang.String value) {
+ if (key == null) { throw new java.lang.NullPointerException(); }
+ if (value == null) { throw new java.lang.NullPointerException(); }
+ internalGetMutableLabels().getMutableMap()
+ .put(key, value);
+ return this;
+ }
+ /**
+ * + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ public Builder putAllLabels(
+ java.util.Map+ * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ java.lang.String getName();
+ /**
+ * + * Output only. The resource name for this [CryptoKey][google.cloud.kms.v1.CryptoKey] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + *+ * + *
string name = 1;
+ */
+ com.google.protobuf.ByteString
+ getNameBytes();
+
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ boolean hasPrimary();
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ com.google.cloud.kms.v1.CryptoKeyVersion getPrimary();
+ /**
+ * + * Output only. A copy of the "primary" [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] that will be used + * by [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] when this [CryptoKey][google.cloud.kms.v1.CryptoKey] is given + * in [EncryptRequest.name][google.cloud.kms.v1.EncryptRequest.name]. + * The [CryptoKey][google.cloud.kms.v1.CryptoKey]'s primary version can be updated via + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion primary = 2;
+ */
+ com.google.cloud.kms.v1.CryptoKeyVersionOrBuilder getPrimaryOrBuilder();
+
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ int getPurposeValue();
+ /**
+ * + * The immutable purpose of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. Currently, the only acceptable + * purpose is [ENCRYPT_DECRYPT][google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose.ENCRYPT_DECRYPT]. + *+ * + *
.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose purpose = 3;
+ */
+ com.google.cloud.kms.v1.CryptoKey.CryptoKeyPurpose getPurpose();
+
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ boolean hasCreateTime();
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ com.google.protobuf.Timestamp getCreateTime();
+ /**
+ * + * Output only. The time at which this [CryptoKey][google.cloud.kms.v1.CryptoKey] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 5;
+ */
+ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();
+
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ boolean hasNextRotationTime();
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ com.google.protobuf.Timestamp getNextRotationTime();
+ /**
+ * + * At [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time], the Key Management Service will automatically: + * 1. Create a new version of this [CryptoKey][google.cloud.kms.v1.CryptoKey]. + * 2. Mark the new version as primary. + * Key rotations performed manually via + * [CreateCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.CreateCryptoKeyVersion] and + * [UpdateCryptoKeyPrimaryVersion][google.cloud.kms.v1.KeyManagementService.UpdateCryptoKeyPrimaryVersion] + * do not affect [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time]. + *+ * + *
.google.protobuf.Timestamp next_rotation_time = 7;
+ */
+ com.google.protobuf.TimestampOrBuilder getNextRotationTimeOrBuilder();
+
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ boolean hasRotationPeriod();
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ com.google.protobuf.Duration getRotationPeriod();
+ /**
+ * + * [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] will be advanced by this period when the service + * automatically rotates a key. Must be at least one day. + * If [rotation_period][google.cloud.kms.v1.CryptoKey.rotation_period] is set, [next_rotation_time][google.cloud.kms.v1.CryptoKey.next_rotation_time] must also be set. + *+ * + *
.google.protobuf.Duration rotation_period = 8;
+ */
+ com.google.protobuf.DurationOrBuilder getRotationPeriodOrBuilder();
+
+ /**
+ * + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+ int getLabelsCount();
+ /**
+ * + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+ boolean containsLabels(
+ java.lang.String key);
+ /**
+ * Use {@link #getLabelsMap()} instead.
+ */
+ @java.lang.Deprecated
+ java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+ java.util.Map+ * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ java.lang.String getLabelsOrDefault(
+ java.lang.String key,
+ java.lang.String defaultValue);
+ /**
+ * + * Labels with user-defined metadata. For more information, see + * [Labeling Keys](/kms/docs/labeling-keys). + *+ * + *
map<string, string> labels = 10;
+ */
+
+ java.lang.String getLabelsOrThrow(
+ java.lang.String key);
+
+ public com.google.cloud.kms.v1.CryptoKey.RotationScheduleCase getRotationScheduleCase();
+}
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyPathName.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyPathName.java
new file mode 100644
index 000000000000..fbc51e1779e3
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/CryptoKeyPathName.java
@@ -0,0 +1,235 @@
+/*
+ * Copyright 2018 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
+ *
+ * http://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.
+ */
+
+package com.google.cloud.kms.v1;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import com.google.api.pathtemplate.PathTemplate;
+import com.google.api.resourcenames.ResourceName;
+import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS
+@javax.annotation.Generated("by GAPIC protoc plugin")
+public class CryptoKeyPathName implements ResourceName {
+
+ private static final PathTemplate PATH_TEMPLATE =
+ PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path=**}");
+
+ private volatile Map+ * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents an individual cryptographic key, and the + * associated key material. + * It can be used for cryptographic operations either directly, or via its + * parent [CryptoKey][google.cloud.kms.v1.CryptoKey], in which case the server will choose the appropriate + * version for the operation. + * For security reasons, the raw cryptographic key material represented by a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] can never be viewed or exported. It can only be used to + * encrypt or decrypt data when an authorized user or application invokes Cloud + * KMS. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CryptoKeyVersion} + */ +public final class CryptoKeyVersion extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.CryptoKeyVersion) + CryptoKeyVersionOrBuilder { +private static final long serialVersionUID = 0L; + // Use CryptoKeyVersion.newBuilder() to construct. + private CryptoKeyVersion(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private CryptoKeyVersion() { + name_ = ""; + state_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CryptoKeyVersion( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 24: { + int rawValue = input.readEnum(); + + state_ = rawValue; + break; + } + case 34: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (destroyTime_ != null) { + subBuilder = destroyTime_.toBuilder(); + } + destroyTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(destroyTime_); + destroyTime_ = subBuilder.buildPartial(); + } + + break; + } + case 50: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (destroyEventTime_ != null) { + subBuilder = destroyEventTime_.toBuilder(); + } + destroyEventTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(destroyEventTime_); + destroyEventTime_ = subBuilder.buildPartial(); + } + + 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.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersion_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsResourcesProto.internal_static_google_cloud_kms_v1_CryptoKeyVersion_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.CryptoKeyVersion.class, com.google.cloud.kms.v1.CryptoKeyVersion.Builder.class); + } + + /** + *
+ * The state of a [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion], indicating if it can be used. + *+ * + * Protobuf enum {@code google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState} + */ + public enum CryptoKeyVersionState + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+ * Not specified. + *+ * + *
CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0;
+ */
+ CRYPTO_KEY_VERSION_STATE_UNSPECIFIED(0),
+ /**
+ * + * This version may be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] requests. + *+ * + *
ENABLED = 1;
+ */
+ ENABLED(1),
+ /**
+ * + * This version may not be used, but the key material is still available, + * and the version can be placed back into the [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] state. + *+ * + *
DISABLED = 2;
+ */
+ DISABLED(2),
+ /**
+ * + * This version is destroyed, and the key material is no longer stored. + * A version may not leave this state once entered. + *+ * + *
DESTROYED = 3;
+ */
+ DESTROYED(3),
+ /**
+ * + * This version is scheduled for destruction, and will be destroyed soon. + * Call + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * to put it back into the [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] state. + *+ * + *
DESTROY_SCHEDULED = 4;
+ */
+ DESTROY_SCHEDULED(4),
+ UNRECOGNIZED(-1),
+ ;
+
+ /**
+ * + * Not specified. + *+ * + *
CRYPTO_KEY_VERSION_STATE_UNSPECIFIED = 0;
+ */
+ public static final int CRYPTO_KEY_VERSION_STATE_UNSPECIFIED_VALUE = 0;
+ /**
+ * + * This version may be used in [Encrypt][google.cloud.kms.v1.KeyManagementService.Encrypt] and + * [Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt] requests. + *+ * + *
ENABLED = 1;
+ */
+ public static final int ENABLED_VALUE = 1;
+ /**
+ * + * This version may not be used, but the key material is still available, + * and the version can be placed back into the [ENABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.ENABLED] state. + *+ * + *
DISABLED = 2;
+ */
+ public static final int DISABLED_VALUE = 2;
+ /**
+ * + * This version is destroyed, and the key material is no longer stored. + * A version may not leave this state once entered. + *+ * + *
DESTROYED = 3;
+ */
+ public static final int DESTROYED_VALUE = 3;
+ /**
+ * + * This version is scheduled for destruction, and will be destroyed soon. + * Call + * [RestoreCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.RestoreCryptoKeyVersion] + * to put it back into the [DISABLED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DISABLED] state. + *+ * + *
DESTROY_SCHEDULED = 4;
+ */
+ public static final int DESTROY_SCHEDULED_VALUE = 4;
+
+
+ public final int getNumber() {
+ if (this == UNRECOGNIZED) {
+ throw new java.lang.IllegalArgumentException(
+ "Can't get the number of an unknown enum value.");
+ }
+ return value;
+ }
+
+ /**
+ * @deprecated Use {@link #forNumber(int)} instead.
+ */
+ @java.lang.Deprecated
+ public static CryptoKeyVersionState valueOf(int value) {
+ return forNumber(value);
+ }
+
+ public static CryptoKeyVersionState forNumber(int value) {
+ switch (value) {
+ case 0: return CRYPTO_KEY_VERSION_STATE_UNSPECIFIED;
+ case 1: return ENABLED;
+ case 2: return DISABLED;
+ case 3: return DESTROYED;
+ case 4: return DESTROY_SCHEDULED;
+ default: return null;
+ }
+ }
+
+ public static com.google.protobuf.Internal.EnumLiteMap+ * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ 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();
+ name_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int STATE_FIELD_NUMBER = 3;
+ private int state_;
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public int getStateValue() {
+ return state_;
+ }
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState() {
+ com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.valueOf(state_);
+ return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.UNRECOGNIZED : result;
+ }
+
+ public static final int CREATE_TIME_FIELD_NUMBER = 4;
+ private com.google.protobuf.Timestamp createTime_;
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public boolean hasCreateTime() {
+ return createTime_ != null;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public com.google.protobuf.Timestamp getCreateTime() {
+ return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
+ return getCreateTime();
+ }
+
+ public static final int DESTROY_TIME_FIELD_NUMBER = 5;
+ private com.google.protobuf.Timestamp destroyTime_;
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public boolean hasDestroyTime() {
+ return destroyTime_ != null;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public com.google.protobuf.Timestamp getDestroyTime() {
+ return destroyTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : destroyTime_;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public com.google.protobuf.TimestampOrBuilder getDestroyTimeOrBuilder() {
+ return getDestroyTime();
+ }
+
+ public static final int DESTROY_EVENT_TIME_FIELD_NUMBER = 6;
+ private com.google.protobuf.Timestamp destroyEventTime_;
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public boolean hasDestroyEventTime() {
+ return destroyEventTime_ != null;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public com.google.protobuf.Timestamp getDestroyEventTime() {
+ return destroyEventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : destroyEventTime_;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public com.google.protobuf.TimestampOrBuilder getDestroyEventTimeOrBuilder() {
+ return getDestroyEventTime();
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!getNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
+ }
+ if (state_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.CRYPTO_KEY_VERSION_STATE_UNSPECIFIED.getNumber()) {
+ output.writeEnum(3, state_);
+ }
+ if (createTime_ != null) {
+ output.writeMessage(4, getCreateTime());
+ }
+ if (destroyTime_ != null) {
+ output.writeMessage(5, getDestroyTime());
+ }
+ if (destroyEventTime_ != null) {
+ output.writeMessage(6, getDestroyEventTime());
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
+ }
+ if (state_ != com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.CRYPTO_KEY_VERSION_STATE_UNSPECIFIED.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(3, state_);
+ }
+ if (createTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(4, getCreateTime());
+ }
+ if (destroyTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, getDestroyTime());
+ }
+ if (destroyEventTime_ != null) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(6, getDestroyEventTime());
+ }
+ 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.kms.v1.CryptoKeyVersion)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.kms.v1.CryptoKeyVersion other = (com.google.cloud.kms.v1.CryptoKeyVersion) obj;
+
+ boolean result = true;
+ result = result && getName()
+ .equals(other.getName());
+ result = result && state_ == other.state_;
+ result = result && (hasCreateTime() == other.hasCreateTime());
+ if (hasCreateTime()) {
+ result = result && getCreateTime()
+ .equals(other.getCreateTime());
+ }
+ result = result && (hasDestroyTime() == other.hasDestroyTime());
+ if (hasDestroyTime()) {
+ result = result && getDestroyTime()
+ .equals(other.getDestroyTime());
+ }
+ result = result && (hasDestroyEventTime() == other.hasDestroyEventTime());
+ if (hasDestroyEventTime()) {
+ result = result && getDestroyEventTime()
+ .equals(other.getDestroyEventTime());
+ }
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + STATE_FIELD_NUMBER;
+ hash = (53 * hash) + state_;
+ if (hasCreateTime()) {
+ hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getCreateTime().hashCode();
+ }
+ if (hasDestroyTime()) {
+ hash = (37 * hash) + DESTROY_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getDestroyTime().hashCode();
+ }
+ if (hasDestroyEventTime()) {
+ hash = (37 * hash) + DESTROY_EVENT_TIME_FIELD_NUMBER;
+ hash = (53 * hash) + getDestroyEventTime().hashCode();
+ }
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.kms.v1.CryptoKeyVersion parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion 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.kms.v1.CryptoKeyVersion parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion 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.kms.v1.CryptoKeyVersion parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion 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.kms.v1.CryptoKeyVersion parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion 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.kms.v1.CryptoKeyVersion parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.CryptoKeyVersion parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.cloud.kms.v1.CryptoKeyVersion prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ 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;
+ }
+ /**
+ * + * A [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] represents an individual cryptographic key, and the + * associated key material. + * It can be used for cryptographic operations either directly, or via its + * parent [CryptoKey][google.cloud.kms.v1.CryptoKey], in which case the server will choose the appropriate + * version for the operation. + * For security reasons, the raw cryptographic key material represented by a + * [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] can never be viewed or exported. It can only be used to + * encrypt or decrypt data when an authorized user or application invokes Cloud + * KMS. + *+ * + * Protobuf type {@code google.cloud.kms.v1.CryptoKeyVersion} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public Builder setName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ public Builder setNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ private int state_ = 0;
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public int getStateValue() {
+ return state_;
+ }
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public Builder setStateValue(int value) {
+ state_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState() {
+ com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState result = com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.valueOf(state_);
+ return result == null ? com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.UNRECOGNIZED : result;
+ }
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public Builder setState(com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ state_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ public Builder clearState() {
+
+ state_ = 0;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.Timestamp createTime_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> createTimeBuilder_;
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public boolean hasCreateTime() {
+ return createTimeBuilder_ != null || createTime_ != null;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public com.google.protobuf.Timestamp getCreateTime() {
+ if (createTimeBuilder_ == null) {
+ return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
+ } else {
+ return createTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public Builder setCreateTime(com.google.protobuf.Timestamp value) {
+ if (createTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ createTime_ = value;
+ onChanged();
+ } else {
+ createTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public Builder setCreateTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (createTimeBuilder_ == null) {
+ createTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ createTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public Builder mergeCreateTime(com.google.protobuf.Timestamp value) {
+ if (createTimeBuilder_ == null) {
+ if (createTime_ != null) {
+ createTime_ =
+ com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial();
+ } else {
+ createTime_ = value;
+ }
+ onChanged();
+ } else {
+ createTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public Builder clearCreateTime() {
+ if (createTimeBuilder_ == null) {
+ createTime_ = null;
+ onChanged();
+ } else {
+ createTime_ = null;
+ createTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() {
+
+ onChanged();
+ return getCreateTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() {
+ if (createTimeBuilder_ != null) {
+ return createTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return createTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : createTime_;
+ }
+ }
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getCreateTimeFieldBuilder() {
+ if (createTimeBuilder_ == null) {
+ createTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getCreateTime(),
+ getParentForChildren(),
+ isClean());
+ createTime_ = null;
+ }
+ return createTimeBuilder_;
+ }
+
+ private com.google.protobuf.Timestamp destroyTime_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> destroyTimeBuilder_;
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public boolean hasDestroyTime() {
+ return destroyTimeBuilder_ != null || destroyTime_ != null;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public com.google.protobuf.Timestamp getDestroyTime() {
+ if (destroyTimeBuilder_ == null) {
+ return destroyTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : destroyTime_;
+ } else {
+ return destroyTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public Builder setDestroyTime(com.google.protobuf.Timestamp value) {
+ if (destroyTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ destroyTime_ = value;
+ onChanged();
+ } else {
+ destroyTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public Builder setDestroyTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (destroyTimeBuilder_ == null) {
+ destroyTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ destroyTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public Builder mergeDestroyTime(com.google.protobuf.Timestamp value) {
+ if (destroyTimeBuilder_ == null) {
+ if (destroyTime_ != null) {
+ destroyTime_ =
+ com.google.protobuf.Timestamp.newBuilder(destroyTime_).mergeFrom(value).buildPartial();
+ } else {
+ destroyTime_ = value;
+ }
+ onChanged();
+ } else {
+ destroyTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public Builder clearDestroyTime() {
+ if (destroyTimeBuilder_ == null) {
+ destroyTime_ = null;
+ onChanged();
+ } else {
+ destroyTime_ = null;
+ destroyTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public com.google.protobuf.Timestamp.Builder getDestroyTimeBuilder() {
+
+ onChanged();
+ return getDestroyTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ public com.google.protobuf.TimestampOrBuilder getDestroyTimeOrBuilder() {
+ if (destroyTimeBuilder_ != null) {
+ return destroyTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return destroyTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : destroyTime_;
+ }
+ }
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getDestroyTimeFieldBuilder() {
+ if (destroyTimeBuilder_ == null) {
+ destroyTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getDestroyTime(),
+ getParentForChildren(),
+ isClean());
+ destroyTime_ = null;
+ }
+ return destroyTimeBuilder_;
+ }
+
+ private com.google.protobuf.Timestamp destroyEventTime_ = null;
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> destroyEventTimeBuilder_;
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public boolean hasDestroyEventTime() {
+ return destroyEventTimeBuilder_ != null || destroyEventTime_ != null;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public com.google.protobuf.Timestamp getDestroyEventTime() {
+ if (destroyEventTimeBuilder_ == null) {
+ return destroyEventTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : destroyEventTime_;
+ } else {
+ return destroyEventTimeBuilder_.getMessage();
+ }
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public Builder setDestroyEventTime(com.google.protobuf.Timestamp value) {
+ if (destroyEventTimeBuilder_ == null) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ destroyEventTime_ = value;
+ onChanged();
+ } else {
+ destroyEventTimeBuilder_.setMessage(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public Builder setDestroyEventTime(
+ com.google.protobuf.Timestamp.Builder builderForValue) {
+ if (destroyEventTimeBuilder_ == null) {
+ destroyEventTime_ = builderForValue.build();
+ onChanged();
+ } else {
+ destroyEventTimeBuilder_.setMessage(builderForValue.build());
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public Builder mergeDestroyEventTime(com.google.protobuf.Timestamp value) {
+ if (destroyEventTimeBuilder_ == null) {
+ if (destroyEventTime_ != null) {
+ destroyEventTime_ =
+ com.google.protobuf.Timestamp.newBuilder(destroyEventTime_).mergeFrom(value).buildPartial();
+ } else {
+ destroyEventTime_ = value;
+ }
+ onChanged();
+ } else {
+ destroyEventTimeBuilder_.mergeFrom(value);
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public Builder clearDestroyEventTime() {
+ if (destroyEventTimeBuilder_ == null) {
+ destroyEventTime_ = null;
+ onChanged();
+ } else {
+ destroyEventTime_ = null;
+ destroyEventTimeBuilder_ = null;
+ }
+
+ return this;
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public com.google.protobuf.Timestamp.Builder getDestroyEventTimeBuilder() {
+
+ onChanged();
+ return getDestroyEventTimeFieldBuilder().getBuilder();
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ public com.google.protobuf.TimestampOrBuilder getDestroyEventTimeOrBuilder() {
+ if (destroyEventTimeBuilder_ != null) {
+ return destroyEventTimeBuilder_.getMessageOrBuilder();
+ } else {
+ return destroyEventTime_ == null ?
+ com.google.protobuf.Timestamp.getDefaultInstance() : destroyEventTime_;
+ }
+ }
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ private com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>
+ getDestroyEventTimeFieldBuilder() {
+ if (destroyEventTimeBuilder_ == null) {
+ destroyEventTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
+ com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
+ getDestroyEventTime(),
+ getParentForChildren(),
+ isClean());
+ destroyEventTime_ = null;
+ }
+ return destroyEventTimeBuilder_;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.CryptoKeyVersion)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.CryptoKeyVersion)
+ private static final com.google.cloud.kms.v1.CryptoKeyVersion DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.kms.v1.CryptoKeyVersion();
+ }
+
+ public static com.google.cloud.kms.v1.CryptoKeyVersion getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser+ * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ java.lang.String getName();
+ /**
+ * + * Output only. The resource name for this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] in the format + * `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + *+ * + *
string name = 1;
+ */
+ com.google.protobuf.ByteString
+ getNameBytes();
+
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ int getStateValue();
+ /**
+ * + * The current state of the [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. + *+ * + *
.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState state = 3;
+ */
+ com.google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState getState();
+
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ boolean hasCreateTime();
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ com.google.protobuf.Timestamp getCreateTime();
+ /**
+ * + * Output only. The time at which this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] was created. + *+ * + *
.google.protobuf.Timestamp create_time = 4;
+ */
+ com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();
+
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ boolean hasDestroyTime();
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ com.google.protobuf.Timestamp getDestroyTime();
+ /**
+ * + * Output only. The time this [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]'s key material is scheduled + * for destruction. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROY_SCHEDULED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROY_SCHEDULED]. + *+ * + *
.google.protobuf.Timestamp destroy_time = 5;
+ */
+ com.google.protobuf.TimestampOrBuilder getDestroyTimeOrBuilder();
+
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ boolean hasDestroyEventTime();
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ com.google.protobuf.Timestamp getDestroyEventTime();
+ /**
+ * + * Output only. The time this CryptoKeyVersion's key material was + * destroyed. Only present if [state][google.cloud.kms.v1.CryptoKeyVersion.state] is + * [DESTROYED][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState.DESTROYED]. + *+ * + *
.google.protobuf.Timestamp destroy_event_time = 6;
+ */
+ com.google.protobuf.TimestampOrBuilder getDestroyEventTimeOrBuilder();
+}
diff --git a/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptRequest.java b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptRequest.java
new file mode 100644
index 000000000000..20c8be6960a4
--- /dev/null
+++ b/google-api-grpc/proto-google-cloud-kms-v1/src/main/java/com/google/cloud/kms/v1/DecryptRequest.java
@@ -0,0 +1,721 @@
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/cloud/kms/v1/service.proto
+
+package com.google.cloud.kms.v1;
+
+/**
+ * + * Request message for [KeyManagementService.Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.DecryptRequest} + */ +public final class DecryptRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.cloud.kms.v1.DecryptRequest) + DecryptRequestOrBuilder { +private static final long serialVersionUID = 0L; + // Use DecryptRequest.newBuilder() to construct. + private DecryptRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) { + super(builder); + } + private DecryptRequest() { + name_ = ""; + ciphertext_ = com.google.protobuf.ByteString.EMPTY; + additionalAuthenticatedData_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DecryptRequest( + 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; + default: { + if (!parseUnknownFieldProto3( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + + ciphertext_ = input.readBytes(); + break; + } + case 26: { + + additionalAuthenticatedData_ = input.readBytes(); + 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.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_DecryptRequest_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.kms.v1.KmsProto.internal_static_google_cloud_kms_v1_DecryptRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.kms.v1.DecryptRequest.class, com.google.cloud.kms.v1.DecryptRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+ * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ 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();
+ name_ = s;
+ return s;
+ }
+ }
+ /**
+ * + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+
+ public static final int CIPHERTEXT_FIELD_NUMBER = 2;
+ private com.google.protobuf.ByteString ciphertext_;
+ /**
+ * + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + *+ * + *
bytes ciphertext = 2;
+ */
+ public com.google.protobuf.ByteString getCiphertext() {
+ return ciphertext_;
+ }
+
+ public static final int ADDITIONAL_AUTHENTICATED_DATA_FIELD_NUMBER = 3;
+ private com.google.protobuf.ByteString additionalAuthenticatedData_;
+ /**
+ * + * Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + *+ * + *
bytes additional_authenticated_data = 3;
+ */
+ public com.google.protobuf.ByteString getAdditionalAuthenticatedData() {
+ return additionalAuthenticatedData_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (!getNameBytes().isEmpty()) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
+ }
+ if (!ciphertext_.isEmpty()) {
+ output.writeBytes(2, ciphertext_);
+ }
+ if (!additionalAuthenticatedData_.isEmpty()) {
+ output.writeBytes(3, additionalAuthenticatedData_);
+ }
+ unknownFields.writeTo(output);
+ }
+
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (!getNameBytes().isEmpty()) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
+ }
+ if (!ciphertext_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(2, ciphertext_);
+ }
+ if (!additionalAuthenticatedData_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(3, additionalAuthenticatedData_);
+ }
+ 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.kms.v1.DecryptRequest)) {
+ return super.equals(obj);
+ }
+ com.google.cloud.kms.v1.DecryptRequest other = (com.google.cloud.kms.v1.DecryptRequest) obj;
+
+ boolean result = true;
+ result = result && getName()
+ .equals(other.getName());
+ result = result && getCiphertext()
+ .equals(other.getCiphertext());
+ result = result && getAdditionalAuthenticatedData()
+ .equals(other.getAdditionalAuthenticatedData());
+ result = result && unknownFields.equals(other.unknownFields);
+ return result;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + NAME_FIELD_NUMBER;
+ hash = (53 * hash) + getName().hashCode();
+ hash = (37 * hash) + CIPHERTEXT_FIELD_NUMBER;
+ hash = (53 * hash) + getCiphertext().hashCode();
+ hash = (37 * hash) + ADDITIONAL_AUTHENTICATED_DATA_FIELD_NUMBER;
+ hash = (53 * hash) + getAdditionalAuthenticatedData().hashCode();
+ hash = (29 * hash) + unknownFields.hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static com.google.cloud.kms.v1.DecryptRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest 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.kms.v1.DecryptRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest 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.kms.v1.DecryptRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest 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.kms.v1.DecryptRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest 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.kms.v1.DecryptRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static com.google.cloud.kms.v1.DecryptRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(com.google.cloud.kms.v1.DecryptRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ 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;
+ }
+ /**
+ * + * Request message for [KeyManagementService.Decrypt][google.cloud.kms.v1.KeyManagementService.Decrypt]. + *+ * + * Protobuf type {@code google.cloud.kms.v1.DecryptRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder
+ * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public java.lang.String getName() {
+ java.lang.Object ref = name_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ name_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
+ }
+ /**
+ * + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public com.google.protobuf.ByteString
+ getNameBytes() {
+ java.lang.Object ref = name_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ name_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public Builder setName(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public Builder clearName() {
+
+ name_ = getDefaultInstance().getName();
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The resource name of the [CryptoKey][google.cloud.kms.v1.CryptoKey] to use for decryption. + * The server will choose the appropriate version. + *+ * + *
string name = 1;
+ */
+ public Builder setNameBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
+
+ name_ = value;
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString ciphertext_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + *+ * + *
bytes ciphertext = 2;
+ */
+ public com.google.protobuf.ByteString getCiphertext() {
+ return ciphertext_;
+ }
+ /**
+ * + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + *+ * + *
bytes ciphertext = 2;
+ */
+ public Builder setCiphertext(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ ciphertext_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Required. The encrypted data originally returned in + * [EncryptResponse.ciphertext][google.cloud.kms.v1.EncryptResponse.ciphertext]. + *+ * + *
bytes ciphertext = 2;
+ */
+ public Builder clearCiphertext() {
+
+ ciphertext_ = getDefaultInstance().getCiphertext();
+ onChanged();
+ return this;
+ }
+
+ private com.google.protobuf.ByteString additionalAuthenticatedData_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * + * Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + *+ * + *
bytes additional_authenticated_data = 3;
+ */
+ public com.google.protobuf.ByteString getAdditionalAuthenticatedData() {
+ return additionalAuthenticatedData_;
+ }
+ /**
+ * + * Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + *+ * + *
bytes additional_authenticated_data = 3;
+ */
+ public Builder setAdditionalAuthenticatedData(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ additionalAuthenticatedData_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * + * Optional data that must match the data originally supplied in + * [EncryptRequest.additional_authenticated_data][google.cloud.kms.v1.EncryptRequest.additional_authenticated_data]. + *+ * + *
bytes additional_authenticated_data = 3;
+ */
+ public Builder clearAdditionalAuthenticatedData() {
+
+ additionalAuthenticatedData_ = getDefaultInstance().getAdditionalAuthenticatedData();
+ onChanged();
+ return this;
+ }
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFieldsProto3(unknownFields);
+ }
+
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:google.cloud.kms.v1.DecryptRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:google.cloud.kms.v1.DecryptRequest)
+ private static final com.google.cloud.kms.v1.DecryptRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new com.google.cloud.kms.v1.DecryptRequest();
+ }
+
+ public static com.google.cloud.kms.v1.DecryptRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser