This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(request);
+ * }
+ * }
+ *
* Note: close() needs to be called on the WebSecurityScannerClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -150,6 +161,19 @@ public WebSecurityScannerStub getStub() { /** * Creates a new ScanConfig. * + *
Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -162,6 +186,20 @@ public final ScanConfig createScanConfig(CreateScanConfigRequest request) {
* Creates a new ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.createScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * DeleteScanConfigRequest request =
+ * DeleteScanConfigRequest.newBuilder().setName("name3373707").build();
+ * webSecurityScannerClient.deleteScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -183,6 +231,17 @@ public final void deleteScanConfig(DeleteScanConfigRequest request) {
* Deletes an existing ScanConfig and its child resources.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * DeleteScanConfigRequest request =
+ * DeleteScanConfigRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanConfigRequest request =
+ * GetScanConfigRequest.newBuilder().setName("name3373707").build();
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -204,6 +273,17 @@ public final ScanConfig getScanConfig(GetScanConfigRequest request) {
* Gets a ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanConfigRequest request =
+ * GetScanConfigRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * webSecurityScannerClient.getScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanConfigsRequest request =
+ * ListScanConfigsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -225,6 +321,23 @@ public final ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest
* Lists ScanConfigs under a given project.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanConfigsRequest request =
+ * ListScanConfigsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ScanConfig element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListScanConfigsResponse response =
+ * webSecurityScannerClient.listScanConfigsCallable().call(request);
+ * for (ScanConfig element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * UpdateScanConfigRequest request =
+ * UpdateScanConfigRequest.newBuilder()
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.updateScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -258,6 +402,20 @@ public final ScanConfig updateScanConfig(UpdateScanConfigRequest request) {
* Updates a ScanConfig. This method support partial update of a ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * UpdateScanConfigRequest request =
+ * UpdateScanConfigRequest.newBuilder()
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.updateScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StartScanRunRequest request = StartScanRunRequest.newBuilder().setName("name3373707").build();
+ * ScanRun response = webSecurityScannerClient.startScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -279,6 +446,16 @@ public final ScanRun startScanRun(StartScanRunRequest request) {
* Start a ScanRun according to the given ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StartScanRunRequest request = StartScanRunRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * webSecurityScannerClient.startScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanRunRequest request = GetScanRunRequest.newBuilder().setName("name3373707").build();
+ * ScanRun response = webSecurityScannerClient.getScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -300,6 +486,15 @@ public final ScanRun getScanRun(GetScanRunRequest request) {
* Gets a ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanRunRequest request = GetScanRunRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = webSecurityScannerClient.getScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanRunsRequest request =
+ * ListScanRunsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -321,6 +532,23 @@ public final ListScanRunsPagedResponse listScanRuns(ListScanRunsRequest request)
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanRunsRequest request =
+ * ListScanRunsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ScanRun element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListScanRunsResponse response =
+ * webSecurityScannerClient.listScanRunsCallable().call(request);
+ * for (ScanRun element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StopScanRunRequest request = StopScanRunRequest.newBuilder().setName("name3373707").build();
+ * ScanRun response = webSecurityScannerClient.stopScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -353,6 +608,16 @@ public final ScanRun stopScanRun(StopScanRunRequest request) {
* Stops a ScanRun. The stopped ScanRun is returned.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StopScanRunRequest request = StopScanRunRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future =
+ * webSecurityScannerClient.stopScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListCrawledUrlsRequest request =
+ * ListCrawledUrlsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -374,6 +655,23 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(ListCrawledUrlsRequest
* List CrawledUrls under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListCrawledUrlsRequest request =
+ * ListCrawledUrlsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (CrawledUrl element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListCrawledUrlsResponse response =
+ * webSecurityScannerClient.listCrawledUrlsCallable().call(request);
+ * for (CrawledUrl element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetFindingRequest request = GetFindingRequest.newBuilder().setName("name3373707").build();
+ * Finding response = webSecurityScannerClient.getFinding(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -407,6 +732,15 @@ public final Finding getFinding(GetFindingRequest request) {
* Gets a Finding.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetFindingRequest request = GetFindingRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = webSecurityScannerClient.getFindingCallable().futureCall(request);
+ * // Do something.
+ * Finding response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingsRequest request =
+ * ListFindingsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setFilter("filter-1274492040")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (Finding element : webSecurityScannerClient.listFindings(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -428,6 +779,24 @@ public final ListFindingsPagedResponse listFindings(ListFindingsRequest request)
* List Findings under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingsRequest request =
+ * ListFindingsRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setFilter("filter-1274492040")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listFindingsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Finding element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListFindingsResponse response =
+ * webSecurityScannerClient.listFindingsCallable().call(request);
+ * for (Finding element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingTypeStatsRequest request =
+ * ListFindingTypeStatsRequest.newBuilder().setParent("parent-995424086").build();
+ * ListFindingTypeStatsResponse response =
+ * webSecurityScannerClient.listFindingTypeStats(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -461,6 +859,17 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(
* List all FindingTypeStats under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingTypeStatsRequest request =
+ * ListFindingTypeStatsRequest.newBuilder().setParent("parent-995424086").build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request);
+ * // Do something.
+ * ListFindingTypeStatsResponse response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample for WebSecurityScannerClient: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(request);
+ * }
+ * }
*/
@Generated("by gapic-generator-java")
package com.google.cloud.websecurityscanner.v1;
diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java
index 72a1db01..29927941 100644
--- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java
+++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1alpha/WebSecurityScannerClient.java
@@ -45,6 +45,14 @@
* This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
+ *
* Note: close() needs to be called on the WebSecurityScannerClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -152,6 +160,16 @@ public WebSecurityScannerStub getStub() { /** * Creates a new ScanConfig. * + *
Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
@@ -170,6 +188,16 @@ public final ScanConfig createScanConfig(ProjectName parent, ScanConfig scanConf
/**
* Creates a new ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
@@ -185,6 +213,19 @@ public final ScanConfig createScanConfig(String parent, ScanConfig scanConfig) {
/**
* Creates a new ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -197,6 +238,20 @@ public final ScanConfig createScanConfig(CreateScanConfigRequest request) {
* Creates a new ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.createScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * webSecurityScannerClient.deleteScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -220,6 +284,15 @@ public final void deleteScanConfig(ScanConfigName name) {
/**
* Deletes an existing ScanConfig and its child resources.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * webSecurityScannerClient.deleteScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -233,6 +306,18 @@ public final void deleteScanConfig(String name) {
/**
* Deletes an existing ScanConfig and its child resources.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * DeleteScanConfigRequest request =
+ * DeleteScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * webSecurityScannerClient.deleteScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -245,6 +330,19 @@ public final void deleteScanConfig(DeleteScanConfigRequest request) {
* Deletes an existing ScanConfig and its child resources.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * DeleteScanConfigRequest request =
+ * DeleteScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -268,6 +375,15 @@ public final ScanConfig getScanConfig(ScanConfigName name) {
/**
* Gets a ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -281,6 +397,18 @@ public final ScanConfig getScanConfig(String name) {
/**
* Gets a ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanConfigRequest request =
+ * GetScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -293,6 +421,19 @@ public final ScanConfig getScanConfig(GetScanConfigRequest request) {
* Gets a ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanConfigRequest request =
+ * GetScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.getScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a project resource name in
* the format 'projects/{projectId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -318,6 +470,17 @@ public final ListScanConfigsPagedResponse listScanConfigs(ProjectName parent) {
/**
* Lists ScanConfigs under a given project.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a project resource name in
* the format 'projects/{projectId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -331,6 +494,22 @@ public final ListScanConfigsPagedResponse listScanConfigs(String parent) {
/**
* Lists ScanConfigs under a given project.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanConfigsRequest request =
+ * ListScanConfigsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -343,6 +522,23 @@ public final ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest
* Lists ScanConfigs under a given project.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanConfigsRequest request =
+ * ListScanConfigsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ScanConfig element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListScanConfigsResponse response =
+ * webSecurityScannerClient.listScanConfigsCallable().call(request);
+ * for (ScanConfig element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.updateScanConfig(scanConfig, updateMask);
+ * }
+ * }
+ *
* @param scanConfig Required. The ScanConfig to be updated. The name field must be set to
* identify the resource to be updated. The values of fields not covered by the mask will be
* ignored.
@@ -385,6 +609,19 @@ public final ScanConfig updateScanConfig(ScanConfig scanConfig, FieldMask update
/**
* Updates a ScanConfig. This method support partial update of a ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * UpdateScanConfigRequest request =
+ * UpdateScanConfigRequest.newBuilder()
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.updateScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -397,6 +634,20 @@ public final ScanConfig updateScanConfig(UpdateScanConfigRequest request) {
* Updates a ScanConfig. This method support partial update of a ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * UpdateScanConfigRequest request =
+ * UpdateScanConfigRequest.newBuilder()
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.updateScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * ScanRun response = webSecurityScannerClient.startScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be used. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -420,6 +680,15 @@ public final ScanRun startScanRun(ScanConfigName name) {
/**
* Start a ScanRun according to the given ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * ScanRun response = webSecurityScannerClient.startScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be used. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -433,6 +702,18 @@ public final ScanRun startScanRun(String name) {
/**
* Start a ScanRun according to the given ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StartScanRunRequest request =
+ * StartScanRunRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ScanRun response = webSecurityScannerClient.startScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -445,6 +726,19 @@ public final ScanRun startScanRun(StartScanRunRequest request) {
* Start a ScanRun according to the given ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StartScanRunRequest request =
+ * StartScanRunRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.startScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * ScanRun response = webSecurityScannerClient.getScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -468,6 +771,15 @@ public final ScanRun getScanRun(ScanRunName name) {
/**
* Gets a ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * ScanRun response = webSecurityScannerClient.getScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -481,6 +793,18 @@ public final ScanRun getScanRun(String name) {
/**
* Gets a ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanRunRequest request =
+ * GetScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ScanRun response = webSecurityScannerClient.getScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -493,6 +817,18 @@ public final ScanRun getScanRun(GetScanRunRequest request) {
* Gets a ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanRunRequest request =
+ * GetScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ApiFuture future = webSecurityScannerClient.getScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan resource name in the
* format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -518,6 +865,17 @@ public final ListScanRunsPagedResponse listScanRuns(ScanConfigName parent) {
/**
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan resource name in the
* format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -531,6 +889,22 @@ public final ListScanRunsPagedResponse listScanRuns(String parent) {
/**
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanRunsRequest request =
+ * ListScanRunsRequest.newBuilder()
+ * .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -543,6 +917,23 @@ public final ListScanRunsPagedResponse listScanRuns(ListScanRunsRequest request)
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanRunsRequest request =
+ * ListScanRunsRequest.newBuilder()
+ * .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ScanRun element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListScanRunsResponse response =
+ * webSecurityScannerClient.listScanRunsCallable().call(request);
+ * for (ScanRun element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * ScanRun response = webSecurityScannerClient.stopScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be stopped. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -577,6 +995,15 @@ public final ScanRun stopScanRun(ScanRunName name) {
/**
* Stops a ScanRun. The stopped ScanRun is returned.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * ScanRun response = webSecurityScannerClient.stopScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be stopped. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -590,6 +1017,18 @@ public final ScanRun stopScanRun(String name) {
/**
* Stops a ScanRun. The stopped ScanRun is returned.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StopScanRunRequest request =
+ * StopScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ScanRun response = webSecurityScannerClient.stopScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -602,6 +1041,19 @@ public final ScanRun stopScanRun(StopScanRunRequest request) {
* Stops a ScanRun. The stopped ScanRun is returned.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StopScanRunRequest request =
+ * StopScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.stopScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -627,6 +1090,17 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(ScanRunName parent) {
/**
* List CrawledUrls under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -640,6 +1114,22 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(String parent) {
/**
* List CrawledUrls under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListCrawledUrlsRequest request =
+ * ListCrawledUrlsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -652,6 +1142,23 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(ListCrawledUrlsRequest
* List CrawledUrls under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListCrawledUrlsRequest request =
+ * ListCrawledUrlsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (CrawledUrl element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListCrawledUrlsResponse response =
+ * webSecurityScannerClient.listCrawledUrlsCallable().call(request);
+ * for (CrawledUrl element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]");
+ * Finding response = webSecurityScannerClient.getFinding(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the Finding to be returned. The name follows the
* format of
* 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
@@ -688,6 +1222,16 @@ public final Finding getFinding(FindingName name) {
/**
* Gets a Finding.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name =
+ * FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]").toString();
+ * Finding response = webSecurityScannerClient.getFinding(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the Finding to be returned. The name follows the
* format of
* 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
@@ -702,6 +1246,20 @@ public final Finding getFinding(String name) {
/**
* Gets a Finding.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetFindingRequest request =
+ * GetFindingRequest.newBuilder()
+ * .setName(
+ * FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]")
+ * .toString())
+ * .build();
+ * Finding response = webSecurityScannerClient.getFinding(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -714,6 +1272,20 @@ public final Finding getFinding(GetFindingRequest request) {
* Gets a Finding.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetFindingRequest request =
+ * GetFindingRequest.newBuilder()
+ * .setName(
+ * FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]")
+ * .toString())
+ * .build();
+ * ApiFuture future = webSecurityScannerClient.getFindingCallable().futureCall(request);
+ * // Do something.
+ * Finding response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * String filter = "filter-1274492040";
+ * for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @param filter Required. The filter expression. The expression must be in the format:
@@ -743,6 +1327,18 @@ public final ListFindingsPagedResponse listFindings(ScanRunName parent, String f
/**
* List Findings under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * String filter = "filter-1274492040";
+ * for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @param filter Required. The filter expression. The expression must be in the format:
@@ -760,6 +1356,23 @@ public final ListFindingsPagedResponse listFindings(String parent, String filter
/**
* List Findings under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingsRequest request =
+ * ListFindingsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (Finding element : webSecurityScannerClient.listFindings(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -772,6 +1385,24 @@ public final ListFindingsPagedResponse listFindings(ListFindingsRequest request)
* List Findings under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingsRequest request =
+ * ListFindingsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listFindingsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Finding element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListFindingsResponse response =
+ * webSecurityScannerClient.listFindingsCallable().call(request);
+ * for (Finding element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -808,6 +1466,15 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(ScanRunName paren
/**
* List all FindingTypeStats under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -822,6 +1489,19 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(String parent) {
/**
* List all FindingTypeStats under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingTypeStatsRequest request =
+ * ListFindingTypeStatsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ListFindingTypeStatsResponse response =
+ * webSecurityScannerClient.listFindingTypeStats(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -835,6 +1515,19 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(
* List all FindingTypeStats under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingTypeStatsRequest request =
+ * ListFindingTypeStatsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request);
+ * // Do something.
+ * ListFindingTypeStatsResponse response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample for WebSecurityScannerClient: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
*/
@Generated("by gapic-generator-java")
package com.google.cloud.websecurityscanner.v1alpha;
diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java
index c768203d..636abdd9 100644
--- a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java
+++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1beta/WebSecurityScannerClient.java
@@ -45,6 +45,14 @@
* This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
+ *
* Note: close() needs to be called on the WebSecurityScannerClient object to clean up resources * such as threads. In the example above, try-with-resources is used, which automatically calls * close(). @@ -152,6 +160,16 @@ public WebSecurityScannerStub getStub() { /** * Creates a new ScanConfig. * + *
Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
@@ -170,6 +188,16 @@ public final ScanConfig createScanConfig(ProjectName parent, ScanConfig scanConf
/**
* Creates a new ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name where the scan is created, which should be a
* project resource name in the format 'projects/{projectId}'.
* @param scanConfig Required. The ScanConfig to be created.
@@ -185,6 +213,19 @@ public final ScanConfig createScanConfig(String parent, ScanConfig scanConfig) {
/**
* Creates a new ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -197,6 +238,20 @@ public final ScanConfig createScanConfig(CreateScanConfigRequest request) {
* Creates a new ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * CreateScanConfigRequest request =
+ * CreateScanConfigRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.createScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * webSecurityScannerClient.deleteScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -220,6 +284,15 @@ public final void deleteScanConfig(ScanConfigName name) {
/**
* Deletes an existing ScanConfig and its child resources.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * webSecurityScannerClient.deleteScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be deleted. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -233,6 +306,18 @@ public final void deleteScanConfig(String name) {
/**
* Deletes an existing ScanConfig and its child resources.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * DeleteScanConfigRequest request =
+ * DeleteScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * webSecurityScannerClient.deleteScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -245,6 +330,19 @@ public final void deleteScanConfig(DeleteScanConfigRequest request) {
* Deletes an existing ScanConfig and its child resources.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * DeleteScanConfigRequest request =
+ * DeleteScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -268,6 +375,15 @@ public final ScanConfig getScanConfig(ScanConfigName name) {
/**
* Gets a ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -281,6 +397,18 @@ public final ScanConfig getScanConfig(String name) {
/**
* Gets a ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanConfigRequest request =
+ * GetScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.getScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -293,6 +421,19 @@ public final ScanConfig getScanConfig(GetScanConfigRequest request) {
* Gets a ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanConfigRequest request =
+ * GetScanConfigRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.getScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a project resource name in
* the format 'projects/{projectId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -318,6 +470,17 @@ public final ListScanConfigsPagedResponse listScanConfigs(ProjectName parent) {
/**
* Lists ScanConfigs under a given project.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ProjectName.of("[PROJECT]").toString();
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a project resource name in
* the format 'projects/{projectId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -331,6 +494,22 @@ public final ListScanConfigsPagedResponse listScanConfigs(String parent) {
/**
* Lists ScanConfigs under a given project.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanConfigsRequest request =
+ * ListScanConfigsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (ScanConfig element : webSecurityScannerClient.listScanConfigs(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -343,6 +522,23 @@ public final ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest
* Lists ScanConfigs under a given project.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanConfigsRequest request =
+ * ListScanConfigsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ScanConfig element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListScanConfigsResponse response =
+ * webSecurityScannerClient.listScanConfigsCallable().call(request);
+ * for (ScanConfig element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.updateScanConfig(scanConfig, updateMask);
+ * }
+ * }
+ *
* @param scanConfig Required. The ScanConfig to be updated. The name field must be set to
* identify the resource to be updated. The values of fields not covered by the mask will be
* ignored.
@@ -385,6 +609,19 @@ public final ScanConfig updateScanConfig(ScanConfig scanConfig, FieldMask update
/**
* Updates a ScanConfig. This method support partial update of a ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * UpdateScanConfigRequest request =
+ * UpdateScanConfigRequest.newBuilder()
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ScanConfig response = webSecurityScannerClient.updateScanConfig(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -397,6 +634,20 @@ public final ScanConfig updateScanConfig(UpdateScanConfigRequest request) {
* Updates a ScanConfig. This method support partial update of a ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * UpdateScanConfigRequest request =
+ * UpdateScanConfigRequest.newBuilder()
+ * .setScanConfig(ScanConfig.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.updateScanConfigCallable().futureCall(request);
+ * // Do something.
+ * ScanConfig response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * ScanRun response = webSecurityScannerClient.startScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be used. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -420,6 +680,15 @@ public final ScanRun startScanRun(ScanConfigName name) {
/**
* Start a ScanRun according to the given ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * ScanRun response = webSecurityScannerClient.startScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanConfig to be used. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -433,6 +702,18 @@ public final ScanRun startScanRun(String name) {
/**
* Start a ScanRun according to the given ScanConfig.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StartScanRunRequest request =
+ * StartScanRunRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ScanRun response = webSecurityScannerClient.startScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -445,6 +726,19 @@ public final ScanRun startScanRun(StartScanRunRequest request) {
* Start a ScanRun according to the given ScanConfig.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StartScanRunRequest request =
+ * StartScanRunRequest.newBuilder()
+ * .setName(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.startScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * ScanRun response = webSecurityScannerClient.getScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -468,6 +771,15 @@ public final ScanRun getScanRun(ScanRunName name) {
/**
* Gets a ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * ScanRun response = webSecurityScannerClient.getScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be returned. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -481,6 +793,18 @@ public final ScanRun getScanRun(String name) {
/**
* Gets a ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanRunRequest request =
+ * GetScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ScanRun response = webSecurityScannerClient.getScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -493,6 +817,18 @@ public final ScanRun getScanRun(GetScanRunRequest request) {
* Gets a ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetScanRunRequest request =
+ * GetScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ApiFuture future = webSecurityScannerClient.getScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanConfigName parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]");
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan resource name in the
* format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -518,6 +865,17 @@ public final ListScanRunsPagedResponse listScanRuns(ScanConfigName parent) {
/**
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString();
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan resource name in the
* format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -531,6 +889,22 @@ public final ListScanRunsPagedResponse listScanRuns(String parent) {
/**
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanRunsRequest request =
+ * ListScanRunsRequest.newBuilder()
+ * .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (ScanRun element : webSecurityScannerClient.listScanRuns(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -543,6 +917,23 @@ public final ListScanRunsPagedResponse listScanRuns(ListScanRunsRequest request)
* Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListScanRunsRequest request =
+ * ListScanRunsRequest.newBuilder()
+ * .setParent(ScanConfigName.of("[PROJECT]", "[SCAN_CONFIG]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ScanRun element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListScanRunsResponse response =
+ * webSecurityScannerClient.listScanRunsCallable().call(request);
+ * for (ScanRun element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * ScanRun response = webSecurityScannerClient.stopScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be stopped. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -577,6 +995,15 @@ public final ScanRun stopScanRun(ScanRunName name) {
/**
* Stops a ScanRun. The stopped ScanRun is returned.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * ScanRun response = webSecurityScannerClient.stopScanRun(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the ScanRun to be stopped. The name follows the
* format of 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -590,6 +1017,18 @@ public final ScanRun stopScanRun(String name) {
/**
* Stops a ScanRun. The stopped ScanRun is returned.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StopScanRunRequest request =
+ * StopScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ScanRun response = webSecurityScannerClient.stopScanRun(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -602,6 +1041,19 @@ public final ScanRun stopScanRun(StopScanRunRequest request) {
* Stops a ScanRun. The stopped ScanRun is returned.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * StopScanRunRequest request =
+ * StopScanRunRequest.newBuilder()
+ * .setName(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.stopScanRunCallable().futureCall(request);
+ * // Do something.
+ * ScanRun response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -627,6 +1090,17 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(ScanRunName parent) {
/**
* List CrawledUrls under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -640,6 +1114,22 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(String parent) {
/**
* List CrawledUrls under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListCrawledUrlsRequest request =
+ * ListCrawledUrlsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (CrawledUrl element : webSecurityScannerClient.listCrawledUrls(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -652,6 +1142,23 @@ public final ListCrawledUrlsPagedResponse listCrawledUrls(ListCrawledUrlsRequest
* List CrawledUrls under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListCrawledUrlsRequest request =
+ * ListCrawledUrlsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (CrawledUrl element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListCrawledUrlsResponse response =
+ * webSecurityScannerClient.listCrawledUrlsCallable().call(request);
+ * for (CrawledUrl element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]");
+ * Finding response = webSecurityScannerClient.getFinding(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the Finding to be returned. The name follows the
* format of
* 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
@@ -688,6 +1222,16 @@ public final Finding getFinding(FindingName name) {
/**
* Gets a Finding.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String name =
+ * FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]").toString();
+ * Finding response = webSecurityScannerClient.getFinding(name);
+ * }
+ * }
+ *
* @param name Required. The resource name of the Finding to be returned. The name follows the
* format of
* 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
@@ -702,6 +1246,20 @@ public final Finding getFinding(String name) {
/**
* Gets a Finding.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetFindingRequest request =
+ * GetFindingRequest.newBuilder()
+ * .setName(
+ * FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]")
+ * .toString())
+ * .build();
+ * Finding response = webSecurityScannerClient.getFinding(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -714,6 +1272,20 @@ public final Finding getFinding(GetFindingRequest request) {
* Gets a Finding.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * GetFindingRequest request =
+ * GetFindingRequest.newBuilder()
+ * .setName(
+ * FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]")
+ * .toString())
+ * .build();
+ * ApiFuture future = webSecurityScannerClient.getFindingCallable().futureCall(request);
+ * // Do something.
+ * Finding response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * String filter = "filter-1274492040";
+ * for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @param filter Required. The filter expression. The expression must be in the format:
@@ -743,6 +1327,18 @@ public final ListFindingsPagedResponse listFindings(ScanRunName parent, String f
/**
* List Findings under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * String filter = "filter-1274492040";
+ * for (Finding element : webSecurityScannerClient.listFindings(parent, filter).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @param filter Required. The filter expression. The expression must be in the format:
@@ -760,6 +1356,23 @@ public final ListFindingsPagedResponse listFindings(String parent, String filter
/**
* List Findings under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingsRequest request =
+ * ListFindingsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * for (Finding element : webSecurityScannerClient.listFindings(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -772,6 +1385,24 @@ public final ListFindingsPagedResponse listFindings(ListFindingsRequest request)
* List Findings under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingsRequest request =
+ * ListFindingsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .setFilter("filter-1274492040")
+ * .setPageToken("pageToken873572522")
+ * .setPageSize(883849137)
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listFindingsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Finding element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * while (true) {
+ * ListFindingsResponse response =
+ * webSecurityScannerClient.listFindingsCallable().call(request);
+ * for (Finding element : response.getResponsesList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
*/
public final UnaryCallableSample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ScanRunName parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]");
+ * ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -808,6 +1466,15 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(ScanRunName paren
/**
* List all FindingTypeStats under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * String parent = ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString();
+ * ListFindingTypeStatsResponse response = webSecurityScannerClient.listFindingTypeStats(parent);
+ * }
+ * }
+ *
* @param parent Required. The parent resource name, which should be a scan run resource name in
* the format 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
@@ -822,6 +1489,19 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(String parent) {
/**
* List all FindingTypeStats under a given ScanRun.
*
+ * Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingTypeStatsRequest request =
+ * ListFindingTypeStatsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ListFindingTypeStatsResponse response =
+ * webSecurityScannerClient.listFindingTypeStats(request);
+ * }
+ * }
+ *
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
@@ -835,6 +1515,19 @@ public final ListFindingTypeStatsResponse listFindingTypeStats(
* List all FindingTypeStats under a given ScanRun.
*
* Sample code: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ListFindingTypeStatsRequest request =
+ * ListFindingTypeStatsRequest.newBuilder()
+ * .setParent(ScanRunName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]").toString())
+ * .build();
+ * ApiFuture future =
+ * webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request);
+ * // Do something.
+ * ListFindingTypeStatsResponse response = future.get();
+ * }
+ * }
*/
public final UnaryCallableSample for WebSecurityScannerClient: + * + *
{@code
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ * ProjectName parent = ProjectName.of("[PROJECT]");
+ * ScanConfig scanConfig = ScanConfig.newBuilder().build();
+ * ScanConfig response = webSecurityScannerClient.createScanConfig(parent, scanConfig);
+ * }
+ * }
*/
@Generated("by gapic-generator-java")
package com.google.cloud.websecurityscanner.v1beta;
diff --git a/synth.metadata b/synth.metadata
index cf75aafb..e73313c8 100644
--- a/synth.metadata
+++ b/synth.metadata
@@ -11,24 +11,24 @@
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
- "internalRef": "350949863"
+ "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
+ "internalRef": "356341083"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
- "internalRef": "350949863"
+ "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
+ "internalRef": "356341083"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
- "sha": "91e206bcfeaf8948ea03fe3cb1b7616108496cd3",
- "internalRef": "350949863"
+ "sha": "8d8c008e56f1af31d57f75561e0f1848ffb29eeb",
+ "internalRef": "356341083"
}
},
{
From a222e64feb7f200b0ca253a4d75fe317cd65ac97 Mon Sep 17 00:00:00 2001
From: WhiteSource Renovate