diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java index aa9dc1668..7a76c1ce9 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClient.java @@ -1141,6 +1141,8 @@ public final UnaryCallable listCluste * .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) * .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setServeNodes(-1288838783) + * .setDefaultStorageType(StorageType.forNumber(0)) + * .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) * .build(); * Cluster response = baseBigtableInstanceAdminClient.updateClusterAsync(request).get(); * } @@ -1167,6 +1169,8 @@ public final OperationFuture updateClusterAsync( * .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) * .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setServeNodes(-1288838783) + * .setDefaultStorageType(StorageType.forNumber(0)) + * .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) * .build(); * OperationFuture future = * baseBigtableInstanceAdminClient.updateClusterOperationCallable().futureCall(request); @@ -1194,6 +1198,8 @@ public final OperationFuture updateClusterAsync( * .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) * .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) * .setServeNodes(-1288838783) + * .setDefaultStorageType(StorageType.forNumber(0)) + * .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) * .build(); * ApiFuture future = * baseBigtableInstanceAdminClient.updateClusterCallable().futureCall(request); diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json new file mode 100644 index 000000000..23321fd9a --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json @@ -0,0 +1,150 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.bigtable.admin.v2", + "libraryPackage": "com.google.cloud.bigtable.admin.v2", + "services": { + "BigtableInstanceAdmin": { + "clients": { + "grpc": { + "libraryClient": "BaseBigtableInstanceAdminClient", + "rpcs": { + "CreateAppProfile": { + "methods": ["createAppProfile", "createAppProfile", "createAppProfile", "createAppProfileCallable"] + }, + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "DeleteAppProfile": { + "methods": ["deleteAppProfile", "deleteAppProfile", "deleteAppProfile", "deleteAppProfileCallable"] + }, + "DeleteCluster": { + "methods": ["deleteCluster", "deleteCluster", "deleteCluster", "deleteClusterCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstance", "deleteInstance", "deleteInstance", "deleteInstanceCallable"] + }, + "GetAppProfile": { + "methods": ["getAppProfile", "getAppProfile", "getAppProfile", "getAppProfileCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "ListAppProfiles": { + "methods": ["listAppProfiles", "listAppProfiles", "listAppProfiles", "listAppProfilesPagedCallable", "listAppProfilesCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesCallable"] + }, + "PartialUpdateInstance": { + "methods": ["partialUpdateInstanceAsync", "partialUpdateInstanceAsync", "partialUpdateInstanceOperationCallable", "partialUpdateInstanceCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateAppProfile": { + "methods": ["updateAppProfileAsync", "updateAppProfileAsync", "updateAppProfileOperationCallable", "updateAppProfileCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstance", "updateInstanceCallable"] + } + } + } + } + }, + "BigtableTableAdmin": { + "clients": { + "grpc": { + "libraryClient": "BaseBigtableTableAdminClient", + "rpcs": { + "CheckConsistency": { + "methods": ["checkConsistency", "checkConsistency", "checkConsistency", "checkConsistencyCallable"] + }, + "CreateBackup": { + "methods": ["createBackupAsync", "createBackupAsync", "createBackupAsync", "createBackupOperationCallable", "createBackupCallable"] + }, + "CreateTable": { + "methods": ["createTable", "createTable", "createTable", "createTableCallable"] + }, + "CreateTableFromSnapshot": { + "methods": ["createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotAsync", "createTableFromSnapshotOperationCallable", "createTableFromSnapshotCallable"] + }, + "DeleteBackup": { + "methods": ["deleteBackup", "deleteBackup", "deleteBackup", "deleteBackupCallable"] + }, + "DeleteSnapshot": { + "methods": ["deleteSnapshot", "deleteSnapshot", "deleteSnapshot", "deleteSnapshotCallable"] + }, + "DeleteTable": { + "methods": ["deleteTable", "deleteTable", "deleteTable", "deleteTableCallable"] + }, + "DropRowRange": { + "methods": ["dropRowRange", "dropRowRangeCallable"] + }, + "GenerateConsistencyToken": { + "methods": ["generateConsistencyToken", "generateConsistencyToken", "generateConsistencyToken", "generateConsistencyTokenCallable"] + }, + "GetBackup": { + "methods": ["getBackup", "getBackup", "getBackup", "getBackupCallable"] + }, + "GetIamPolicy": { + "methods": ["getIamPolicy", "getIamPolicy", "getIamPolicy", "getIamPolicyCallable"] + }, + "GetSnapshot": { + "methods": ["getSnapshot", "getSnapshot", "getSnapshot", "getSnapshotCallable"] + }, + "GetTable": { + "methods": ["getTable", "getTable", "getTable", "getTableCallable"] + }, + "ListBackups": { + "methods": ["listBackups", "listBackups", "listBackups", "listBackupsPagedCallable", "listBackupsCallable"] + }, + "ListSnapshots": { + "methods": ["listSnapshots", "listSnapshots", "listSnapshots", "listSnapshotsPagedCallable", "listSnapshotsCallable"] + }, + "ListTables": { + "methods": ["listTables", "listTables", "listTables", "listTablesPagedCallable", "listTablesCallable"] + }, + "ModifyColumnFamilies": { + "methods": ["modifyColumnFamilies", "modifyColumnFamilies", "modifyColumnFamilies", "modifyColumnFamiliesCallable"] + }, + "RestoreTable": { + "methods": ["restoreTableAsync", "restoreTableOperationCallable", "restoreTableCallable"] + }, + "SetIamPolicy": { + "methods": ["setIamPolicy", "setIamPolicy", "setIamPolicy", "setIamPolicyCallable"] + }, + "SnapshotTable": { + "methods": ["snapshotTableAsync", "snapshotTableAsync", "snapshotTableAsync", "snapshotTableAsync", "snapshotTableAsync", "snapshotTableOperationCallable", "snapshotTableCallable"] + }, + "TestIamPermissions": { + "methods": ["testIamPermissions", "testIamPermissions", "testIamPermissions", "testIamPermissionsCallable"] + }, + "UpdateBackup": { + "methods": ["updateBackup", "updateBackup", "updateBackupCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java index b927f60fc..dd61c8c91 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java @@ -689,108 +689,133 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createInstanceCallable() { return createInstanceCallable; } + @Override public OperationCallable createInstanceOperationCallable() { return createInstanceOperationCallable; } + @Override public UnaryCallable getInstanceCallable() { return getInstanceCallable; } + @Override public UnaryCallable listInstancesCallable() { return listInstancesCallable; } + @Override public UnaryCallable updateInstanceCallable() { return updateInstanceCallable; } + @Override public UnaryCallable partialUpdateInstanceCallable() { return partialUpdateInstanceCallable; } + @Override public OperationCallable partialUpdateInstanceOperationCallable() { return partialUpdateInstanceOperationCallable; } + @Override public UnaryCallable deleteInstanceCallable() { return deleteInstanceCallable; } + @Override public UnaryCallable createClusterCallable() { return createClusterCallable; } + @Override public OperationCallable createClusterOperationCallable() { return createClusterOperationCallable; } + @Override public UnaryCallable getClusterCallable() { return getClusterCallable; } + @Override public UnaryCallable listClustersCallable() { return listClustersCallable; } + @Override public UnaryCallable updateClusterCallable() { return updateClusterCallable; } + @Override public OperationCallable updateClusterOperationCallable() { return updateClusterOperationCallable; } + @Override public UnaryCallable deleteClusterCallable() { return deleteClusterCallable; } + @Override public UnaryCallable createAppProfileCallable() { return createAppProfileCallable; } + @Override public UnaryCallable getAppProfileCallable() { return getAppProfileCallable; } + @Override public UnaryCallable listAppProfilesCallable() { return listAppProfilesCallable; } + @Override public UnaryCallable listAppProfilesPagedCallable() { return listAppProfilesPagedCallable; } + @Override public UnaryCallable updateAppProfileCallable() { return updateAppProfileCallable; } + @Override public OperationCallable updateAppProfileOperationCallable() { return updateAppProfileOperationCallable; } + @Override public UnaryCallable deleteAppProfileCallable() { return deleteAppProfileCallable; } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } + @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } + @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java index c8d299a46..e3573b866 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java @@ -779,126 +779,155 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public UnaryCallable createTableCallable() { return createTableCallable; } + @Override public UnaryCallable createTableFromSnapshotCallable() { return createTableFromSnapshotCallable; } + @Override public OperationCallable createTableFromSnapshotOperationCallable() { return createTableFromSnapshotOperationCallable; } + @Override public UnaryCallable listTablesCallable() { return listTablesCallable; } + @Override public UnaryCallable listTablesPagedCallable() { return listTablesPagedCallable; } + @Override public UnaryCallable getTableCallable() { return getTableCallable; } + @Override public UnaryCallable deleteTableCallable() { return deleteTableCallable; } + @Override public UnaryCallable modifyColumnFamiliesCallable() { return modifyColumnFamiliesCallable; } + @Override public UnaryCallable dropRowRangeCallable() { return dropRowRangeCallable; } + @Override public UnaryCallable generateConsistencyTokenCallable() { return generateConsistencyTokenCallable; } + @Override public UnaryCallable checkConsistencyCallable() { return checkConsistencyCallable; } + @Override public UnaryCallable snapshotTableCallable() { return snapshotTableCallable; } + @Override public OperationCallable snapshotTableOperationCallable() { return snapshotTableOperationCallable; } + @Override public UnaryCallable getSnapshotCallable() { return getSnapshotCallable; } + @Override public UnaryCallable listSnapshotsCallable() { return listSnapshotsCallable; } + @Override public UnaryCallable listSnapshotsPagedCallable() { return listSnapshotsPagedCallable; } + @Override public UnaryCallable deleteSnapshotCallable() { return deleteSnapshotCallable; } + @Override public UnaryCallable createBackupCallable() { return createBackupCallable; } + @Override public OperationCallable createBackupOperationCallable() { return createBackupOperationCallable; } + @Override public UnaryCallable getBackupCallable() { return getBackupCallable; } + @Override public UnaryCallable updateBackupCallable() { return updateBackupCallable; } + @Override public UnaryCallable deleteBackupCallable() { return deleteBackupCallable; } + @Override public UnaryCallable listBackupsCallable() { return listBackupsCallable; } + @Override public UnaryCallable listBackupsPagedCallable() { return listBackupsPagedCallable; } + @Override public UnaryCallable restoreTableCallable() { return restoreTableCallable; } + @Override public OperationCallable restoreTableOperationCallable() { return restoreTableOperationCallable; } + @Override public UnaryCallable getIamPolicyCallable() { return getIamPolicyCallable; } + @Override public UnaryCallable setIamPolicyCallable() { return setIamPolicyCallable; } + @Override public UnaryCallable testIamPermissionsCallable() { return testIamPermissionsCallable; diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json new file mode 100644 index 000000000..0891b9045 --- /dev/null +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json @@ -0,0 +1,36 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.bigtable.v2", + "libraryPackage": "com.google.cloud.bigtable.data.v2", + "services": { + "Bigtable": { + "clients": { + "grpc": { + "libraryClient": "BaseBigtableDataClient", + "rpcs": { + "CheckAndMutateRow": { + "methods": ["checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRow", "checkAndMutateRowCallable"] + }, + "MutateRow": { + "methods": ["mutateRow", "mutateRow", "mutateRow", "mutateRow", "mutateRow", "mutateRowCallable"] + }, + "MutateRows": { + "methods": ["mutateRowsCallable"] + }, + "ReadModifyWriteRow": { + "methods": ["readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRow", "readModifyWriteRowCallable"] + }, + "ReadRows": { + "methods": ["readRowsCallable"] + }, + "SampleRowKeys": { + "methods": ["sampleRowKeysCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java index 5fffb87ca..30771e20e 100644 --- a/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java +++ b/google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableStub.java @@ -272,28 +272,34 @@ public GrpcOperationsStub getOperationsStub() { return operationsStub; } + @Override public ServerStreamingCallable readRowsCallable() { return readRowsCallable; } + @Override public ServerStreamingCallable sampleRowKeysCallable() { return sampleRowKeysCallable; } + @Override public UnaryCallable mutateRowCallable() { return mutateRowCallable; } + @Override public ServerStreamingCallable mutateRowsCallable() { return mutateRowsCallable; } + @Override public UnaryCallable checkAndMutateRowCallable() { return checkAndMutateRowCallable; } + @Override public UnaryCallable readModifyWriteRowCallable() { return readModifyWriteRowCallable; diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java index 35f45fee3..f2ee6767a 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java @@ -51,6 +51,7 @@ import com.google.bigtable.admin.v2.LocationName; import com.google.bigtable.admin.v2.PartialUpdateInstanceRequest; import com.google.bigtable.admin.v2.ProjectName; +import com.google.bigtable.admin.v2.StorageType; import com.google.bigtable.admin.v2.TableName; import com.google.bigtable.admin.v2.UpdateAppProfileRequest; import com.google.common.collect.Lists; @@ -579,6 +580,8 @@ public void createClusterTest() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -633,6 +636,8 @@ public void createClusterTest2() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -687,6 +692,8 @@ public void getClusterTest() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -727,6 +734,8 @@ public void getClusterTest2() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); mockBigtableInstanceAdmin.addResponse(expectedResponse); @@ -847,6 +856,8 @@ public void updateClusterTest() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -861,6 +872,8 @@ public void updateClusterTest() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); Cluster actualResponse = client.updateClusterAsync(request).get(); @@ -875,6 +888,7 @@ public void updateClusterTest() throws Exception { Assert.assertEquals(request.getState(), actualRequest.getState()); Assert.assertEquals(request.getServeNodes(), actualRequest.getServeNodes()); Assert.assertEquals(request.getDefaultStorageType(), actualRequest.getDefaultStorageType()); + Assert.assertEquals(request.getEncryptionConfig(), actualRequest.getEncryptionConfig()); Assert.assertTrue( channelProvider.isHeaderSent( ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), @@ -892,6 +906,8 @@ public void updateClusterExceptionTest() throws Exception { .setName(ClusterName.of("[PROJECT]", "[INSTANCE]", "[CLUSTER]").toString()) .setLocation(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setServeNodes(-1288838783) + .setDefaultStorageType(StorageType.forNumber(0)) + .setEncryptionConfig(Cluster.EncryptionConfig.newBuilder().build()) .build(); client.updateClusterAsync(request).get(); Assert.fail("No exception raised"); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java index ab78fe077..5755c23aa 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClientTest.java @@ -42,6 +42,7 @@ import com.google.bigtable.admin.v2.DeleteSnapshotRequest; import com.google.bigtable.admin.v2.DeleteTableRequest; import com.google.bigtable.admin.v2.DropRowRangeRequest; +import com.google.bigtable.admin.v2.EncryptionInfo; import com.google.bigtable.admin.v2.GenerateConsistencyTokenRequest; import com.google.bigtable.admin.v2.GenerateConsistencyTokenResponse; import com.google.bigtable.admin.v2.GetBackupRequest; @@ -1486,6 +1487,7 @@ public void createBackupTest() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1543,6 +1545,7 @@ public void createBackupTest2() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) .build(); Operation resultOperation = Operation.newBuilder() @@ -1600,6 +1603,7 @@ public void getBackupTest() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -1643,6 +1647,7 @@ public void getBackupTest2() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); @@ -1686,6 +1691,7 @@ public void updateBackupTest() throws Exception { .setStartTime(Timestamp.newBuilder().build()) .setEndTime(Timestamp.newBuilder().build()) .setSizeBytes(-1796325715) + .setEncryptionInfo(EncryptionInfo.newBuilder().build()) .build(); mockBigtableTableAdmin.addResponse(expectedResponse); diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java index 37dd07da9..95ffe9d66 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableInstanceAdminImpl.java @@ -96,7 +96,13 @@ public void createInstance( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateInstance, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -110,7 +116,13 @@ public void getInstance(GetInstanceRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetInstance, expected %s or %s", + response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); } } @@ -125,7 +137,13 @@ public void listInstances( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListInstances, expected %s or %s", + response.getClass().getName(), + ListInstancesResponse.class.getName(), + Exception.class.getName()))); } } @@ -139,7 +157,13 @@ public void updateInstance(Instance request, StreamObserver responseOb } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateInstance, expected %s or %s", + response.getClass().getName(), + Instance.class.getName(), + Exception.class.getName()))); } } @@ -154,7 +178,13 @@ public void partialUpdateInstance( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method PartialUpdateInstance, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -169,7 +199,13 @@ public void deleteInstance( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteInstance, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -184,7 +220,13 @@ public void createCluster( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -198,7 +240,13 @@ public void getCluster(GetClusterRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetCluster, expected %s or %s", + response.getClass().getName(), + Cluster.class.getName(), + Exception.class.getName()))); } } @@ -213,7 +261,13 @@ public void listClusters( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListClusters, expected %s or %s", + response.getClass().getName(), + ListClustersResponse.class.getName(), + Exception.class.getName()))); } } @@ -227,7 +281,13 @@ public void updateCluster(Cluster request, StreamObserver responseObs } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateCluster, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -241,7 +301,13 @@ public void deleteCluster(DeleteClusterRequest request, StreamObserver re } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteCluster, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -256,7 +322,13 @@ public void createAppProfile( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateAppProfile, expected %s or %s", + response.getClass().getName(), + AppProfile.class.getName(), + Exception.class.getName()))); } } @@ -271,7 +343,13 @@ public void getAppProfile( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetAppProfile, expected %s or %s", + response.getClass().getName(), + AppProfile.class.getName(), + Exception.class.getName()))); } } @@ -286,7 +364,13 @@ public void listAppProfiles( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListAppProfiles, expected %s or %s", + response.getClass().getName(), + ListAppProfilesResponse.class.getName(), + Exception.class.getName()))); } } @@ -301,7 +385,13 @@ public void updateAppProfile( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateAppProfile, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -316,7 +406,13 @@ public void deleteAppProfile( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteAppProfile, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -330,7 +426,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -344,7 +446,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -360,7 +468,13 @@ public void testIamPermissions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java index 69a7671a8..26f51d89b 100644 --- a/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java +++ b/google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/MockBigtableTableAdminImpl.java @@ -102,7 +102,13 @@ public void createTable(CreateTableRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTable, expected %s or %s", + response.getClass().getName(), + Table.class.getName(), + Exception.class.getName()))); } } @@ -117,7 +123,13 @@ public void createTableFromSnapshot( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateTableFromSnapshot, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -132,7 +144,13 @@ public void listTables( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListTables, expected %s or %s", + response.getClass().getName(), + ListTablesResponse.class.getName(), + Exception.class.getName()))); } } @@ -146,7 +164,13 @@ public void getTable(GetTableRequest request, StreamObserver
responseObse } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetTable, expected %s or %s", + response.getClass().getName(), + Table.class.getName(), + Exception.class.getName()))); } } @@ -160,7 +184,13 @@ public void deleteTable(DeleteTableRequest request, StreamObserver respon } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteTable, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -175,7 +205,13 @@ public void modifyColumnFamilies( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ModifyColumnFamilies, expected %s or %s", + response.getClass().getName(), + Table.class.getName(), + Exception.class.getName()))); } } @@ -189,7 +225,13 @@ public void dropRowRange(DropRowRangeRequest request, StreamObserver resp } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DropRowRange, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -205,7 +247,13 @@ public void generateConsistencyToken( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GenerateConsistencyToken, expected %s or %s", + response.getClass().getName(), + GenerateConsistencyTokenResponse.class.getName(), + Exception.class.getName()))); } } @@ -220,7 +268,13 @@ public void checkConsistency( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CheckConsistency, expected %s or %s", + response.getClass().getName(), + CheckConsistencyResponse.class.getName(), + Exception.class.getName()))); } } @@ -235,7 +289,13 @@ public void snapshotTable( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SnapshotTable, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -249,7 +309,13 @@ public void getSnapshot(GetSnapshotRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetSnapshot, expected %s or %s", + response.getClass().getName(), + Snapshot.class.getName(), + Exception.class.getName()))); } } @@ -264,7 +330,13 @@ public void listSnapshots( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListSnapshots, expected %s or %s", + response.getClass().getName(), + ListSnapshotsResponse.class.getName(), + Exception.class.getName()))); } } @@ -279,7 +351,13 @@ public void deleteSnapshot( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteSnapshot, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -294,7 +372,13 @@ public void createBackup( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method CreateBackup, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -308,7 +392,13 @@ public void getBackup(GetBackupRequest request, StreamObserver responseO } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetBackup, expected %s or %s", + response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); } } @@ -322,7 +412,13 @@ public void updateBackup(UpdateBackupRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method UpdateBackup, expected %s or %s", + response.getClass().getName(), + Backup.class.getName(), + Exception.class.getName()))); } } @@ -336,7 +432,13 @@ public void deleteBackup(DeleteBackupRequest request, StreamObserver resp } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method DeleteBackup, expected %s or %s", + response.getClass().getName(), + Empty.class.getName(), + Exception.class.getName()))); } } @@ -351,7 +453,13 @@ public void listBackups( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListBackups, expected %s or %s", + response.getClass().getName(), + ListBackupsResponse.class.getName(), + Exception.class.getName()))); } } @@ -366,7 +474,13 @@ public void restoreTable( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method RestoreTable, expected %s or %s", + response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); } } @@ -380,7 +494,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -394,7 +514,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver res } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method SetIamPolicy, expected %s or %s", + response.getClass().getName(), + Policy.class.getName(), + Exception.class.getName()))); } } @@ -410,7 +536,13 @@ public void testIamPermissions( } else if (response instanceof Exception) { responseObserver.onError(((Exception) response)); } else { - responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method TestIamPermissions, expected %s or %s", + response.getClass().getName(), + TestIamPermissionsResponse.class.getName(), + Exception.class.getName()))); } } } diff --git a/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml b/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml index 84c22b89e..696c323a9 100644 --- a/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml +++ b/proto-google-cloud-bigtable-admin-v2/clirr-ignored-differences.xml @@ -6,4 +6,19 @@ com/google/bigtable/admin/v2/TableOrBuilder *Restore* + + 7012 + com/google/bigtable/admin/v2/*OrBuilder + * get*(*) + + + 7012 + com/google/bigtable/admin/v2/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/bigtable/admin/v2/*OrBuilder + boolean has*(*) + \ No newline at end of file diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java index 8515ee33d..10fbb9ef5 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfile.java @@ -1469,7 +1469,7 @@ public RoutingPolicyCase getRoutingPolicyCase() { *
    * (`OutputOnly`)
    * The unique name of the app profile. Values are of the form
-   * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * 
* * string name = 1; @@ -1494,7 +1494,7 @@ public java.lang.String getName() { *
    * (`OutputOnly`)
    * The unique name of the app profile. Values are of the form
-   * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * 
* * string name = 1; @@ -2185,7 +2185,7 @@ public Builder clearRoutingPolicy() { *
      * (`OutputOnly`)
      * The unique name of the app profile. Values are of the form
-     * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * 
* * string name = 1; @@ -2209,7 +2209,7 @@ public java.lang.String getName() { *
      * (`OutputOnly`)
      * The unique name of the app profile. Values are of the form
-     * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * 
* * string name = 1; @@ -2233,7 +2233,7 @@ public com.google.protobuf.ByteString getNameBytes() { *
      * (`OutputOnly`)
      * The unique name of the app profile. Values are of the form
-     * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * 
* * string name = 1; @@ -2256,7 +2256,7 @@ public Builder setName(java.lang.String value) { *
      * (`OutputOnly`)
      * The unique name of the app profile. Values are of the form
-     * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * 
* * string name = 1; @@ -2275,7 +2275,7 @@ public Builder clearName() { *
      * (`OutputOnly`)
      * The unique name of the app profile. Values are of the form
-     * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * 
* * string name = 1; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java index 95be41220..d5b904a18 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/AppProfileOrBuilder.java @@ -29,7 +29,7 @@ public interface AppProfileOrBuilder *
    * (`OutputOnly`)
    * The unique name of the app profile. Values are of the form
-   * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * 
* * string name = 1; @@ -43,7 +43,7 @@ public interface AppProfileOrBuilder *
    * (`OutputOnly`)
    * The unique name of the app profile. Values are of the form
-   * `projects/<project>/instances/<instance>/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * 
* * string name = 1; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java index 36b342bfa..0fa7625c1 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Backup.java @@ -141,6 +141,22 @@ private Backup( int rawValue = input.readEnum(); state_ = rawValue; + break; + } + case 74: + { + com.google.bigtable.admin.v2.EncryptionInfo.Builder subBuilder = null; + if (encryptionInfo_ != null) { + subBuilder = encryptionInfo_.toBuilder(); + } + encryptionInfo_ = + input.readMessage( + com.google.bigtable.admin.v2.EncryptionInfo.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptionInfo_); + encryptionInfo_ = subBuilder.buildPartial(); + } + break; } default: @@ -690,6 +706,60 @@ public com.google.bigtable.admin.v2.Backup.State getState() { return result == null ? com.google.bigtable.admin.v2.Backup.State.UNRECOGNIZED : result; } + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 9; + private com.google.bigtable.admin.v2.EncryptionInfo encryptionInfo_; + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + @java.lang.Override + public boolean hasEncryptionInfo() { + return encryptionInfo_ != null; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + return getEncryptionInfo(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -725,6 +795,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (state_ != com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED.getNumber()) { output.writeEnum(7, state_); } + if (encryptionInfo_ != null) { + output.writeMessage(9, getEncryptionInfo()); + } unknownFields.writeTo(output); } @@ -755,6 +828,9 @@ public int getSerializedSize() { if (state_ != com.google.bigtable.admin.v2.Backup.State.STATE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, state_); } + if (encryptionInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getEncryptionInfo()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -786,6 +862,10 @@ public boolean equals(final java.lang.Object obj) { } if (getSizeBytes() != other.getSizeBytes()) return false; if (state_ != other.state_) return false; + if (hasEncryptionInfo() != other.hasEncryptionInfo()) return false; + if (hasEncryptionInfo()) { + if (!getEncryptionInfo().equals(other.getEncryptionInfo())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -817,6 +897,10 @@ public int hashCode() { hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getSizeBytes()); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; + if (hasEncryptionInfo()) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfo().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -987,6 +1071,12 @@ public Builder clear() { state_ = 0; + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = null; + } else { + encryptionInfo_ = null; + encryptionInfoBuilder_ = null; + } return this; } @@ -1032,6 +1122,11 @@ public com.google.bigtable.admin.v2.Backup buildPartial() { } result.sizeBytes_ = sizeBytes_; result.state_ = state_; + if (encryptionInfoBuilder_ == null) { + result.encryptionInfo_ = encryptionInfo_; + } else { + result.encryptionInfo_ = encryptionInfoBuilder_.build(); + } onBuilt(); return result; } @@ -1104,6 +1199,9 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Backup other) { if (other.state_ != 0) { setStateValue(other.getStateValue()); } + if (other.hasEncryptionInfo()) { + mergeEncryptionInfo(other.getEncryptionInfo()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -2207,6 +2305,210 @@ public Builder clearState() { return this; } + private com.google.bigtable.admin.v2.EncryptionInfo encryptionInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + public boolean hasEncryptionInfo() { + return encryptionInfoBuilder_ != null || encryptionInfo_ != null; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } else { + return encryptionInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionInfo_ = value; + onChanged(); + } else { + encryptionInfoBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = builderForValue.build(); + onChanged(); + } else { + encryptionInfoBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (encryptionInfo_ != null) { + encryptionInfo_ = + com.google.bigtable.admin.v2.EncryptionInfo.newBuilder(encryptionInfo_) + .mergeFrom(value) + .buildPartial(); + } else { + encryptionInfo_ = value; + } + onChanged(); + } else { + encryptionInfoBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = null; + onChanged(); + } else { + encryptionInfo_ = null; + encryptionInfoBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder() { + + onChanged(); + return getEncryptionInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilder(); + } else { + return encryptionInfo_ == null + ? com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance() + : encryptionInfo_; + } + } + /** + * + * + *
+     * Output only. The encryption information for the backup.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder>( + getEncryptionInfo(), getParentForChildren(), isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java index 19dd82dc2..2e31e823c 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/BackupOrBuilder.java @@ -279,4 +279,45 @@ public interface BackupOrBuilder * @return The state. */ com.google.bigtable.admin.v2.Backup.State getState(); + + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionInfo field is set. + */ + boolean hasEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionInfo. + */ + com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(); + /** + * + * + *
+   * Output only. The encryption information for the backup.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo encryption_info = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java index 488f7d782..906d9b80d 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Cluster.java @@ -106,6 +106,23 @@ private Cluster( int rawValue = input.readEnum(); defaultStorageType_ = rawValue; + break; + } + case 50: + { + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder subBuilder = null; + if (encryptionConfig_ != null) { + subBuilder = encryptionConfig_.toBuilder(); + } + encryptionConfig_ = + input.readMessage( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptionConfig_); + encryptionConfig_ = subBuilder.buildPartial(); + } + break; } default: @@ -357,6 +374,724 @@ private State(int value) { // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.Cluster.State) } + public interface EncryptionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.Cluster.EncryptionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     *  1) The Cloud Bigtable service account associated with the project that
+     *  contains this cluster must be granted the
+     *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     *  2) Only regional keys can be used and the region of the CMEK key must
+     *  match the region of the cluster.
+     * 3) All clusters within an instance must use the same CMEK key.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + java.lang.String getKmsKeyName(); + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     *  1) The Cloud Bigtable service account associated with the project that
+     *  contains this cluster must be granted the
+     *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     *  2) Only regional keys can be used and the region of the CMEK key must
+     *  match the region of the cluster.
+     * 3) All clusters within an instance must use the same CMEK key.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + com.google.protobuf.ByteString getKmsKeyNameBytes(); + } + /** + * + * + *
+   * Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
+   * cluster.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.EncryptionConfig} + */ + public static final class EncryptionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.Cluster.EncryptionConfig) + EncryptionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionConfig.newBuilder() to construct. + private EncryptionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionConfig() { + kmsKeyName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EncryptionConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.class, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder.class); + } + + public static final int KMS_KEY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object kmsKeyName_; + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     *  1) The Cloud Bigtable service account associated with the project that
+     *  contains this cluster must be granted the
+     *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     *  2) Only regional keys can be used and the region of the CMEK key must
+     *  match the region of the cluster.
+     * 3) All clusters within an instance must use the same CMEK key.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + @java.lang.Override + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } + } + /** + * + * + *
+     * Describes the Cloud KMS encryption key that will be used to protect the
+     * destination Bigtable cluster. The requirements for this key are:
+     *  1) The Cloud Bigtable service account associated with the project that
+     *  contains this cluster must be granted the
+     *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+     *  2) Only regional keys can be used and the region of the CMEK key must
+     *  match the region of the cluster.
+     * 3) All clusters within an instance must use the same CMEK key.
+     * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKmsKeyNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, kmsKeyName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKmsKeyNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, kmsKeyName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.bigtable.admin.v2.Cluster.EncryptionConfig)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.Cluster.EncryptionConfig other = + (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) obj; + + if (!getKmsKeyName().equals(other.getKmsKeyName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + KMS_KEY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig 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.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig 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.bigtable.admin.v2.Cluster.EncryptionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig 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.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected
+     * cluster.
+     * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.Cluster.EncryptionConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.Cluster.EncryptionConfig) + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.class, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.Cluster.EncryptionConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + kmsKeyName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.InstanceProto + .internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig build() { + com.google.bigtable.admin.v2.Cluster.EncryptionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig buildPartial() { + com.google.bigtable.admin.v2.Cluster.EncryptionConfig result = + new com.google.bigtable.admin.v2.Cluster.EncryptionConfig(this); + result.kmsKeyName_ = kmsKeyName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.Cluster.EncryptionConfig) { + return mergeFrom((com.google.bigtable.admin.v2.Cluster.EncryptionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster.EncryptionConfig other) { + if (other == com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance()) + return this; + if (!other.getKmsKeyName().isEmpty()) { + kmsKeyName_ = other.kmsKeyName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.bigtable.admin.v2.Cluster.EncryptionConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.bigtable.admin.v2.Cluster.EncryptionConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object kmsKeyName_ = ""; + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       *  1) The Cloud Bigtable service account associated with the project that
+       *  contains this cluster must be granted the
+       *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       *  2) Only regional keys can be used and the region of the CMEK key must
+       *  match the region of the cluster.
+       * 3) All clusters within an instance must use the same CMEK key.
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The kmsKeyName. + */ + public java.lang.String getKmsKeyName() { + java.lang.Object ref = kmsKeyName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       *  1) The Cloud Bigtable service account associated with the project that
+       *  contains this cluster must be granted the
+       *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       *  2) Only regional keys can be used and the region of the CMEK key must
+       *  match the region of the cluster.
+       * 3) All clusters within an instance must use the same CMEK key.
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for kmsKeyName. + */ + public com.google.protobuf.ByteString getKmsKeyNameBytes() { + java.lang.Object ref = kmsKeyName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       *  1) The Cloud Bigtable service account associated with the project that
+       *  contains this cluster must be granted the
+       *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       *  2) Only regional keys can be used and the region of the CMEK key must
+       *  match the region of the cluster.
+       * 3) All clusters within an instance must use the same CMEK key.
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       *  1) The Cloud Bigtable service account associated with the project that
+       *  contains this cluster must be granted the
+       *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       *  2) Only regional keys can be used and the region of the CMEK key must
+       *  match the region of the cluster.
+       * 3) All clusters within an instance must use the same CMEK key.
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyName() { + + kmsKeyName_ = getDefaultInstance().getKmsKeyName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Describes the Cloud KMS encryption key that will be used to protect the
+       * destination Bigtable cluster. The requirements for this key are:
+       *  1) The Cloud Bigtable service account associated with the project that
+       *  contains this cluster must be granted the
+       *  `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key.
+       *  2) Only regional keys can be used and the region of the CMEK key must
+       *  match the region of the cluster.
+       * 3) All clusters within an instance must use the same CMEK key.
+       * 
+ * + * string kms_key_name = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for kmsKeyName to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.Cluster.EncryptionConfig) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.Cluster.EncryptionConfig) + private static final com.google.bigtable.admin.v2.Cluster.EncryptionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.Cluster.EncryptionConfig(); + } + + public static com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EncryptionConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + public static final int NAME_FIELD_NUMBER = 1; private volatile java.lang.Object name_; /** @@ -564,6 +1299,61 @@ public com.google.bigtable.admin.v2.StorageType getDefaultStorageType() { return result == null ? com.google.bigtable.admin.v2.StorageType.UNRECOGNIZED : result; } + public static final int ENCRYPTION_CONFIG_FIELD_NUMBER = 6; + private com.google.bigtable.admin.v2.Cluster.EncryptionConfig encryptionConfig_; + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the encryptionConfig field is set. + */ + @java.lang.Override + public boolean hasEncryptionConfig() { + return encryptionConfig_ != null; + } + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The encryptionConfig. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig() { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + return getEncryptionConfig(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -594,6 +1384,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { output.writeEnum(5, defaultStorageType_); } + if (encryptionConfig_ != null) { + output.writeMessage(6, getEncryptionConfig()); + } unknownFields.writeTo(output); } @@ -619,6 +1412,9 @@ public int getSerializedSize() { != com.google.bigtable.admin.v2.StorageType.STORAGE_TYPE_UNSPECIFIED.getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, defaultStorageType_); } + if (encryptionConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getEncryptionConfig()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -639,6 +1435,10 @@ public boolean equals(final java.lang.Object obj) { if (state_ != other.state_) return false; if (getServeNodes() != other.getServeNodes()) return false; if (defaultStorageType_ != other.defaultStorageType_) return false; + if (hasEncryptionConfig() != other.hasEncryptionConfig()) return false; + if (hasEncryptionConfig()) { + if (!getEncryptionConfig().equals(other.getEncryptionConfig())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -660,6 +1460,10 @@ public int hashCode() { hash = (53 * hash) + getServeNodes(); hash = (37 * hash) + DEFAULT_STORAGE_TYPE_FIELD_NUMBER; hash = (53 * hash) + defaultStorageType_; + if (hasEncryptionConfig()) { + hash = (37 * hash) + ENCRYPTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionConfig().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -816,6 +1620,12 @@ public Builder clear() { defaultStorageType_ = 0; + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = null; + } else { + encryptionConfig_ = null; + encryptionConfigBuilder_ = null; + } return this; } @@ -847,6 +1657,11 @@ public com.google.bigtable.admin.v2.Cluster buildPartial() { result.state_ = state_; result.serveNodes_ = serveNodes_; result.defaultStorageType_ = defaultStorageType_; + if (encryptionConfigBuilder_ == null) { + result.encryptionConfig_ = encryptionConfig_; + } else { + result.encryptionConfig_ = encryptionConfigBuilder_.build(); + } onBuilt(); return result; } @@ -913,6 +1728,9 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Cluster other) { if (other.defaultStorageType_ != 0) { setDefaultStorageTypeValue(other.getDefaultStorageTypeValue()); } + if (other.hasEncryptionConfig()) { + mergeEncryptionConfig(other.getEncryptionConfig()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1436,6 +2254,214 @@ public Builder clearDefaultStorageType() { return this; } + private com.google.bigtable.admin.v2.Cluster.EncryptionConfig encryptionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Cluster.EncryptionConfig, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder, + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder> + encryptionConfigBuilder_; + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the encryptionConfig field is set. + */ + public boolean hasEncryptionConfig() { + return encryptionConfigBuilder_ != null || encryptionConfig_ != null; + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The encryptionConfig. + */ + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } else { + return encryptionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setEncryptionConfig( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionConfig_ = value; + onChanged(); + } else { + encryptionConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setEncryptionConfig( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder builderForValue) { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = builderForValue.build(); + onChanged(); + } else { + encryptionConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeEncryptionConfig( + com.google.bigtable.admin.v2.Cluster.EncryptionConfig value) { + if (encryptionConfigBuilder_ == null) { + if (encryptionConfig_ != null) { + encryptionConfig_ = + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.newBuilder(encryptionConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + encryptionConfig_ = value; + } + onChanged(); + } else { + encryptionConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearEncryptionConfig() { + if (encryptionConfigBuilder_ == null) { + encryptionConfig_ = null; + onChanged(); + } else { + encryptionConfig_ = null; + encryptionConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder + getEncryptionConfigBuilder() { + + onChanged(); + return getEncryptionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder + getEncryptionConfigOrBuilder() { + if (encryptionConfigBuilder_ != null) { + return encryptionConfigBuilder_.getMessageOrBuilder(); + } else { + return encryptionConfig_ == null + ? com.google.bigtable.admin.v2.Cluster.EncryptionConfig.getDefaultInstance() + : encryptionConfig_; + } + } + /** + * + * + *
+     * Immutable. The encryption configuration for CMEK-protected clusters.
+     * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Cluster.EncryptionConfig, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder, + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder> + getEncryptionConfigFieldBuilder() { + if (encryptionConfigBuilder_ == null) { + encryptionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.bigtable.admin.v2.Cluster.EncryptionConfig, + com.google.bigtable.admin.v2.Cluster.EncryptionConfig.Builder, + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder>( + getEncryptionConfig(), getParentForChildren(), isClean()); + encryptionConfig_ = null; + } + return encryptionConfigBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java index 40a3fd32d..d234c3f06 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/ClusterOrBuilder.java @@ -154,4 +154,45 @@ public interface ClusterOrBuilder * @return The defaultStorageType. */ com.google.bigtable.admin.v2.StorageType getDefaultStorageType(); + + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the encryptionConfig field is set. + */ + boolean hasEncryptionConfig(); + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The encryptionConfig. + */ + com.google.bigtable.admin.v2.Cluster.EncryptionConfig getEncryptionConfig(); + /** + * + * + *
+   * Immutable. The encryption configuration for CMEK-protected clusters.
+   * 
+ * + * + * .google.bigtable.admin.v2.Cluster.EncryptionConfig encryption_config = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.bigtable.admin.v2.Cluster.EncryptionConfigOrBuilder getEncryptionConfigOrBuilder(); } diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java new file mode 100644 index 000000000..51f9cb384 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java @@ -0,0 +1,261 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.bigtable.admin.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CryptoKeyName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_KEY_RING_CRYPTO_KEY = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String keyRing; + private final String cryptoKey; + + @Deprecated + protected CryptoKeyName() { + project = null; + location = null; + keyRing = null; + cryptoKey = null; + } + + private CryptoKeyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + keyRing = Preconditions.checkNotNull(builder.getKeyRing()); + cryptoKey = Preconditions.checkNotNull(builder.getCryptoKey()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getKeyRing() { + return keyRing; + } + + public String getCryptoKey() { + return cryptoKey; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CryptoKeyName of( + String project, String location, String keyRing, String cryptoKey) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setKeyRing(keyRing) + .setCryptoKey(cryptoKey) + .build(); + } + + public static String format(String project, String location, String keyRing, String cryptoKey) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setKeyRing(keyRing) + .setCryptoKey(cryptoKey) + .build() + .toString(); + } + + public static CryptoKeyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.validatedMatch( + formattedString, "CryptoKeyName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("key_ring"), + matchMap.get("crypto_key")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (CryptoKeyName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (keyRing != null) { + fieldMapBuilder.put("key_ring", keyRing); + } + if (cryptoKey != null) { + fieldMapBuilder.put("crypto_key", cryptoKey); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY.instantiate( + "project", project, "location", location, "key_ring", keyRing, "crypto_key", cryptoKey); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CryptoKeyName that = ((CryptoKeyName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.keyRing, that.keyRing) + && Objects.equals(this.cryptoKey, that.cryptoKey); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(keyRing); + h *= 1000003; + h ^= Objects.hashCode(cryptoKey); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}. + */ + public static class Builder { + private String project; + private String location; + private String keyRing; + private String cryptoKey; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getKeyRing() { + return keyRing; + } + + public String getCryptoKey() { + return cryptoKey; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setKeyRing(String keyRing) { + this.keyRing = keyRing; + return this; + } + + public Builder setCryptoKey(String cryptoKey) { + this.cryptoKey = cryptoKey; + return this; + } + + private Builder(CryptoKeyName cryptoKeyName) { + project = cryptoKeyName.project; + location = cryptoKeyName.location; + keyRing = cryptoKeyName.keyRing; + cryptoKey = cryptoKeyName.cryptoKey; + } + + public CryptoKeyName build() { + return new CryptoKeyName(this); + } + } +} diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java new file mode 100644 index 000000000..c93c34e88 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java @@ -0,0 +1,298 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.bigtable.admin.v2; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class CryptoKeyVersionName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String keyRing; + private final String cryptoKey; + private final String cryptoKeyVersion; + + @Deprecated + protected CryptoKeyVersionName() { + project = null; + location = null; + keyRing = null; + cryptoKey = null; + cryptoKeyVersion = null; + } + + private CryptoKeyVersionName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + keyRing = Preconditions.checkNotNull(builder.getKeyRing()); + cryptoKey = Preconditions.checkNotNull(builder.getCryptoKey()); + cryptoKeyVersion = Preconditions.checkNotNull(builder.getCryptoKeyVersion()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getKeyRing() { + return keyRing; + } + + public String getCryptoKey() { + return cryptoKey; + } + + public String getCryptoKeyVersion() { + return cryptoKeyVersion; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static CryptoKeyVersionName of( + String project, String location, String keyRing, String cryptoKey, String cryptoKeyVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setKeyRing(keyRing) + .setCryptoKey(cryptoKey) + .setCryptoKeyVersion(cryptoKeyVersion) + .build(); + } + + public static String format( + String project, String location, String keyRing, String cryptoKey, String cryptoKeyVersion) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setKeyRing(keyRing) + .setCryptoKey(cryptoKey) + .setCryptoKeyVersion(cryptoKeyVersion) + .build() + .toString(); + } + + public static CryptoKeyVersionName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION.validatedMatch( + formattedString, "CryptoKeyVersionName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("location"), + matchMap.get("key_ring"), + matchMap.get("crypto_key"), + matchMap.get("crypto_key_version")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (CryptoKeyVersionName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (keyRing != null) { + fieldMapBuilder.put("key_ring", keyRing); + } + if (cryptoKey != null) { + fieldMapBuilder.put("crypto_key", cryptoKey); + } + if (cryptoKeyVersion != null) { + fieldMapBuilder.put("crypto_key_version", cryptoKeyVersion); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_KEY_RING_CRYPTO_KEY_CRYPTO_KEY_VERSION.instantiate( + "project", + project, + "location", + location, + "key_ring", + keyRing, + "crypto_key", + cryptoKey, + "crypto_key_version", + cryptoKeyVersion); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + CryptoKeyVersionName that = ((CryptoKeyVersionName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.keyRing, that.keyRing) + && Objects.equals(this.cryptoKey, that.cryptoKey) + && Objects.equals(this.cryptoKeyVersion, that.cryptoKeyVersion); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(keyRing); + h *= 1000003; + h ^= Objects.hashCode(cryptoKey); + h *= 1000003; + h ^= Objects.hashCode(cryptoKeyVersion); + return h; + } + + /** + * Builder for + * projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}. + */ + public static class Builder { + private String project; + private String location; + private String keyRing; + private String cryptoKey; + private String cryptoKeyVersion; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getKeyRing() { + return keyRing; + } + + public String getCryptoKey() { + return cryptoKey; + } + + public String getCryptoKeyVersion() { + return cryptoKeyVersion; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setKeyRing(String keyRing) { + this.keyRing = keyRing; + return this; + } + + public Builder setCryptoKey(String cryptoKey) { + this.cryptoKey = cryptoKey; + return this; + } + + public Builder setCryptoKeyVersion(String cryptoKeyVersion) { + this.cryptoKeyVersion = cryptoKeyVersion; + return this; + } + + private Builder(CryptoKeyVersionName cryptoKeyVersionName) { + project = cryptoKeyVersionName.project; + location = cryptoKeyVersionName.location; + keyRing = cryptoKeyVersionName.keyRing; + cryptoKey = cryptoKeyVersionName.cryptoKey; + cryptoKeyVersion = cryptoKeyVersionName.cryptoKeyVersion; + } + + public CryptoKeyVersionName build() { + return new CryptoKeyVersionName(this); + } + } +} diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java new file mode 100644 index 000000000..5118ecbe4 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java @@ -0,0 +1,1313 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/table.proto + +package com.google.bigtable.admin.v2; + +/** + * + * + *
+ * Encryption information for a given resource.
+ * If this resource is protected with customer managed encryption, the in-use
+ * Cloud Key Management Service (Cloud KMS) key version is specified along with
+ * its status.
+ * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.EncryptionInfo} + */ +public final class EncryptionInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.bigtable.admin.v2.EncryptionInfo) + EncryptionInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use EncryptionInfo.newBuilder() to construct. + private EncryptionInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private EncryptionInfo() { + encryptionType_ = 0; + kmsKeyVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new EncryptionInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private EncryptionInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + kmsKeyVersion_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + encryptionType_ = rawValue; + break; + } + case 34: + { + com.google.rpc.Status.Builder subBuilder = null; + if (encryptionStatus_ != null) { + subBuilder = encryptionStatus_.toBuilder(); + } + encryptionStatus_ = + input.readMessage(com.google.rpc.Status.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(encryptionStatus_); + encryptionStatus_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.EncryptionInfo.class, + com.google.bigtable.admin.v2.EncryptionInfo.Builder.class); + } + + /** + * + * + *
+   * Possible encryption types for a resource.
+   * 
+ * + * Protobuf enum {@code google.bigtable.admin.v2.EncryptionInfo.EncryptionType} + */ + public enum EncryptionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Encryption type was not specified, though data at rest remains encrypted.
+     * 
+ * + * ENCRYPTION_TYPE_UNSPECIFIED = 0; + */ + ENCRYPTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * fully managed by Google. No key version or status will be populated.
+     * This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + GOOGLE_DEFAULT_ENCRYPTION(1), + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * managed by the customer.
+     * The in-use version of the key and its status are populated for
+     * CMEK-protected tables.
+     * CMEK-protected backups are pinned to the key version that was in use at
+     * the time the backup was taken. This key version is populated but its
+     * status is not tracked and is reported as `UNKNOWN`.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + CUSTOMER_MANAGED_ENCRYPTION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Encryption type was not specified, though data at rest remains encrypted.
+     * 
+ * + * ENCRYPTION_TYPE_UNSPECIFIED = 0; + */ + public static final int ENCRYPTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * fully managed by Google. No key version or status will be populated.
+     * This is the default state.
+     * 
+ * + * GOOGLE_DEFAULT_ENCRYPTION = 1; + */ + public static final int GOOGLE_DEFAULT_ENCRYPTION_VALUE = 1; + /** + * + * + *
+     * The data backing this resource is encrypted at rest with a key that is
+     * managed by the customer.
+     * The in-use version of the key and its status are populated for
+     * CMEK-protected tables.
+     * CMEK-protected backups are pinned to the key version that was in use at
+     * the time the backup was taken. This key version is populated but its
+     * status is not tracked and is reported as `UNKNOWN`.
+     * 
+ * + * CUSTOMER_MANAGED_ENCRYPTION = 2; + */ + public static final int CUSTOMER_MANAGED_ENCRYPTION_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static EncryptionType valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static EncryptionType forNumber(int value) { + switch (value) { + case 0: + return ENCRYPTION_TYPE_UNSPECIFIED; + case 1: + return GOOGLE_DEFAULT_ENCRYPTION; + case 2: + return CUSTOMER_MANAGED_ENCRYPTION; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public EncryptionType findValueByNumber(int number) { + return EncryptionType.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.bigtable.admin.v2.EncryptionInfo.getDescriptor().getEnumTypes().get(0); + } + + private static final EncryptionType[] VALUES = values(); + + public static EncryptionType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private EncryptionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.bigtable.admin.v2.EncryptionInfo.EncryptionType) + } + + public static final int ENCRYPTION_TYPE_FIELD_NUMBER = 3; + private int encryptionType_; + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType() { + @SuppressWarnings("deprecation") + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType result = + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.valueOf(encryptionType_); + return result == null + ? com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED + : result; + } + + public static final int ENCRYPTION_STATUS_FIELD_NUMBER = 4; + private com.google.rpc.Status encryptionStatus_; + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionStatus field is set. + */ + @java.lang.Override + public boolean hasEncryptionStatus() { + return encryptionStatus_ != null; + } + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionStatus. + */ + @java.lang.Override + public com.google.rpc.Status getEncryptionStatus() { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() { + return getEncryptionStatus(); + } + + public static final int KMS_KEY_VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object kmsKeyVersion_; + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The kmsKeyVersion. + */ + @java.lang.Override + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + 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(); + kmsKeyVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for kmsKeyVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getKmsKeyVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, kmsKeyVersion_); + } + if (encryptionType_ + != com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.ENCRYPTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, encryptionType_); + } + if (encryptionStatus_ != null) { + output.writeMessage(4, getEncryptionStatus()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKmsKeyVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, kmsKeyVersion_); + } + if (encryptionType_ + != com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.ENCRYPTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, encryptionType_); + } + if (encryptionStatus_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getEncryptionStatus()); + } + 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.bigtable.admin.v2.EncryptionInfo)) { + return super.equals(obj); + } + com.google.bigtable.admin.v2.EncryptionInfo other = + (com.google.bigtable.admin.v2.EncryptionInfo) obj; + + if (encryptionType_ != other.encryptionType_) return false; + if (hasEncryptionStatus() != other.hasEncryptionStatus()) return false; + if (hasEncryptionStatus()) { + if (!getEncryptionStatus().equals(other.getEncryptionStatus())) return false; + } + if (!getKmsKeyVersion().equals(other.getKmsKeyVersion())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ENCRYPTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + encryptionType_; + if (hasEncryptionStatus()) { + hash = (37 * hash) + ENCRYPTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionStatus().hashCode(); + } + hash = (37 * hash) + KMS_KEY_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getKmsKeyVersion().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo 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.bigtable.admin.v2.EncryptionInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo 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.bigtable.admin.v2.EncryptionInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo 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.bigtable.admin.v2.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.bigtable.admin.v2.EncryptionInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Encryption information for a given resource.
+   * If this resource is protected with customer managed encryption, the in-use
+   * Cloud Key Management Service (Cloud KMS) key version is specified along with
+   * its status.
+   * 
+ * + * Protobuf type {@code google.bigtable.admin.v2.EncryptionInfo} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.bigtable.admin.v2.EncryptionInfo) + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.bigtable.admin.v2.EncryptionInfo.class, + com.google.bigtable.admin.v2.EncryptionInfo.Builder.class); + } + + // Construct using com.google.bigtable.admin.v2.EncryptionInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + encryptionType_ = 0; + + if (encryptionStatusBuilder_ == null) { + encryptionStatus_ = null; + } else { + encryptionStatus_ = null; + encryptionStatusBuilder_ = null; + } + kmsKeyVersion_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.bigtable.admin.v2.TableProto + .internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getDefaultInstanceForType() { + return com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo build() { + com.google.bigtable.admin.v2.EncryptionInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo buildPartial() { + com.google.bigtable.admin.v2.EncryptionInfo result = + new com.google.bigtable.admin.v2.EncryptionInfo(this); + result.encryptionType_ = encryptionType_; + if (encryptionStatusBuilder_ == null) { + result.encryptionStatus_ = encryptionStatus_; + } else { + result.encryptionStatus_ = encryptionStatusBuilder_.build(); + } + result.kmsKeyVersion_ = kmsKeyVersion_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.bigtable.admin.v2.EncryptionInfo) { + return mergeFrom((com.google.bigtable.admin.v2.EncryptionInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.bigtable.admin.v2.EncryptionInfo other) { + if (other == com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()) return this; + if (other.encryptionType_ != 0) { + setEncryptionTypeValue(other.getEncryptionTypeValue()); + } + if (other.hasEncryptionStatus()) { + mergeEncryptionStatus(other.getEncryptionStatus()); + } + if (!other.getKmsKeyVersion().isEmpty()) { + kmsKeyVersion_ = other.kmsKeyVersion_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.bigtable.admin.v2.EncryptionInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.bigtable.admin.v2.EncryptionInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int encryptionType_ = 0; + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + @java.lang.Override + public int getEncryptionTypeValue() { + return encryptionType_; + } + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionTypeValue(int value) { + + encryptionType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType() { + @SuppressWarnings("deprecation") + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType result = + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.valueOf(encryptionType_); + return result == null + ? com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The encryptionType to set. + * @return This builder for chaining. + */ + public Builder setEncryptionType( + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType value) { + if (value == null) { + throw new NullPointerException(); + } + + encryptionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of encryption used to protect this resource.
+     * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearEncryptionType() { + + encryptionType_ = 0; + onChanged(); + return this; + } + + private com.google.rpc.Status encryptionStatus_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + encryptionStatusBuilder_; + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionStatus field is set. + */ + public boolean hasEncryptionStatus() { + return encryptionStatusBuilder_ != null || encryptionStatus_ != null; + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionStatus. + */ + public com.google.rpc.Status getEncryptionStatus() { + if (encryptionStatusBuilder_ == null) { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } else { + return encryptionStatusBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionStatus(com.google.rpc.Status value) { + if (encryptionStatusBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + encryptionStatus_ = value; + onChanged(); + } else { + encryptionStatusBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionStatus(com.google.rpc.Status.Builder builderForValue) { + if (encryptionStatusBuilder_ == null) { + encryptionStatus_ = builderForValue.build(); + onChanged(); + } else { + encryptionStatusBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeEncryptionStatus(com.google.rpc.Status value) { + if (encryptionStatusBuilder_ == null) { + if (encryptionStatus_ != null) { + encryptionStatus_ = + com.google.rpc.Status.newBuilder(encryptionStatus_).mergeFrom(value).buildPartial(); + } else { + encryptionStatus_ = value; + } + onChanged(); + } else { + encryptionStatusBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionStatus() { + if (encryptionStatusBuilder_ == null) { + encryptionStatus_ = null; + onChanged(); + } else { + encryptionStatus_ = null; + encryptionStatusBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.Status.Builder getEncryptionStatusBuilder() { + + onChanged(); + return getEncryptionStatusFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder() { + if (encryptionStatusBuilder_ != null) { + return encryptionStatusBuilder_.getMessageOrBuilder(); + } else { + return encryptionStatus_ == null + ? com.google.rpc.Status.getDefaultInstance() + : encryptionStatus_; + } + } + /** + * + * + *
+     * Output only. The status of encrypt/decrypt calls on underlying data for
+     * this resource. Regardless of status, the existing data is always encrypted
+     * at rest.
+     * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder> + getEncryptionStatusFieldBuilder() { + if (encryptionStatusBuilder_ == null) { + encryptionStatusBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.rpc.Status, + com.google.rpc.Status.Builder, + com.google.rpc.StatusOrBuilder>( + getEncryptionStatus(), getParentForChildren(), isClean()); + encryptionStatus_ = null; + } + return encryptionStatusBuilder_; + } + + private java.lang.Object kmsKeyVersion_ = ""; + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The kmsKeyVersion. + */ + public java.lang.String getKmsKeyVersion() { + java.lang.Object ref = kmsKeyVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + kmsKeyVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for kmsKeyVersion. + */ + public com.google.protobuf.ByteString getKmsKeyVersionBytes() { + java.lang.Object ref = kmsKeyVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + kmsKeyVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + kmsKeyVersion_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearKmsKeyVersion() { + + kmsKeyVersion_ = getDefaultInstance().getKmsKeyVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The version of the Cloud KMS key specified in the parent
+     * cluster that is in use for the data underlying this table.
+     * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for kmsKeyVersion to set. + * @return This builder for chaining. + */ + public Builder setKmsKeyVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + kmsKeyVersion_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.bigtable.admin.v2.EncryptionInfo) + } + + // @@protoc_insertion_point(class_scope:google.bigtable.admin.v2.EncryptionInfo) + private static final com.google.bigtable.admin.v2.EncryptionInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.bigtable.admin.v2.EncryptionInfo(); + } + + public static com.google.bigtable.admin.v2.EncryptionInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EncryptionInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new EncryptionInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java new file mode 100644 index 000000000..c3fdcb275 --- /dev/null +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/bigtable/admin/v2/table.proto + +package com.google.bigtable.admin.v2; + +public interface EncryptionInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.bigtable.admin.v2.EncryptionInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for encryptionType. + */ + int getEncryptionTypeValue(); + /** + * + * + *
+   * Output only. The type of encryption used to protect this resource.
+   * 
+ * + * + * .google.bigtable.admin.v2.EncryptionInfo.EncryptionType encryption_type = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionType. + */ + com.google.bigtable.admin.v2.EncryptionInfo.EncryptionType getEncryptionType(); + + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the encryptionStatus field is set. + */ + boolean hasEncryptionStatus(); + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The encryptionStatus. + */ + com.google.rpc.Status getEncryptionStatus(); + /** + * + * + *
+   * Output only. The status of encrypt/decrypt calls on underlying data for
+   * this resource. Regardless of status, the existing data is always encrypted
+   * at rest.
+   * 
+ * + * .google.rpc.Status encryption_status = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.rpc.StatusOrBuilder getEncryptionStatusOrBuilder(); + + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The kmsKeyVersion. + */ + java.lang.String getKmsKeyVersion(); + /** + * + * + *
+   * Output only. The version of the Cloud KMS key specified in the parent
+   * cluster that is in use for the data underlying this table.
+   * 
+ * + * + * string kms_key_version = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for kmsKeyVersion. + */ + com.google.protobuf.ByteString getKmsKeyVersionBytes(); +} diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java index a70216a2a..38b3642a6 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/InstanceProto.java @@ -39,6 +39,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_Cluster_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_bigtable_admin_v2_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_AppProfile_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -76,35 +80,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "UNSPECIFIED\020\000\022\016\n\nPRODUCTION\020\001\022\017\n\013DEVELOP" + "MENT\020\002:N\352AK\n bigtable.googleapis.com/Ins" + "tance\022\'projects/{project}/instances/{ins" - + "tance}\"\247\003\n\007Cluster\022\021\n\004name\030\001 \001(\tB\003\340A\003\0228\n" + + "tance}\"\315\004\n\007Cluster\022\021\n\004name\030\001 \001(\tB\003\340A\003\0228\n" + "\010location\030\002 \001(\tB&\372A#\n!locations.googleap" + "is.com/Location\022;\n\005state\030\003 \001(\0162\'.google." + "bigtable.admin.v2.Cluster.StateB\003\340A\003\022\030\n\013" + "serve_nodes\030\004 \001(\005B\003\340A\002\022C\n\024default_storag" + "e_type\030\005 \001(\0162%.google.bigtable.admin.v2." - + "StorageType\"Q\n\005State\022\023\n\017STATE_NOT_KNOWN\020" - + "\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\014\n\010RESIZING\020\003" - + "\022\014\n\010DISABLED\020\004:`\352A]\n\037bigtable.googleapis" - + ".com/Cluster\022:projects/{project}/instanc" - + "es/{instance}/clusters/{cluster}\"\356\003\n\nApp" - + "Profile\022\014\n\004name\030\001 \001(\t\022\014\n\004etag\030\002 \001(\t\022\023\n\013d" - + "escription\030\003 \001(\t\022g\n\035multi_cluster_routin" - + "g_use_any\030\005 \001(\0132>.google.bigtable.admin." - + "v2.AppProfile.MultiClusterRoutingUseAnyH" - + "\000\022[\n\026single_cluster_routing\030\006 \001(\01329.goog" - + "le.bigtable.admin.v2.AppProfile.SingleCl" - + "usterRoutingH\000\032\033\n\031MultiClusterRoutingUse" - + "Any\032N\n\024SingleClusterRouting\022\022\n\ncluster_i" - + "d\030\001 \001(\t\022\"\n\032allow_transactional_writes\030\002 " - + "\001(\010:j\352Ag\n\"bigtable.googleapis.com/AppPro" - + "file\022Aprojects/{project}/instances/{inst" - + "ance}/appProfiles/{app_profile}B\020\n\016routi" - + "ng_policyB\325\001\n\034com.google.bigtable.admin." - + "v2B\rInstanceProtoP\001Z=google.golang.org/g" - + "enproto/googleapis/bigtable/admin/v2;adm" - + "in\252\002\036Google.Cloud.Bigtable.Admin.V2\312\002\036Go" - + "ogle\\Cloud\\Bigtable\\Admin\\V2\352\002\"Google::C" - + "loud::Bigtable::Admin::V2b\006proto3" + + "StorageType\022R\n\021encryption_config\030\006 \001(\01322" + + ".google.bigtable.admin.v2.Cluster.Encryp" + + "tionConfigB\003\340A\005\032P\n\020EncryptionConfig\022<\n\014k" + + "ms_key_name\030\001 \001(\tB&\372A#\n!cloudkms.googlea" + + "pis.com/CryptoKey\"Q\n\005State\022\023\n\017STATE_NOT_" + + "KNOWN\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002\022\014\n\010RESI" + + "ZING\020\003\022\014\n\010DISABLED\020\004:`\352A]\n\037bigtable.goog" + + "leapis.com/Cluster\022:projects/{project}/i" + + "nstances/{instance}/clusters/{cluster}\"\356" + + "\003\n\nAppProfile\022\014\n\004name\030\001 \001(\t\022\014\n\004etag\030\002 \001(" + + "\t\022\023\n\013description\030\003 \001(\t\022g\n\035multi_cluster_" + + "routing_use_any\030\005 \001(\0132>.google.bigtable." + + "admin.v2.AppProfile.MultiClusterRoutingU" + + "seAnyH\000\022[\n\026single_cluster_routing\030\006 \001(\0132" + + "9.google.bigtable.admin.v2.AppProfile.Si" + + "ngleClusterRoutingH\000\032\033\n\031MultiClusterRout" + + "ingUseAny\032N\n\024SingleClusterRouting\022\022\n\nclu" + + "ster_id\030\001 \001(\t\022\"\n\032allow_transactional_wri" + + "tes\030\002 \001(\010:j\352Ag\n\"bigtable.googleapis.com/" + + "AppProfile\022Aprojects/{project}/instances" + + "/{instance}/appProfiles/{app_profile}B\020\n" + + "\016routing_policyB\320\002\n\034com.google.bigtable." + + "admin.v2B\rInstanceProtoP\001Z=google.golang" + + ".org/genproto/googleapis/bigtable/admin/" + + "v2;admin\252\002\036Google.Cloud.Bigtable.Admin.V" + + "2\312\002\036Google\\Cloud\\Bigtable\\Admin\\V2\352\002\"Goo" + + "gle::Cloud::Bigtable::Admin::V2\352Ax\n!clou" + + "dkms.googleapis.com/CryptoKey\022Sprojects/" + + "{project}/locations/{location}/keyRings/" + + "{key_ring}/cryptoKeys/{crypto_key}b\006prot" + + "o3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -136,7 +148,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Cluster_descriptor, new java.lang.String[] { - "Name", "Location", "State", "ServeNodes", "DefaultStorageType", + "Name", "Location", "State", "ServeNodes", "DefaultStorageType", "EncryptionConfig", + }); + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor = + internal_static_google_bigtable_admin_v2_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_Cluster_EncryptionConfig_descriptor, + new java.lang.String[] { + "KmsKeyName", }); internal_static_google_bigtable_admin_v2_AppProfile_descriptor = getDescriptor().getMessageTypes().get(2); @@ -169,6 +189,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java index f40e78bd9..4d6db1d7a 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Snapshot.java @@ -351,7 +351,7 @@ private State(int value) { *
    * Output only. The unique name of the snapshot.
    * Values are of the form
-   * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
    * 
* * string name = 1; @@ -376,7 +376,7 @@ public java.lang.String getName() { *
    * Output only. The unique name of the snapshot.
    * Values are of the form
-   * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
    * 
* * string name = 1; @@ -1104,7 +1104,7 @@ public Builder mergeFrom( *
      * Output only. The unique name of the snapshot.
      * Values are of the form
-     * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
      * 
* * string name = 1; @@ -1128,7 +1128,7 @@ public java.lang.String getName() { *
      * Output only. The unique name of the snapshot.
      * Values are of the form
-     * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
      * 
* * string name = 1; @@ -1152,7 +1152,7 @@ public com.google.protobuf.ByteString getNameBytes() { *
      * Output only. The unique name of the snapshot.
      * Values are of the form
-     * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
      * 
* * string name = 1; @@ -1175,7 +1175,7 @@ public Builder setName(java.lang.String value) { *
      * Output only. The unique name of the snapshot.
      * Values are of the form
-     * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
      * 
* * string name = 1; @@ -1194,7 +1194,7 @@ public Builder clearName() { *
      * Output only. The unique name of the snapshot.
      * Values are of the form
-     * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+     * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
      * 
* * string name = 1; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java index e38da5c60..332324988 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/SnapshotOrBuilder.java @@ -29,7 +29,7 @@ public interface SnapshotOrBuilder *
    * Output only. The unique name of the snapshot.
    * Values are of the form
-   * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
    * 
* * string name = 1; @@ -43,7 +43,7 @@ public interface SnapshotOrBuilder *
    * Output only. The unique name of the snapshot.
    * Values are of the form
-   * `projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>`.
+   * `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`.
    * 
* * string name = 1; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java index db047cfd5..c319d8b89 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/Table.java @@ -380,6 +380,16 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * REPLICATION_VIEW = 3; */ REPLICATION_VIEW(3), + /** + * + * + *
+     * Only populates 'name' and fields related to the table's encryption state.
+     * 
+ * + * ENCRYPTION_VIEW = 5; + */ + ENCRYPTION_VIEW(5), /** * * @@ -434,6 +444,16 @@ public enum View implements com.google.protobuf.ProtocolMessageEnum { * REPLICATION_VIEW = 3; */ public static final int REPLICATION_VIEW_VALUE = 3; + /** + * + * + *
+     * Only populates 'name' and fields related to the table's encryption state.
+     * 
+ * + * ENCRYPTION_VIEW = 5; + */ + public static final int ENCRYPTION_VIEW_VALUE = 5; /** * * @@ -477,6 +497,8 @@ public static View forNumber(int value) { return SCHEMA_VIEW; case 3: return REPLICATION_VIEW; + case 5: + return ENCRYPTION_VIEW; case 4: return FULL; default: @@ -563,6 +585,88 @@ public interface ClusterStateOrBuilder * @return The replicationState. */ com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getReplicationState(); + + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getEncryptionInfoList(); + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index); + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getEncryptionInfoCount(); + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getEncryptionInfoOrBuilderList(); + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder(int index); } /** * @@ -585,6 +689,7 @@ private ClusterState(com.google.protobuf.GeneratedMessageV3.Builder builder) private ClusterState() { replicationState_ = 0; + encryptionInfo_ = java.util.Collections.emptyList(); } @java.lang.Override @@ -606,6 +711,7 @@ private ClusterState( if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } + int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -623,6 +729,18 @@ private ClusterState( replicationState_ = rawValue; break; } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + encryptionInfo_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + encryptionInfo_.add( + input.readMessage( + com.google.bigtable.admin.v2.EncryptionInfo.parser(), extensionRegistry)); + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -637,6 +755,9 @@ private ClusterState( } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + encryptionInfo_ = java.util.Collections.unmodifiableList(encryptionInfo_); + } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } @@ -942,6 +1063,106 @@ public com.google.bigtable.admin.v2.Table.ClusterState.ReplicationState getRepli : result; } + public static final int ENCRYPTION_INFO_FIELD_NUMBER = 2; + private java.util.List encryptionInfo_; + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getEncryptionInfoList() { + return encryptionInfo_; + } + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getEncryptionInfoOrBuilderList() { + return encryptionInfo_; + } + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getEncryptionInfoCount() { + return encryptionInfo_.size(); + } + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index) { + return encryptionInfo_.get(index); + } + /** + * + * + *
+     * Output only. The encryption information for the table in this cluster.
+     * If the encryption key protecting this resource is customer managed, then
+     * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+     * The primary version of the key and its status will be reflected here when
+     * changes propagate from Cloud KMS.
+     * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder( + int index) { + return encryptionInfo_.get(index); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -961,6 +1182,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io .getNumber()) { output.writeEnum(1, replicationState_); } + for (int i = 0; i < encryptionInfo_.size(); i++) { + output.writeMessage(2, encryptionInfo_.get(i)); + } unknownFields.writeTo(output); } @@ -975,6 +1199,9 @@ public int getSerializedSize() { .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, replicationState_); } + for (int i = 0; i < encryptionInfo_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, encryptionInfo_.get(i)); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -992,6 +1219,7 @@ public boolean equals(final java.lang.Object obj) { (com.google.bigtable.admin.v2.Table.ClusterState) obj; if (replicationState_ != other.replicationState_) return false; + if (!getEncryptionInfoList().equals(other.getEncryptionInfoList())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -1005,6 +1233,10 @@ public int hashCode() { hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + REPLICATION_STATE_FIELD_NUMBER; hash = (53 * hash) + replicationState_; + if (getEncryptionInfoCount() > 0) { + hash = (37 * hash) + ENCRYPTION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getEncryptionInfoList().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -1146,7 +1378,9 @@ private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getEncryptionInfoFieldBuilder(); + } } @java.lang.Override @@ -1154,6 +1388,12 @@ public Builder clear() { super.clear(); replicationState_ = 0; + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + encryptionInfoBuilder_.clear(); + } return this; } @@ -1181,7 +1421,17 @@ public com.google.bigtable.admin.v2.Table.ClusterState build() { public com.google.bigtable.admin.v2.Table.ClusterState buildPartial() { com.google.bigtable.admin.v2.Table.ClusterState result = new com.google.bigtable.admin.v2.Table.ClusterState(this); + int from_bitField0_ = bitField0_; result.replicationState_ = replicationState_; + if (encryptionInfoBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + encryptionInfo_ = java.util.Collections.unmodifiableList(encryptionInfo_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.encryptionInfo_ = encryptionInfo_; + } else { + result.encryptionInfo_ = encryptionInfoBuilder_.build(); + } onBuilt(); return result; } @@ -1237,6 +1487,33 @@ public Builder mergeFrom(com.google.bigtable.admin.v2.Table.ClusterState other) if (other.replicationState_ != 0) { setReplicationStateValue(other.getReplicationStateValue()); } + if (encryptionInfoBuilder_ == null) { + if (!other.encryptionInfo_.isEmpty()) { + if (encryptionInfo_.isEmpty()) { + encryptionInfo_ = other.encryptionInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.addAll(other.encryptionInfo_); + } + onChanged(); + } + } else { + if (!other.encryptionInfo_.isEmpty()) { + if (encryptionInfoBuilder_.isEmpty()) { + encryptionInfoBuilder_.dispose(); + encryptionInfoBuilder_ = null; + encryptionInfo_ = other.encryptionInfo_; + bitField0_ = (bitField0_ & ~0x00000001); + encryptionInfoBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEncryptionInfoFieldBuilder() + : null; + } else { + encryptionInfoBuilder_.addAllMessages(other.encryptionInfo_); + } + } + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -1267,6 +1544,8 @@ public Builder mergeFrom( return this; } + private int bitField0_; + private int replicationState_ = 0; /** * @@ -1368,6 +1647,473 @@ public Builder clearReplicationState() { return this; } + private java.util.List encryptionInfo_ = + java.util.Collections.emptyList(); + + private void ensureEncryptionInfoIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + encryptionInfo_ = + new java.util.ArrayList(encryptionInfo_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + encryptionInfoBuilder_; + + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getEncryptionInfoList() { + if (encryptionInfoBuilder_ == null) { + return java.util.Collections.unmodifiableList(encryptionInfo_); + } else { + return encryptionInfoBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getEncryptionInfoCount() { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_.size(); + } else { + return encryptionInfoBuilder_.getCount(); + } + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo getEncryptionInfo(int index) { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_.get(index); + } else { + return encryptionInfoBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncryptionInfoIsMutable(); + encryptionInfo_.set(index, value); + onChanged(); + } else { + encryptionInfoBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.set(index, builderForValue.build()); + onChanged(); + } else { + encryptionInfoBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo(com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(value); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo value) { + if (encryptionInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(index, value); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo( + com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(builderForValue.build()); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addEncryptionInfo( + int index, com.google.bigtable.admin.v2.EncryptionInfo.Builder builderForValue) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.add(index, builderForValue.build()); + onChanged(); + } else { + encryptionInfoBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllEncryptionInfo( + java.lang.Iterable values) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, encryptionInfo_); + onChanged(); + } else { + encryptionInfoBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearEncryptionInfo() { + if (encryptionInfoBuilder_ == null) { + encryptionInfo_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + encryptionInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeEncryptionInfo(int index) { + if (encryptionInfoBuilder_ == null) { + ensureEncryptionInfoIsMutable(); + encryptionInfo_.remove(index); + onChanged(); + } else { + encryptionInfoBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder getEncryptionInfoBuilder( + int index) { + return getEncryptionInfoFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfoOrBuilder getEncryptionInfoOrBuilder( + int index) { + if (encryptionInfoBuilder_ == null) { + return encryptionInfo_.get(index); + } else { + return encryptionInfoBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEncryptionInfoOrBuilderList() { + if (encryptionInfoBuilder_ != null) { + return encryptionInfoBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(encryptionInfo_); + } + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuilder() { + return getEncryptionInfoFieldBuilder() + .addBuilder(com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()); + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.bigtable.admin.v2.EncryptionInfo.Builder addEncryptionInfoBuilder( + int index) { + return getEncryptionInfoFieldBuilder() + .addBuilder(index, com.google.bigtable.admin.v2.EncryptionInfo.getDefaultInstance()); + } + /** + * + * + *
+       * Output only. The encryption information for the table in this cluster.
+       * If the encryption key protecting this resource is customer managed, then
+       * its version can be rotated in Cloud Key Management Service (Cloud KMS).
+       * The primary version of the key and its status will be reflected here when
+       * changes propagate from Cloud KMS.
+       * 
+ * + * + * repeated .google.bigtable.admin.v2.EncryptionInfo encryption_info = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getEncryptionInfoBuilderList() { + return getEncryptionInfoFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder> + getEncryptionInfoFieldBuilder() { + if (encryptionInfoBuilder_ == null) { + encryptionInfoBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.bigtable.admin.v2.EncryptionInfo, + com.google.bigtable.admin.v2.EncryptionInfo.Builder, + com.google.bigtable.admin.v2.EncryptionInfoOrBuilder>( + encryptionInfo_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + encryptionInfo_ = null; + } + return encryptionInfoBuilder_; + } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { @@ -1426,8 +2172,8 @@ public com.google.bigtable.admin.v2.Table.ClusterState getDefaultInstanceForType * * *
-   * Output only. The unique name of the table. Values are of the form
-   * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    * 
* @@ -1451,8 +2197,8 @@ public java.lang.String getName() { * * *
-   * Output only. The unique name of the table. Values are of the form
-   * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    * 
* @@ -1515,7 +2261,7 @@ public int getClusterStatesCount() { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -1543,7 +2289,7 @@ public boolean containsClusterStates(java.lang.String key) { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -1562,7 +2308,7 @@ public boolean containsClusterStates(java.lang.String key) { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -1586,7 +2332,7 @@ public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2258,8 +3004,8 @@ public Builder mergeFrom( * * *
-     * Output only. The unique name of the table. Values are of the form
-     * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
      * 
* @@ -2282,8 +3028,8 @@ public java.lang.String getName() { * * *
-     * Output only. The unique name of the table. Values are of the form
-     * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
      * 
* @@ -2306,8 +3052,8 @@ public com.google.protobuf.ByteString getNameBytes() { * * *
-     * Output only. The unique name of the table. Values are of the form
-     * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
      * 
* @@ -2329,8 +3075,8 @@ public Builder setName(java.lang.String value) { * * *
-     * Output only. The unique name of the table. Values are of the form
-     * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
      * 
* @@ -2348,8 +3094,8 @@ public Builder clearName() { * * *
-     * Output only. The unique name of the table. Values are of the form
-     * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+     * The unique name of the table. Values are of the form
+     * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
      * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
      * 
* @@ -2409,7 +3155,7 @@ public int getClusterStatesCount() { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2437,7 +3183,7 @@ public boolean containsClusterStates(java.lang.String key) { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2456,7 +3202,7 @@ public boolean containsClusterStates(java.lang.String key) { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2480,7 +3226,7 @@ public com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2512,7 +3258,7 @@ public Builder clearClusterStates() { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2539,7 +3285,7 @@ public Builder removeClusterStates(java.lang.String key) { * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -2564,7 +3310,7 @@ public Builder putClusterStates( * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java index b6ec252c1..fe7b9029e 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableOrBuilder.java @@ -27,8 +27,8 @@ public interface TableOrBuilder * * *
-   * Output only. The unique name of the table. Values are of the form
-   * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    * 
* @@ -41,8 +41,8 @@ public interface TableOrBuilder * * *
-   * Output only. The unique name of the table. Values are of the form
-   * `projects/<project>/instances/<instance>/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
+   * The unique name of the table. Values are of the form
+   * `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`.
    * Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL`
    * 
* @@ -60,7 +60,7 @@ public interface TableOrBuilder * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -75,7 +75,7 @@ public interface TableOrBuilder * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -94,7 +94,7 @@ public interface TableOrBuilder * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -110,7 +110,7 @@ public interface TableOrBuilder * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; @@ -126,7 +126,7 @@ com.google.bigtable.admin.v2.Table.ClusterState getClusterStatesOrDefault( * If it could not be determined whether or not the table has data in a * particular cluster (for example, if its zone is unavailable), then * there will be an entry for the cluster with UNKNOWN `replication_status`. - * Views: `REPLICATION_VIEW`, `FULL` + * Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` * * * map<string, .google.bigtable.admin.v2.Table.ClusterState> cluster_states = 2; diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java index 0f4d5479d..eafc54bad 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java +++ b/proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/TableProto.java @@ -63,6 +63,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_bigtable_admin_v2_GcRule_Union_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_bigtable_admin_v2_GcRule_Union_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_bigtable_admin_v2_Snapshot_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -88,82 +92,99 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "google.bigtable.admin.v2\032\037google/api/fie" + "ld_behavior.proto\032\031google/api/resource.p" + "roto\032\036google/protobuf/duration.proto\032\037go" - + "ogle/protobuf/timestamp.proto\"\233\001\n\013Restor" - + "eInfo\022@\n\013source_type\030\001 \001(\0162+.google.bigt" - + "able.admin.v2.RestoreSourceType\022;\n\013backu" - + "p_info\030\002 \001(\0132$.google.bigtable.admin.v2." - + "BackupInfoH\000B\r\n\013source_info\"\373\007\n\005Table\022\014\n" - + "\004name\030\001 \001(\t\022J\n\016cluster_states\030\002 \003(\01322.go" - + "ogle.bigtable.admin.v2.Table.ClusterStat" - + "esEntry\022L\n\017column_families\030\003 \003(\01323.googl" - + "e.bigtable.admin.v2.Table.ColumnFamilies" - + "Entry\022I\n\013granularity\030\004 \001(\01624.google.bigt" - + "able.admin.v2.Table.TimestampGranularity" - + "\022;\n\014restore_info\030\006 \001(\0132%.google.bigtable" - + ".admin.v2.RestoreInfo\032\371\001\n\014ClusterState\022X" - + "\n\021replication_state\030\001 \001(\0162=.google.bigta" - + "ble.admin.v2.Table.ClusterState.Replicat" - + "ionState\"\216\001\n\020ReplicationState\022\023\n\017STATE_N" - + "OT_KNOWN\020\000\022\020\n\014INITIALIZING\020\001\022\027\n\023PLANNED_" - + "MAINTENANCE\020\002\022\031\n\025UNPLANNED_MAINTENANCE\020\003" - + "\022\t\n\005READY\020\004\022\024\n\020READY_OPTIMIZING\020\005\032b\n\022Clu" - + "sterStatesEntry\022\013\n\003key\030\001 \001(\t\022;\n\005value\030\002 " - + "\001(\0132,.google.bigtable.admin.v2.Table.Clu" - + "sterState:\0028\001\032]\n\023ColumnFamiliesEntry\022\013\n\003" - + "key\030\001 \001(\t\0225\n\005value\030\002 \001(\0132&.google.bigtab" - + "le.admin.v2.ColumnFamily:\0028\001\"I\n\024Timestam" - + "pGranularity\022%\n!TIMESTAMP_GRANULARITY_UN" - + "SPECIFIED\020\000\022\n\n\006MILLIS\020\001\"\\\n\004View\022\024\n\020VIEW_" - + "UNSPECIFIED\020\000\022\r\n\tNAME_ONLY\020\001\022\017\n\013SCHEMA_V" - + "IEW\020\002\022\024\n\020REPLICATION_VIEW\020\003\022\010\n\004FULL\020\004:Z\352" - + "AW\n\035bigtable.googleapis.com/Table\0226proje" - + "cts/{project}/instances/{instance}/table" - + "s/{table}\"A\n\014ColumnFamily\0221\n\007gc_rule\030\001 \001" - + "(\0132 .google.bigtable.admin.v2.GcRule\"\325\002\n" - + "\006GcRule\022\032\n\020max_num_versions\030\001 \001(\005H\000\022,\n\007m" - + "ax_age\030\002 \001(\0132\031.google.protobuf.DurationH" - + "\000\022E\n\014intersection\030\003 \001(\0132-.google.bigtabl" - + "e.admin.v2.GcRule.IntersectionH\000\0227\n\005unio" - + "n\030\004 \001(\0132&.google.bigtable.admin.v2.GcRul" - + "e.UnionH\000\032?\n\014Intersection\022/\n\005rules\030\001 \003(\013" - + "2 .google.bigtable.admin.v2.GcRule\0328\n\005Un" - + "ion\022/\n\005rules\030\001 \003(\0132 .google.bigtable.adm" - + "in.v2.GcRuleB\006\n\004rule\"\307\003\n\010Snapshot\022\014\n\004nam" - + "e\030\001 \001(\t\0225\n\014source_table\030\002 \001(\0132\037.google.b" - + "igtable.admin.v2.Table\022\027\n\017data_size_byte" - + "s\030\003 \001(\003\022/\n\013create_time\030\004 \001(\0132\032.google.pr" - + "otobuf.Timestamp\022/\n\013delete_time\030\005 \001(\0132\032." - + "google.protobuf.Timestamp\0227\n\005state\030\006 \001(\016" - + "2(.google.bigtable.admin.v2.Snapshot.Sta" - + "te\022\023\n\013description\030\007 \001(\t\"5\n\005State\022\023\n\017STAT" - + "E_NOT_KNOWN\020\000\022\t\n\005READY\020\001\022\014\n\010CREATING\020\002:v" - + "\352As\n bigtable.googleapis.com/Snapshot\022Op" - + "rojects/{project}/instances/{instance}/c" - + "lusters/{cluster}/snapshots/{snapshot}\"\327" - + "\003\n\006Backup\022\021\n\004name\030\001 \001(\tB\003\340A\003\022\034\n\014source_t" - + "able\030\002 \001(\tB\006\340A\005\340A\002\0224\n\013expire_time\030\003 \001(\0132" - + "\032.google.protobuf.TimestampB\003\340A\002\0223\n\nstar" - + "t_time\030\004 \001(\0132\032.google.protobuf.Timestamp" - + "B\003\340A\003\0221\n\010end_time\030\005 \001(\0132\032.google.protobu" - + "f.TimestampB\003\340A\003\022\027\n\nsize_bytes\030\006 \001(\003B\003\340A" - + "\003\022:\n\005state\030\007 \001(\0162&.google.bigtable.admin" - + ".v2.Backup.StateB\003\340A\003\"7\n\005State\022\025\n\021STATE_" - + "UNSPECIFIED\020\000\022\014\n\010CREATING\020\001\022\t\n\005READY\020\002:p" - + "\352Am\n\036bigtable.googleapis.com/Backup\022Kpro" - + "jects/{project}/instances/{instance}/clu" - + "sters/{cluster}/backups/{backup}\"\244\001\n\nBac" - + "kupInfo\022\023\n\006backup\030\001 \001(\tB\003\340A\003\0223\n\nstart_ti" - + "me\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A" - + "\003\0221\n\010end_time\030\003 \001(\0132\032.google.protobuf.Ti" - + "mestampB\003\340A\003\022\031\n\014source_table\030\004 \001(\tB\003\340A\003*" - + "D\n\021RestoreSourceType\022#\n\037RESTORE_SOURCE_T" - + "YPE_UNSPECIFIED\020\000\022\n\n\006BACKUP\020\001B\322\001\n\034com.go" - + "ogle.bigtable.admin.v2B\nTableProtoP\001Z=go" - + "ogle.golang.org/genproto/googleapis/bigt" - + "able/admin/v2;admin\252\002\036Google.Cloud.Bigta" - + "ble.Admin.V2\312\002\036Google\\Cloud\\Bigtable\\Adm" - + "in\\V2\352\002\"Google::Cloud::Bigtable::Admin::" - + "V2b\006proto3" + + "ogle/protobuf/timestamp.proto\032\027google/rp" + + "c/status.proto\"\233\001\n\013RestoreInfo\022@\n\013source" + + "_type\030\001 \001(\0162+.google.bigtable.admin.v2.R" + + "estoreSourceType\022;\n\013backup_info\030\002 \001(\0132$." + + "google.bigtable.admin.v2.BackupInfoH\000B\r\n" + + "\013source_info\"\330\010\n\005Table\022\014\n\004name\030\001 \001(\t\022J\n\016" + + "cluster_states\030\002 \003(\01322.google.bigtable.a" + + "dmin.v2.Table.ClusterStatesEntry\022L\n\017colu" + + "mn_families\030\003 \003(\01323.google.bigtable.admi" + + "n.v2.Table.ColumnFamiliesEntry\022I\n\013granul" + + "arity\030\004 \001(\01624.google.bigtable.admin.v2.T" + + "able.TimestampGranularity\022;\n\014restore_inf" + + "o\030\006 \001(\0132%.google.bigtable.admin.v2.Resto" + + "reInfo\032\301\002\n\014ClusterState\022X\n\021replication_s" + + "tate\030\001 \001(\0162=.google.bigtable.admin.v2.Ta" + + "ble.ClusterState.ReplicationState\022F\n\017enc" + + "ryption_info\030\002 \003(\0132(.google.bigtable.adm" + + "in.v2.EncryptionInfoB\003\340A\003\"\216\001\n\020Replicatio" + + "nState\022\023\n\017STATE_NOT_KNOWN\020\000\022\020\n\014INITIALIZ" + + "ING\020\001\022\027\n\023PLANNED_MAINTENANCE\020\002\022\031\n\025UNPLAN" + + "NED_MAINTENANCE\020\003\022\t\n\005READY\020\004\022\024\n\020READY_OP" + + "TIMIZING\020\005\032b\n\022ClusterStatesEntry\022\013\n\003key\030" + + "\001 \001(\t\022;\n\005value\030\002 \001(\0132,.google.bigtable.a" + + "dmin.v2.Table.ClusterState:\0028\001\032]\n\023Column" + + "FamiliesEntry\022\013\n\003key\030\001 \001(\t\0225\n\005value\030\002 \001(" + + "\0132&.google.bigtable.admin.v2.ColumnFamil" + + "y:\0028\001\"I\n\024TimestampGranularity\022%\n!TIMESTA" + + "MP_GRANULARITY_UNSPECIFIED\020\000\022\n\n\006MILLIS\020\001" + + "\"q\n\004View\022\024\n\020VIEW_UNSPECIFIED\020\000\022\r\n\tNAME_O" + + "NLY\020\001\022\017\n\013SCHEMA_VIEW\020\002\022\024\n\020REPLICATION_VI" + + "EW\020\003\022\023\n\017ENCRYPTION_VIEW\020\005\022\010\n\004FULL\020\004:Z\352AW" + + "\n\035bigtable.googleapis.com/Table\0226project" + + "s/{project}/instances/{instance}/tables/" + + "{table}\"A\n\014ColumnFamily\0221\n\007gc_rule\030\001 \001(\013" + + "2 .google.bigtable.admin.v2.GcRule\"\325\002\n\006G" + + "cRule\022\032\n\020max_num_versions\030\001 \001(\005H\000\022,\n\007max" + + "_age\030\002 \001(\0132\031.google.protobuf.DurationH\000\022" + + "E\n\014intersection\030\003 \001(\0132-.google.bigtable." + + "admin.v2.GcRule.IntersectionH\000\0227\n\005union\030" + + "\004 \001(\0132&.google.bigtable.admin.v2.GcRule." + + "UnionH\000\032?\n\014Intersection\022/\n\005rules\030\001 \003(\0132 " + + ".google.bigtable.admin.v2.GcRule\0328\n\005Unio" + + "n\022/\n\005rules\030\001 \003(\0132 .google.bigtable.admin" + + ".v2.GcRuleB\006\n\004rule\"\331\002\n\016EncryptionInfo\022U\n" + + "\017encryption_type\030\003 \001(\01627.google.bigtable" + + ".admin.v2.EncryptionInfo.EncryptionTypeB" + + "\003\340A\003\0222\n\021encryption_status\030\004 \001(\0132\022.google" + + ".rpc.StatusB\003\340A\003\022I\n\017kms_key_version\030\002 \001(" + + "\tB0\340A\003\372A*\n(cloudkms.googleapis.com/Crypt" + + "oKeyVersion\"q\n\016EncryptionType\022\037\n\033ENCRYPT" + + "ION_TYPE_UNSPECIFIED\020\000\022\035\n\031GOOGLE_DEFAULT" + + "_ENCRYPTION\020\001\022\037\n\033CUSTOMER_MANAGED_ENCRYP" + + "TION\020\002\"\307\003\n\010Snapshot\022\014\n\004name\030\001 \001(\t\0225\n\014sou" + + "rce_table\030\002 \001(\0132\037.google.bigtable.admin." + + "v2.Table\022\027\n\017data_size_bytes\030\003 \001(\003\022/\n\013cre" + + "ate_time\030\004 \001(\0132\032.google.protobuf.Timesta" + + "mp\022/\n\013delete_time\030\005 \001(\0132\032.google.protobu" + + "f.Timestamp\0227\n\005state\030\006 \001(\0162(.google.bigt" + + "able.admin.v2.Snapshot.State\022\023\n\013descript" + + "ion\030\007 \001(\t\"5\n\005State\022\023\n\017STATE_NOT_KNOWN\020\000\022" + + "\t\n\005READY\020\001\022\014\n\010CREATING\020\002:v\352As\n bigtable." + + "googleapis.com/Snapshot\022Oprojects/{proje" + + "ct}/instances/{instance}/clusters/{clust" + + "er}/snapshots/{snapshot}\"\237\004\n\006Backup\022\021\n\004n" + + "ame\030\001 \001(\tB\003\340A\003\022\034\n\014source_table\030\002 \001(\tB\006\340A" + + "\005\340A\002\0224\n\013expire_time\030\003 \001(\0132\032.google.proto" + + "buf.TimestampB\003\340A\002\0223\n\nstart_time\030\004 \001(\0132\032" + + ".google.protobuf.TimestampB\003\340A\003\0221\n\010end_t" + + "ime\030\005 \001(\0132\032.google.protobuf.TimestampB\003\340" + + "A\003\022\027\n\nsize_bytes\030\006 \001(\003B\003\340A\003\022:\n\005state\030\007 \001" + + "(\0162&.google.bigtable.admin.v2.Backup.Sta" + + "teB\003\340A\003\022F\n\017encryption_info\030\t \001(\0132(.googl" + + "e.bigtable.admin.v2.EncryptionInfoB\003\340A\003\"" + + "7\n\005State\022\025\n\021STATE_UNSPECIFIED\020\000\022\014\n\010CREAT" + + "ING\020\001\022\t\n\005READY\020\002:p\352Am\n\036bigtable.googleap" + + "is.com/Backup\022Kprojects/{project}/instan" + + "ces/{instance}/clusters/{cluster}/backup" + + "s/{backup}\"\244\001\n\nBackupInfo\022\023\n\006backup\030\001 \001(" + + "\tB\003\340A\003\0223\n\nstart_time\030\002 \001(\0132\032.google.prot" + + "obuf.TimestampB\003\340A\003\0221\n\010end_time\030\003 \001(\0132\032." + + "google.protobuf.TimestampB\003\340A\003\022\031\n\014source" + + "_table\030\004 \001(\tB\003\340A\003*D\n\021RestoreSourceType\022#" + + "\n\037RESTORE_SOURCE_TYPE_UNSPECIFIED\020\000\022\n\n\006B" + + "ACKUP\020\001B\374\002\n\034com.google.bigtable.admin.v2" + + "B\nTableProtoP\001Z=google.golang.org/genpro" + + "to/googleapis/bigtable/admin/v2;admin\252\002\036" + + "Google.Cloud.Bigtable.Admin.V2\312\002\036Google\\" + + "Cloud\\Bigtable\\Admin\\V2\352\002\"Google::Cloud:" + + ":Bigtable::Admin::V2\352A\246\001\n(cloudkms.googl" + + "eapis.com/CryptoKeyVersion\022zprojects/{pr" + + "oject}/locations/{location}/keyRings/{ke" + + "y_ring}/cryptoKeys/{crypto_key}/cryptoKe" + + "yVersions/{crypto_key_version}b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -173,6 +194,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.api.ResourceProto.getDescriptor(), com.google.protobuf.DurationProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), + com.google.rpc.StatusProto.getDescriptor(), }); internal_static_google_bigtable_admin_v2_RestoreInfo_descriptor = getDescriptor().getMessageTypes().get(0); @@ -196,7 +218,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Table_ClusterState_descriptor, new java.lang.String[] { - "ReplicationState", + "ReplicationState", "EncryptionInfo", }); internal_static_google_bigtable_admin_v2_Table_ClusterStatesEntry_descriptor = internal_static_google_bigtable_admin_v2_Table_descriptor.getNestedTypes().get(1); @@ -246,8 +268,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Rules", }); - internal_static_google_bigtable_admin_v2_Snapshot_descriptor = + internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor = getDescriptor().getMessageTypes().get(4); + internal_static_google_bigtable_admin_v2_EncryptionInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_bigtable_admin_v2_EncryptionInfo_descriptor, + new java.lang.String[] { + "EncryptionType", "EncryptionStatus", "KmsKeyVersion", + }); + internal_static_google_bigtable_admin_v2_Snapshot_descriptor = + getDescriptor().getMessageTypes().get(5); internal_static_google_bigtable_admin_v2_Snapshot_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Snapshot_descriptor, @@ -261,15 +291,22 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "Description", }); internal_static_google_bigtable_admin_v2_Backup_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(6); internal_static_google_bigtable_admin_v2_Backup_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_Backup_descriptor, new java.lang.String[] { - "Name", "SourceTable", "ExpireTime", "StartTime", "EndTime", "SizeBytes", "State", + "Name", + "SourceTable", + "ExpireTime", + "StartTime", + "EndTime", + "SizeBytes", + "State", + "EncryptionInfo", }); internal_static_google_bigtable_admin_v2_BackupInfo_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(7); internal_static_google_bigtable_admin_v2_BackupInfo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_bigtable_admin_v2_BackupInfo_descriptor, @@ -280,12 +317,15 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceDefinition); + registry.add(com.google.api.ResourceProto.resourceReference); com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( descriptor, registry); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.DurationProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); + com.google.rpc.StatusProto.getDescriptor(); } // @@protoc_insertion_point(outer_class_scope) diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto index 2086f9707..d590788b2 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/instance.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,7 +11,6 @@ // 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. -// syntax = "proto3"; @@ -28,6 +27,10 @@ option java_outer_classname = "InstanceProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; // A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and // the resources that serve them. @@ -113,6 +116,22 @@ message Cluster { pattern: "projects/{project}/instances/{instance}/clusters/{cluster}" }; + // Cloud Key Management Service (Cloud KMS) settings for a CMEK-protected + // cluster. + message EncryptionConfig { + // Describes the Cloud KMS encryption key that will be used to protect the + // destination Bigtable cluster. The requirements for this key are: + // 1) The Cloud Bigtable service account associated with the project that + // contains this cluster must be granted the + // `cloudkms.cryptoKeyEncrypterDecrypter` role on the CMEK key. + // 2) Only regional keys can be used and the region of the CMEK key must + // match the region of the cluster. + // 3) All clusters within an instance must use the same CMEK key. + string kms_key_name = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; + } + // Possible states of a cluster. enum State { // The state of the cluster could not be determined. @@ -162,6 +181,10 @@ message Cluster { // The type of storage used by this cluster to serve its // parent instance's tables, unless explicitly overridden. StorageType default_storage_type = 5; + + // Immutable. The encryption configuration for CMEK-protected clusters. + EncryptionConfig encryption_config = 6 + [(google.api.field_behavior) = IMMUTABLE]; } // A configuration object describing how Cloud Bigtable should treat traffic @@ -194,7 +217,7 @@ message AppProfile { // (`OutputOnly`) // The unique name of the app profile. Values are of the form - // `projects//instances//appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + // `projects/{project}/instances/{instance}/appProfiles/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. string name = 1; // Strongly validated etag for optimistic concurrency control. Preserve the diff --git a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto index e85ca8ca9..a5578225e 100644 --- a/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto +++ b/proto-google-cloud-bigtable-admin-v2/src/main/proto/google/bigtable/admin/v2/table.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; option csharp_namespace = "Google.Cloud.Bigtable.Admin.V2"; option go_package = "google.golang.org/genproto/googleapis/bigtable/admin/v2;admin"; @@ -28,6 +29,10 @@ option java_outer_classname = "TableProto"; option java_package = "com.google.bigtable.admin.v2"; option php_namespace = "Google\\Cloud\\Bigtable\\Admin\\V2"; option ruby_package = "Google::Cloud::Bigtable::Admin::V2"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; // Indicates the type of the restore source. enum RestoreSourceType { @@ -92,6 +97,14 @@ message Table { // Output only. The state of replication for the table in this cluster. ReplicationState replication_state = 1; + + // Output only. The encryption information for the table in this cluster. + // If the encryption key protecting this resource is customer managed, then + // its version can be rotated in Cloud Key Management Service (Cloud KMS). + // The primary version of the key and its status will be reflected here when + // changes propagate from Cloud KMS. + repeated EncryptionInfo encryption_info = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Possible timestamp granularities to use when keeping multiple versions @@ -120,12 +133,15 @@ message Table { // state. REPLICATION_VIEW = 3; + // Only populates 'name' and fields related to the table's encryption state. + ENCRYPTION_VIEW = 5; + // Populates all fields. FULL = 4; } - // Output only. The unique name of the table. Values are of the form - // `projects//instances//tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. + // The unique name of the table. Values are of the form + // `projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*`. // Views: `NAME_ONLY`, `SCHEMA_VIEW`, `REPLICATION_VIEW`, `FULL` string name = 1; @@ -133,7 +149,7 @@ message Table { // If it could not be determined whether or not the table has data in a // particular cluster (for example, if its zone is unavailable), then // there will be an entry for the cluster with UNKNOWN `replication_status`. - // Views: `REPLICATION_VIEW`, `FULL` + // Views: `REPLICATION_VIEW`, `ENCRYPTION_VIEW`, `FULL` map cluster_states = 2; // (`CreationOnly`) @@ -196,6 +212,51 @@ message GcRule { } } +// Encryption information for a given resource. +// If this resource is protected with customer managed encryption, the in-use +// Cloud Key Management Service (Cloud KMS) key version is specified along with +// its status. +message EncryptionInfo { + // Possible encryption types for a resource. + enum EncryptionType { + // Encryption type was not specified, though data at rest remains encrypted. + ENCRYPTION_TYPE_UNSPECIFIED = 0; + + // The data backing this resource is encrypted at rest with a key that is + // fully managed by Google. No key version or status will be populated. + // This is the default state. + GOOGLE_DEFAULT_ENCRYPTION = 1; + + // The data backing this resource is encrypted at rest with a key that is + // managed by the customer. + // The in-use version of the key and its status are populated for + // CMEK-protected tables. + // CMEK-protected backups are pinned to the key version that was in use at + // the time the backup was taken. This key version is populated but its + // status is not tracked and is reported as `UNKNOWN`. + CUSTOMER_MANAGED_ENCRYPTION = 2; + } + + // Output only. The type of encryption used to protect this resource. + EncryptionType encryption_type = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The status of encrypt/decrypt calls on underlying data for + // this resource. Regardless of status, the existing data is always encrypted + // at rest. + google.rpc.Status encryption_status = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of the Cloud KMS key specified in the parent + // cluster that is in use for the data underlying this table. + string kms_key_version = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + // A snapshot of a table at a particular time. A snapshot can be used as a // checkpoint for data restoration or a data source for a new table. // @@ -225,7 +286,7 @@ message Snapshot { // Output only. The unique name of the snapshot. // Values are of the form - // `projects//instances//clusters//snapshots/`. + // `projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}`. string name = 1; // Output only. The source table at the time the snapshot was taken. @@ -318,6 +379,10 @@ message Backup { // Output only. The current state of the backup. State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The encryption information for the backup. + EncryptionInfo encryption_info = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // Information about a backup. diff --git a/synth.metadata b/synth.metadata index 4713ed187..ee651c163 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-bigtable.git", - "sha": "97fafff4750152c95d339b48d1d7892e24cb2edb" + "sha": "60d17dc1d0a0a568a8bdd3bcc1e7491c17142af3" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb", - "internalRef": "356341083" + "sha": "eabec5a21219401bad79e1cc7d900c1658aee5fd", + "internalRef": "359130387" } }, { @@ -108,6 +108,7 @@ "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminSettings.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminClient.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/BaseBigtableTableAdminSettings.java", + "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/gapic_metadata.json", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStub.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableInstanceAdminStubSettings.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/BigtableTableAdminStub.java", @@ -116,6 +117,7 @@ "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableInstanceAdminStub.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminCallableFactory.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/admin/v2/stub/GrpcBigtableTableAdminStub.java", + "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/gapic_metadata.json", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStub.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/BigtableStubSettings.java", "google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/stub/GrpcBigtableCallableFactory.java", @@ -171,6 +173,8 @@ "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableFromSnapshotRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequest.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CreateTableRequestOrBuilder.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyName.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/CryptoKeyVersionName.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequest.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteAppProfileRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteBackupRequest.java", @@ -185,6 +189,8 @@ "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DeleteTableRequestOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequest.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/DropRowRangeRequestOrBuilder.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfo.java", + "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/EncryptionInfoOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRule.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GcRuleOrBuilder.java", "proto-google-cloud-bigtable-admin-v2/src/main/java/com/google/bigtable/admin/v2/GenerateConsistencyTokenRequest.java",