Skip to content

Commit 3fb4fc8

Browse files
committed
fix: lint issues
1 parent 9593bb6 commit 3fb4fc8

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

secretmanager/src/main/java/secretmanager/regionalsamples/CreateRegionalSecretWithAnnotations.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
package secretmanager.regionalsamples;
17+
package secretmanager.regionalsamples;
1818

1919

2020
// [START secretmanager_create_regional_secret_with_annotations]
2121
import com.google.cloud.secretmanager.v1.LocationName;
2222
import com.google.cloud.secretmanager.v1.Secret;
2323
import com.google.cloud.secretmanager.v1.SecretManagerServiceClient;
2424
import com.google.cloud.secretmanager.v1.SecretManagerServiceSettings;
25-
2625
import java.io.IOException;
2726

2827
public class CreateRegionalSecretWithAnnotations {
@@ -41,28 +40,28 @@ public static void createRegionalSecretWithAnnotations() throws IOException {
4140
// This is the value of the annotation to be added
4241
String annotationValue = "your-annotation-value";
4342
createRegionalSecretWithAnnotations(
44-
projectId, locationId, secretId, annotationKey, annotationValue
43+
projectId, locationId, secretId, annotationKey, annotationValue
4544
);
4645
}
4746

4847
// Create a secret with annotations.
4948
public static Secret createRegionalSecretWithAnnotations(
50-
String projectId,
51-
String locationId,
52-
String secretId,
53-
String annotationKey,
54-
String annotationValue
49+
String projectId,
50+
String locationId,
51+
String secretId,
52+
String annotationKey,
53+
String annotationValue
5554
) throws IOException {
5655

5756
// Endpoint to call the regional secret manager sever
5857
String apiEndpoint = String.format("secretmanager.%s.rep.googleapis.com:443", locationId);
5958
SecretManagerServiceSettings secretManagerServiceSettings =
60-
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
59+
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
6160

6261
// Initialize the client that will be used to send requests. This client only needs to be
6362
// created once, and can be reused for multiple requests.
6463
try (SecretManagerServiceClient client =
65-
SecretManagerServiceClient.create(secretManagerServiceSettings)) {
64+
SecretManagerServiceClient.create(secretManagerServiceSettings)) {
6665

6766
// Build the parent name from the project.
6867
LocationName location = LocationName.of(projectId, locationId);

secretmanager/src/main/java/secretmanager/regionalsamples/EditRegionalSecretAnnotations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static Secret editRegionalSecretAnnotations(
5959
// Endpoint to call the regional secret manager sever
6060
String apiEndpoint = String.format("secretmanager.%s.rep.googleapis.com:443", locationId);
6161
SecretManagerServiceSettings secretManagerServiceSettings =
62-
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
62+
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
6363

6464
// Initialize the client that will be used to send requests. This client only needs to be
6565
// created once, and can be reused for multiple requests.

secretmanager/src/main/java/secretmanager/regionalsamples/ViewRegionalSecretAnnotations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static Map<String, String> viewRegionalSecretAnnotations(
4848
// Endpoint to call the regional secret manager sever
4949
String apiEndpoint = String.format("secretmanager.%s.rep.googleapis.com:443", locationId);
5050
SecretManagerServiceSettings secretManagerServiceSettings =
51-
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
51+
SecretManagerServiceSettings.newBuilder().setEndpoint(apiEndpoint).build();
5252

5353
// Initialize the client that will be used to send requests. This client only needs to be
5454
// created once, and can be reused for multiple requests.

secretmanager/src/test/java/secretmanager/regionalsamples/SnippetsIT.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,12 @@ public void testUpdateRegionalSecretWithAlias() throws IOException {
515515
public void testEditSecretAnnotations() throws IOException {
516516
SecretName name = SecretName.parse(TEST_REGIONAL_SECRET.getName());
517517
Secret updatedSecret = EditRegionalSecretAnnotations.editRegionalSecretAnnotations(
518-
name.getProject(), name.getLocation(), name.getSecret(), UPDATED_ANNOTATION_KEY, UPDATED_ANNOTATION_VALUE);
518+
name.getProject(),
519+
name.getLocation(),
520+
name.getSecret(),
521+
UPDATED_ANNOTATION_KEY,
522+
UPDATED_ANNOTATION_VALUE
523+
);
519524

520525
assertThat(updatedSecret.getAnnotationsMap()).containsEntry(
521526
UPDATED_ANNOTATION_KEY, UPDATED_ANNOTATION_VALUE);

0 commit comments

Comments
 (0)