use of com.google.cloud.secretmanager.v1beta1.DeleteSecretRequest in project java-secretmanager by googleapis.
the class QuickstartIT method afterAll.
@AfterClass
public static void afterAll() throws Exception {
Assert.assertFalse("missing GOOGLE_CLOUD_PROJECT", Strings.isNullOrEmpty(PROJECT_ID));
try (SecretManagerServiceClient client = SecretManagerServiceClient.create()) {
// Delete the secret created by quickstart
SecretName name = SecretName.of(PROJECT_ID, SECRET_ID);
DeleteSecretRequest deleteRequest = DeleteSecretRequest.newBuilder().setName(name.toString()).build();
client.deleteSecret(deleteRequest);
}
}
use of com.google.cloud.secretmanager.v1beta1.DeleteSecretRequest in project java-secretmanager by googleapis.
the class NativeImageSecretManagerSampleIT method afterAll.
@AfterClass
public static void afterAll() throws Exception {
try (SecretManagerServiceClient client = SecretManagerServiceClient.create()) {
// Delete the secret created by quickstart
SecretName name = SecretName.of(PROJECT_ID, NATIVE_TEST_SECRET_ID);
DeleteSecretRequest deleteRequest = DeleteSecretRequest.newBuilder().setName(name.toString()).build();
client.deleteSecret(deleteRequest);
}
}
use of com.google.cloud.secretmanager.v1beta1.DeleteSecretRequest in project spring-cloud-gcp by GoogleCloudPlatform.
the class SecretManagerTemplate method deleteSecret.
@Override
public void deleteSecret(String secretId, String projectId) {
SecretName name = SecretName.of(projectId, secretId);
DeleteSecretRequest request = DeleteSecretRequest.newBuilder().setName(name.toString()).build();
this.secretManagerServiceClient.deleteSecret(request);
}
use of com.google.cloud.secretmanager.v1beta1.DeleteSecretRequest in project spring-cloud-gcp by GoogleCloudPlatform.
the class SecretManagerTemplateTests method verifyDeleteSecretRequest.
private void verifyDeleteSecretRequest(String secretId, String projectId) {
SecretName name = SecretName.of(projectId, secretId);
DeleteSecretRequest request = DeleteSecretRequest.newBuilder().setName(name.toString()).build();
verify(this.client).deleteSecret(request);
}
Aggregations