21
21
import com .google .api .resourcenames .ResourceName ;
22
22
import com .google .cloud .devtools .containeranalysis .v1 .stub .ContainerAnalysisStub ;
23
23
import com .google .cloud .devtools .containeranalysis .v1 .stub .ContainerAnalysisStubSettings ;
24
+ import com .google .containeranalysis .v1 .GetVulnerabilityOccurrencesSummaryRequest ;
25
+ import com .google .containeranalysis .v1 .ProjectName ;
26
+ import com .google .containeranalysis .v1 .VulnerabilityOccurrencesSummary ;
24
27
import com .google .iam .v1 .GetIamPolicyRequest ;
25
28
import com .google .iam .v1 .Policy ;
26
29
import com .google .iam .v1 .SetIamPolicyRequest ;
52
55
* <pre>
53
56
* <code>
54
57
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
55
- * String resource = "" ;
58
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
56
59
* Policy policy = Policy.newBuilder().build();
57
60
* Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
58
61
* }
@@ -185,7 +188,7 @@ public ContainerAnalysisStub getStub() {
185
188
*
186
189
* <pre><code>
187
190
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
188
- * String resource = "" ;
191
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
189
192
* Policy policy = Policy.newBuilder().build();
190
193
* Policy response = containerAnalysisClient.setIamPolicy(resource, policy);
191
194
* }
@@ -220,7 +223,7 @@ public final Policy setIamPolicy(ResourceName resource, Policy policy) {
220
223
*
221
224
* <pre><code>
222
225
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
223
- * String resource = "" ;
226
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
224
227
* Policy policy = Policy.newBuilder().build();
225
228
* Policy response = containerAnalysisClient.setIamPolicy(resource.toString(), policy);
226
229
* }
@@ -252,7 +255,7 @@ public final Policy setIamPolicy(String resource, Policy policy) {
252
255
*
253
256
* <pre><code>
254
257
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
255
- * String resource = "" ;
258
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
256
259
* Policy policy = Policy.newBuilder().build();
257
260
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
258
261
* .setResource(resource.toString())
@@ -282,7 +285,7 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
282
285
*
283
286
* <pre><code>
284
287
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
285
- * String resource = "" ;
288
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
286
289
* Policy policy = Policy.newBuilder().build();
287
290
* SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder()
288
291
* .setResource(resource.toString())
@@ -311,7 +314,7 @@ public final UnaryCallable<SetIamPolicyRequest, Policy> setIamPolicyCallable() {
311
314
*
312
315
* <pre><code>
313
316
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
314
- * String resource = "" ;
317
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
315
318
* Policy response = containerAnalysisClient.getIamPolicy(resource);
316
319
* }
317
320
* </code></pre>
@@ -341,7 +344,7 @@ public final Policy getIamPolicy(ResourceName resource) {
341
344
*
342
345
* <pre><code>
343
346
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
344
- * String resource = "" ;
347
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
345
348
* Policy response = containerAnalysisClient.getIamPolicy(resource.toString());
346
349
* }
347
350
* </code></pre>
@@ -368,7 +371,7 @@ public final Policy getIamPolicy(String resource) {
368
371
*
369
372
* <pre><code>
370
373
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
371
- * String resource = "" ;
374
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
372
375
* GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
373
376
* .setResource(resource.toString())
374
377
* .build();
@@ -396,7 +399,7 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
396
399
*
397
400
* <pre><code>
398
401
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
399
- * String resource = "" ;
402
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
400
403
* GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder()
401
404
* .setResource(resource.toString())
402
405
* .build();
@@ -422,7 +425,7 @@ public final UnaryCallable<GetIamPolicyRequest, Policy> getIamPolicyCallable() {
422
425
*
423
426
* <pre><code>
424
427
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
425
- * String resource = "" ;
428
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
426
429
* List<String> permissions = new ArrayList<>();
427
430
* TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(resource, permissions);
428
431
* }
@@ -457,7 +460,7 @@ public final TestIamPermissionsResponse testIamPermissions(
457
460
*
458
461
* <pre><code>
459
462
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
460
- * String resource = "" ;
463
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
461
464
* List<String> permissions = new ArrayList<>();
462
465
* TestIamPermissionsResponse response = containerAnalysisClient.testIamPermissions(resource.toString(), permissions);
463
466
* }
@@ -492,7 +495,7 @@ public final TestIamPermissionsResponse testIamPermissions(
492
495
*
493
496
* <pre><code>
494
497
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
495
- * String resource = "" ;
498
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
496
499
* List<String> permissions = new ArrayList<>();
497
500
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
498
501
* .setResource(resource.toString())
@@ -521,7 +524,7 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
521
524
*
522
525
* <pre><code>
523
526
* try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
524
- * String resource = "" ;
527
+ * ResourceName resource = ProjectName.of("[PROJECT]") ;
525
528
* List<String> permissions = new ArrayList<>();
526
529
* TestIamPermissionsRequest request = TestIamPermissionsRequest.newBuilder()
527
530
* .setResource(resource.toString())
@@ -538,6 +541,112 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
538
541
return stub .testIamPermissionsCallable ();
539
542
}
540
543
544
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
545
+ /**
546
+ * Gets a summary of the number and severity of occurrences.
547
+ *
548
+ * <p>Sample code:
549
+ *
550
+ * <pre><code>
551
+ * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
552
+ * ProjectName parent = ProjectName.of("[PROJECT]");
553
+ * String filter = "";
554
+ * VulnerabilityOccurrencesSummary response = containerAnalysisClient.getVulnerabilityOccurrencesSummary(parent, filter);
555
+ * }
556
+ * </code></pre>
557
+ *
558
+ * @param parent The name of the project to get a vulnerability summary for in the form of
559
+ * `projects/[PROJECT_ID]`.
560
+ * @param filter The filter expression.
561
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
562
+ */
563
+ public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary (
564
+ ProjectName parent , String filter ) {
565
+ GetVulnerabilityOccurrencesSummaryRequest request =
566
+ GetVulnerabilityOccurrencesSummaryRequest .newBuilder ()
567
+ .setParent (parent == null ? null : parent .toString ())
568
+ .setFilter (filter )
569
+ .build ();
570
+ return getVulnerabilityOccurrencesSummary (request );
571
+ }
572
+
573
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
574
+ /**
575
+ * Gets a summary of the number and severity of occurrences.
576
+ *
577
+ * <p>Sample code:
578
+ *
579
+ * <pre><code>
580
+ * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
581
+ * ProjectName parent = ProjectName.of("[PROJECT]");
582
+ * String filter = "";
583
+ * VulnerabilityOccurrencesSummary response = containerAnalysisClient.getVulnerabilityOccurrencesSummary(parent.toString(), filter);
584
+ * }
585
+ * </code></pre>
586
+ *
587
+ * @param parent The name of the project to get a vulnerability summary for in the form of
588
+ * `projects/[PROJECT_ID]`.
589
+ * @param filter The filter expression.
590
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
591
+ */
592
+ public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary (
593
+ String parent , String filter ) {
594
+ GetVulnerabilityOccurrencesSummaryRequest request =
595
+ GetVulnerabilityOccurrencesSummaryRequest .newBuilder ()
596
+ .setParent (parent )
597
+ .setFilter (filter )
598
+ .build ();
599
+ return getVulnerabilityOccurrencesSummary (request );
600
+ }
601
+
602
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
603
+ /**
604
+ * Gets a summary of the number and severity of occurrences.
605
+ *
606
+ * <p>Sample code:
607
+ *
608
+ * <pre><code>
609
+ * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
610
+ * ProjectName parent = ProjectName.of("[PROJECT]");
611
+ * GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
612
+ * .setParent(parent.toString())
613
+ * .build();
614
+ * VulnerabilityOccurrencesSummary response = containerAnalysisClient.getVulnerabilityOccurrencesSummary(request);
615
+ * }
616
+ * </code></pre>
617
+ *
618
+ * @param request The request object containing all of the parameters for the API call.
619
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
620
+ */
621
+ public final VulnerabilityOccurrencesSummary getVulnerabilityOccurrencesSummary (
622
+ GetVulnerabilityOccurrencesSummaryRequest request ) {
623
+ return getVulnerabilityOccurrencesSummaryCallable ().call (request );
624
+ }
625
+
626
+ // AUTO-GENERATED DOCUMENTATION AND METHOD
627
+ /**
628
+ * Gets a summary of the number and severity of occurrences.
629
+ *
630
+ * <p>Sample code:
631
+ *
632
+ * <pre><code>
633
+ * try (ContainerAnalysisClient containerAnalysisClient = ContainerAnalysisClient.create()) {
634
+ * ProjectName parent = ProjectName.of("[PROJECT]");
635
+ * GetVulnerabilityOccurrencesSummaryRequest request = GetVulnerabilityOccurrencesSummaryRequest.newBuilder()
636
+ * .setParent(parent.toString())
637
+ * .build();
638
+ * ApiFuture<VulnerabilityOccurrencesSummary> future = containerAnalysisClient.getVulnerabilityOccurrencesSummaryCallable().futureCall(request);
639
+ * // Do something
640
+ * VulnerabilityOccurrencesSummary response = future.get();
641
+ * }
642
+ * </code></pre>
643
+ */
644
+ public final UnaryCallable <
645
+ GetVulnerabilityOccurrencesSummaryRequest , VulnerabilityOccurrencesSummary >
646
+ getVulnerabilityOccurrencesSummaryCallable () {
647
+ return stub .getVulnerabilityOccurrencesSummaryCallable ();
648
+ }
649
+
541
650
@ Override
542
651
public final void close () {
543
652
stub .close ();
0 commit comments