Skip to content

Commit dc120be

Browse files
Apply suggestions from code review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 15b8d11 commit dc120be

5 files changed

Lines changed: 3 additions & 10 deletions

File tree

secretmanager/src/main/java/secretmanager/CreateSecretWithCmek.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ public static void main(String[] args) throws IOException {
4242
public static Secret createSecretWithCmek(String projectId, String secretId, String kmsKeyName)
4343
throws IOException {
4444

45-
// Initialize client that will be used to send requests. This client only needs
46-
// to be created
45+
// Initialize client that will be used to send requests. This client only needs to be created
4746
// once, and can be reused for multiple requests.
4847
try (SecretManagerServiceClient client = SecretManagerServiceClient.create()) {
4948

secretmanager/src/main/java/secretmanager/regionalsamples/CreateRegionalSecretWithCmek.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public static Secret createRegionalSecretWithCmek(
5050
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
5151

5252
// Initialize client that will be used to send requests. This client only needs
53-
// to be created
5453
// once, and can be reused for multiple requests.
55-
try (SecretManagerServiceClient client =
5654
SecretManagerServiceClient.create(secretManagerServiceSettings)) {
5755
// Build the parent name from the project and location.
5856
LocationName locationName = LocationName.of(projectId, locationId);

secretmanager/src/main/java/secretmanager/regionalsamples/CreateRegionalSecretWithExpiration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ public static Secret createRegionalSecretWithExpiration(
4949
// Endpoint to call the regional secret manager sever
5050
String apiEndpoint = String.format("secretmanager.%s.rep.googleapis.com:443", locationId);
5151
SecretManagerServiceSettings secretManagerServiceSettings =
52-
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
53-
52+
// created once, and can be reused for multiple requests.
5453
// Initialize the client that will be used to send requests. This client only needs to be
5554
// created once, and can be reused for multiple requests.
5655
try (SecretManagerServiceClient client =

secretmanager/src/main/java/secretmanager/regionalsamples/DeleteRegionalSecretAnnotations.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ public static Secret deleteRegionalSecretAnnotations(
5050
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
5151

5252
// Initialize client that will be used to send requests. This client only needs
53-
// to be created
5453
// once, and can be reused for multiple requests.
55-
try (SecretManagerServiceClient client =
5654
SecretManagerServiceClient.create(secretManagerServiceSettings)) {
5755
// Build the name of the secret.
5856
SecretName secretName =

secretmanager/src/main/java/secretmanager/regionalsamples/UpdateRegionalSecretExpiration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public static Secret updateRegionalSecretExpiration(
5252
String apiEndpoint = String.format("secretmanager.%s.rep.googleapis.com:443", locationId);
5353
SecretManagerServiceSettings secretManagerServiceSettings =
5454
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
55-
56-
// Initialize the client that will be used to send requests. This client only needs to be
55+
// created once, and can be reused for multiple requests.
5756
// created once, and can be reused for multiple requests.
5857
try (SecretManagerServiceClient client =
5958
SecretManagerServiceClient.create(secretManagerServiceSettings)) {

0 commit comments

Comments
 (0)