Skip to content

Commit 207b68a

Browse files
chore: Integrate new gapic-generator-java and rules_gapic (#895)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 454027580 Source-Link: googleapis/googleapis@1b22277 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e04cea20d0d12eb5c3bdb360a9e72b654edcb638 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTA0Y2VhMjBkMGQxMmViNWMzYmRiMzYwYTllNzJiNjU0ZWRjYjYzOCJ9
1 parent e575d1c commit 207b68a

2 files changed

Lines changed: 43 additions & 19 deletions

File tree

java-dlp/google-cloud-dlp/src/main/java/com/google/cloud/dlp/v2/DlpServiceClient.java

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ public final ListInspectTemplatesPagedResponse listInspectTemplates(
14361436
* while (true) {
14371437
* ListInspectTemplatesResponse response =
14381438
* dlpServiceClient.listInspectTemplatesCallable().call(request);
1439-
* for (InspectTemplate element : response.getResponsesList()) {
1439+
* for (InspectTemplate element : response.getInspectTemplatesList()) {
14401440
* // doThingsWith(element);
14411441
* }
14421442
* String nextPageToken = response.getNextPageToken();
@@ -2442,7 +2442,7 @@ public final ListDeidentifyTemplatesPagedResponse listDeidentifyTemplates(
24422442
* while (true) {
24432443
* ListDeidentifyTemplatesResponse response =
24442444
* dlpServiceClient.listDeidentifyTemplatesCallable().call(request);
2445-
* for (DeidentifyTemplate element : response.getResponsesList()) {
2445+
* for (DeidentifyTemplate element : response.getDeidentifyTemplatesList()) {
24462446
* // doThingsWith(element);
24472447
* }
24482448
* String nextPageToken = response.getNextPageToken();
@@ -2891,7 +2891,9 @@ public final UnaryCallable<UpdateJobTriggerRequest, JobTrigger> updateJobTrigger
28912891
* // This snippet has been automatically generated for illustrative purposes only.
28922892
* // It may require modifications to work in your environment.
28932893
* try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
2894-
* JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
2894+
* JobTriggerName name =
2895+
* JobTriggerName.ofProjectLocationJobTriggerName(
2896+
* "[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]");
28952897
* HybridInspectResponse response = dlpServiceClient.hybridInspectJobTrigger(name);
28962898
* }
28972899
* }</pre>
@@ -2948,7 +2950,9 @@ public final HybridInspectResponse hybridInspectJobTrigger(String name) {
29482950
* HybridInspectJobTriggerRequest request =
29492951
* HybridInspectJobTriggerRequest.newBuilder()
29502952
* .setName(
2951-
* JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
2953+
* JobTriggerName.ofProjectLocationJobTriggerName(
2954+
* "[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]")
2955+
* .toString())
29522956
* .setHybridItem(HybridContentItem.newBuilder().build())
29532957
* .build();
29542958
* HybridInspectResponse response = dlpServiceClient.hybridInspectJobTrigger(request);
@@ -2977,7 +2981,9 @@ public final HybridInspectResponse hybridInspectJobTrigger(
29772981
* HybridInspectJobTriggerRequest request =
29782982
* HybridInspectJobTriggerRequest.newBuilder()
29792983
* .setName(
2980-
* JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]").toString())
2984+
* JobTriggerName.ofProjectLocationJobTriggerName(
2985+
* "[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]")
2986+
* .toString())
29812987
* .setHybridItem(HybridContentItem.newBuilder().build())
29822988
* .build();
29832989
* ApiFuture<HybridInspectResponse> future =
@@ -3289,7 +3295,7 @@ public final ListJobTriggersPagedResponse listJobTriggers(ListJobTriggersRequest
32893295
* .build();
32903296
* while (true) {
32913297
* ListJobTriggersResponse response = dlpServiceClient.listJobTriggersCallable().call(request);
3292-
* for (JobTrigger element : response.getResponsesList()) {
3298+
* for (JobTrigger element : response.getJobTriggersList()) {
32933299
* // doThingsWith(element);
32943300
* }
32953301
* String nextPageToken = response.getNextPageToken();
@@ -3998,7 +4004,7 @@ public final ListDlpJobsPagedResponse listDlpJobs(ListDlpJobsRequest request) {
39984004
* .build();
39994005
* while (true) {
40004006
* ListDlpJobsResponse response = dlpServiceClient.listDlpJobsCallable().call(request);
4001-
* for (DlpJob element : response.getResponsesList()) {
4007+
* for (DlpJob element : response.getJobsList()) {
40024008
* // doThingsWith(element);
40034009
* }
40044010
* String nextPageToken = response.getNextPageToken();
@@ -5128,7 +5134,7 @@ public final ListStoredInfoTypesPagedResponse listStoredInfoTypes(
51285134
* while (true) {
51295135
* ListStoredInfoTypesResponse response =
51305136
* dlpServiceClient.listStoredInfoTypesCallable().call(request);
5131-
* for (StoredInfoType element : response.getResponsesList()) {
5137+
* for (StoredInfoType element : response.getStoredInfoTypesList()) {
51325138
* // doThingsWith(element);
51335139
* }
51345140
* String nextPageToken = response.getNextPageToken();
@@ -5275,7 +5281,8 @@ public final UnaryCallable<DeleteStoredInfoTypeRequest, Empty> deleteStoredInfoT
52755281
* // This snippet has been automatically generated for illustrative purposes only.
52765282
* // It may require modifications to work in your environment.
52775283
* try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
5278-
* DlpJobName name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]");
5284+
* DlpJobName name =
5285+
* DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]");
52795286
* HybridInspectResponse response = dlpServiceClient.hybridInspectDlpJob(name);
52805287
* }
52815288
* }</pre>
@@ -5331,7 +5338,9 @@ public final HybridInspectResponse hybridInspectDlpJob(String name) {
53315338
* try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
53325339
* HybridInspectDlpJobRequest request =
53335340
* HybridInspectDlpJobRequest.newBuilder()
5334-
* .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
5341+
* .setName(
5342+
* DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
5343+
* .toString())
53355344
* .setHybridItem(HybridContentItem.newBuilder().build())
53365345
* .build();
53375346
* HybridInspectResponse response = dlpServiceClient.hybridInspectDlpJob(request);
@@ -5358,7 +5367,9 @@ public final HybridInspectResponse hybridInspectDlpJob(HybridInspectDlpJobReques
53585367
* try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
53595368
* HybridInspectDlpJobRequest request =
53605369
* HybridInspectDlpJobRequest.newBuilder()
5361-
* .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
5370+
* .setName(
5371+
* DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
5372+
* .toString())
53625373
* .setHybridItem(HybridContentItem.newBuilder().build())
53635374
* .build();
53645375
* ApiFuture<HybridInspectResponse> future =
@@ -5386,7 +5397,9 @@ public final HybridInspectResponse hybridInspectDlpJob(HybridInspectDlpJobReques
53865397
* try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
53875398
* FinishDlpJobRequest request =
53885399
* FinishDlpJobRequest.newBuilder()
5389-
* .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
5400+
* .setName(
5401+
* DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
5402+
* .toString())
53905403
* .build();
53915404
* dlpServiceClient.finishDlpJob(request);
53925405
* }
@@ -5412,7 +5425,9 @@ public final void finishDlpJob(FinishDlpJobRequest request) {
54125425
* try (DlpServiceClient dlpServiceClient = DlpServiceClient.create()) {
54135426
* FinishDlpJobRequest request =
54145427
* FinishDlpJobRequest.newBuilder()
5415-
* .setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
5428+
* .setName(
5429+
* DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
5430+
* .toString())
54165431
* .build();
54175432
* ApiFuture<Empty> future = dlpServiceClient.finishDlpJobCallable().futureCall(request);
54185433
* // Do something.

java-dlp/google-cloud-dlp/src/test/java/com/google/cloud/dlp/v2/DlpServiceClientTest.java

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,7 +2213,8 @@ public void hybridInspectJobTriggerTest() throws Exception {
22132213
HybridInspectResponse expectedResponse = HybridInspectResponse.newBuilder().build();
22142214
mockDlpService.addResponse(expectedResponse);
22152215

2216-
JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
2216+
JobTriggerName name =
2217+
JobTriggerName.ofProjectLocationJobTriggerName("[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]");
22172218

22182219
HybridInspectResponse actualResponse = client.hybridInspectJobTrigger(name);
22192220
Assert.assertEquals(expectedResponse, actualResponse);
@@ -2236,7 +2237,9 @@ public void hybridInspectJobTriggerExceptionTest() throws Exception {
22362237
mockDlpService.addException(exception);
22372238

22382239
try {
2239-
JobTriggerName name = JobTriggerName.ofProjectJobTriggerName("[PROJECT]", "[JOB_TRIGGER]");
2240+
JobTriggerName name =
2241+
JobTriggerName.ofProjectLocationJobTriggerName(
2242+
"[PROJECT]", "[LOCATION]", "[JOB_TRIGGER]");
22402243
client.hybridInspectJobTrigger(name);
22412244
Assert.fail("No exception raised");
22422245
} catch (InvalidArgumentException e) {
@@ -3959,7 +3962,8 @@ public void hybridInspectDlpJobTest() throws Exception {
39593962
HybridInspectResponse expectedResponse = HybridInspectResponse.newBuilder().build();
39603963
mockDlpService.addResponse(expectedResponse);
39613964

3962-
DlpJobName name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]");
3965+
DlpJobName name =
3966+
DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]");
39633967

39643968
HybridInspectResponse actualResponse = client.hybridInspectDlpJob(name);
39653969
Assert.assertEquals(expectedResponse, actualResponse);
@@ -3981,7 +3985,8 @@ public void hybridInspectDlpJobExceptionTest() throws Exception {
39813985
mockDlpService.addException(exception);
39823986

39833987
try {
3984-
DlpJobName name = DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]");
3988+
DlpJobName name =
3989+
DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]");
39853990
client.hybridInspectDlpJob(name);
39863991
Assert.fail("No exception raised");
39873992
} catch (InvalidArgumentException e) {
@@ -4031,7 +4036,9 @@ public void finishDlpJobTest() throws Exception {
40314036

40324037
FinishDlpJobRequest request =
40334038
FinishDlpJobRequest.newBuilder()
4034-
.setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
4039+
.setName(
4040+
DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
4041+
.toString())
40354042
.build();
40364043

40374044
client.finishDlpJob(request);
@@ -4055,7 +4062,9 @@ public void finishDlpJobExceptionTest() throws Exception {
40554062
try {
40564063
FinishDlpJobRequest request =
40574064
FinishDlpJobRequest.newBuilder()
4058-
.setName(DlpJobName.ofProjectDlpJobName("[PROJECT]", "[DLP_JOB]").toString())
4065+
.setName(
4066+
DlpJobName.ofProjectLocationDlpJobName("[PROJECT]", "[LOCATION]", "[DLP_JOB]")
4067+
.toString())
40594068
.build();
40604069
client.finishDlpJob(request);
40614070
Assert.fail("No exception raised");

0 commit comments

Comments
 (0)