@Generated(value="by gapic-generator-java") public class WebSecurityScannerClient extends Object implements com.google.api.gax.core.BackgroundResource
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:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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().
| Method | Description | Method Variants |
|---|---|---|
CreateScanConfig |
Creates a new ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteScanConfig |
Deletes an existing ScanConfig and its child resources. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetScanConfig |
Gets a ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListScanConfigs |
Lists ScanConfigs under a given project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateScanConfig |
Updates a ScanConfig. This method support partial update of a ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StartScanRun |
Start a ScanRun according to the given ScanConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetScanRun |
Gets a ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListScanRuns |
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
StopScanRun |
Stops a ScanRun. The stopped ScanRun is returned. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListCrawledUrls |
List CrawledUrls under a given ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetFinding |
Gets a Finding. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListFindings |
List Findings under a given ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListFindingTypeStats |
List all FindingTypeStats under a given ScanRun. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of WebSecurityScannerSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newBuilder().setEndpoint(myEndpoint).build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
WebSecurityScannerSettings webSecurityScannerSettings =
WebSecurityScannerSettings.newHttpJsonBuilder().build();
WebSecurityScannerClient webSecurityScannerClient =
WebSecurityScannerClient.create(webSecurityScannerSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
WebSecurityScannerClient.ListCrawledUrlsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListCrawledUrlsPage |
static class |
WebSecurityScannerClient.ListCrawledUrlsPagedResponse |
static class |
WebSecurityScannerClient.ListFindingsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListFindingsPage |
static class |
WebSecurityScannerClient.ListFindingsPagedResponse |
static class |
WebSecurityScannerClient.ListScanConfigsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListScanConfigsPage |
static class |
WebSecurityScannerClient.ListScanConfigsPagedResponse |
static class |
WebSecurityScannerClient.ListScanRunsFixedSizeCollection |
static class |
WebSecurityScannerClient.ListScanRunsPage |
static class |
WebSecurityScannerClient.ListScanRunsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
WebSecurityScannerClient(WebSecurityScannerSettings settings)
Constructs an instance of WebSecurityScannerClient, using the given settings.
|
protected |
WebSecurityScannerClient(WebSecurityScannerStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static WebSecurityScannerClient |
create()
Constructs an instance of WebSecurityScannerClient with default settings.
|
static WebSecurityScannerClient |
create(WebSecurityScannerSettings settings)
Constructs an instance of WebSecurityScannerClient, using the given settings.
|
static WebSecurityScannerClient |
create(WebSecurityScannerStub stub)
Constructs an instance of WebSecurityScannerClient, using the given stub for making calls.
|
ScanConfig |
createScanConfig(CreateScanConfigRequest request)
Creates a new ScanConfig.
|
com.google.api.gax.rpc.UnaryCallable<CreateScanConfigRequest,ScanConfig> |
createScanConfigCallable()
Creates a new ScanConfig.
|
void |
deleteScanConfig(DeleteScanConfigRequest request)
Deletes an existing ScanConfig and its child resources.
|
com.google.api.gax.rpc.UnaryCallable<DeleteScanConfigRequest,com.google.protobuf.Empty> |
deleteScanConfigCallable()
Deletes an existing ScanConfig and its child resources.
|
Finding |
getFinding(GetFindingRequest request)
Gets a Finding.
|
com.google.api.gax.rpc.UnaryCallable<GetFindingRequest,Finding> |
getFindingCallable()
Gets a Finding.
|
ScanConfig |
getScanConfig(GetScanConfigRequest request)
Gets a ScanConfig.
|
com.google.api.gax.rpc.UnaryCallable<GetScanConfigRequest,ScanConfig> |
getScanConfigCallable()
Gets a ScanConfig.
|
ScanRun |
getScanRun(GetScanRunRequest request)
Gets a ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<GetScanRunRequest,ScanRun> |
getScanRunCallable()
Gets a ScanRun.
|
WebSecurityScannerSettings |
getSettings() |
WebSecurityScannerStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
WebSecurityScannerClient.ListCrawledUrlsPagedResponse |
listCrawledUrls(ListCrawledUrlsRequest request)
List CrawledUrls under a given ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<ListCrawledUrlsRequest,ListCrawledUrlsResponse> |
listCrawledUrlsCallable()
List CrawledUrls under a given ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<ListCrawledUrlsRequest,WebSecurityScannerClient.ListCrawledUrlsPagedResponse> |
listCrawledUrlsPagedCallable()
List CrawledUrls under a given ScanRun.
|
WebSecurityScannerClient.ListFindingsPagedResponse |
listFindings(ListFindingsRequest request)
List Findings under a given ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<ListFindingsRequest,ListFindingsResponse> |
listFindingsCallable()
List Findings under a given ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<ListFindingsRequest,WebSecurityScannerClient.ListFindingsPagedResponse> |
listFindingsPagedCallable()
List Findings under a given ScanRun.
|
ListFindingTypeStatsResponse |
listFindingTypeStats(ListFindingTypeStatsRequest request)
List all FindingTypeStats under a given ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<ListFindingTypeStatsRequest,ListFindingTypeStatsResponse> |
listFindingTypeStatsCallable()
List all FindingTypeStats under a given ScanRun.
|
WebSecurityScannerClient.ListScanConfigsPagedResponse |
listScanConfigs(ListScanConfigsRequest request)
Lists ScanConfigs under a given project.
|
com.google.api.gax.rpc.UnaryCallable<ListScanConfigsRequest,ListScanConfigsResponse> |
listScanConfigsCallable()
Lists ScanConfigs under a given project.
|
com.google.api.gax.rpc.UnaryCallable<ListScanConfigsRequest,WebSecurityScannerClient.ListScanConfigsPagedResponse> |
listScanConfigsPagedCallable()
Lists ScanConfigs under a given project.
|
WebSecurityScannerClient.ListScanRunsPagedResponse |
listScanRuns(ListScanRunsRequest request)
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
com.google.api.gax.rpc.UnaryCallable<ListScanRunsRequest,ListScanRunsResponse> |
listScanRunsCallable()
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
com.google.api.gax.rpc.UnaryCallable<ListScanRunsRequest,WebSecurityScannerClient.ListScanRunsPagedResponse> |
listScanRunsPagedCallable()
Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time.
|
void |
shutdown() |
void |
shutdownNow() |
ScanRun |
startScanRun(StartScanRunRequest request)
Start a ScanRun according to the given ScanConfig.
|
com.google.api.gax.rpc.UnaryCallable<StartScanRunRequest,ScanRun> |
startScanRunCallable()
Start a ScanRun according to the given ScanConfig.
|
ScanRun |
stopScanRun(StopScanRunRequest request)
Stops a ScanRun.
|
com.google.api.gax.rpc.UnaryCallable<StopScanRunRequest,ScanRun> |
stopScanRunCallable()
Stops a ScanRun.
|
ScanConfig |
updateScanConfig(UpdateScanConfigRequest request)
Updates a ScanConfig.
|
com.google.api.gax.rpc.UnaryCallable<UpdateScanConfigRequest,ScanConfig> |
updateScanConfigCallable()
Updates a ScanConfig.
|
protected WebSecurityScannerClient(WebSecurityScannerSettings settings) throws IOException
IOExceptionprotected WebSecurityScannerClient(WebSecurityScannerStub stub)
public static final WebSecurityScannerClient create() throws IOException
IOExceptionpublic static final WebSecurityScannerClient create(WebSecurityScannerSettings settings) throws IOException
IOExceptionpublic static final WebSecurityScannerClient create(WebSecurityScannerStub stub)
public final WebSecurityScannerSettings getSettings()
public WebSecurityScannerStub getStub()
public final ScanConfig createScanConfig(CreateScanConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder()
.setParent("parent-995424086")
.setScanConfig(ScanConfig.newBuilder().build())
.build();
ScanConfig response = webSecurityScannerClient.createScanConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateScanConfigRequest,ScanConfig> createScanConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
CreateScanConfigRequest request =
CreateScanConfigRequest.newBuilder()
.setParent("parent-995424086")
.setScanConfig(ScanConfig.newBuilder().build())
.build();
ApiFuture<ScanConfig> future =
webSecurityScannerClient.createScanConfigCallable().futureCall(request);
// Do something.
ScanConfig response = future.get();
}
public final void deleteScanConfig(DeleteScanConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
DeleteScanConfigRequest request =
DeleteScanConfigRequest.newBuilder().setName("name3373707").build();
webSecurityScannerClient.deleteScanConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteScanConfigRequest,com.google.protobuf.Empty> deleteScanConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
DeleteScanConfigRequest request =
DeleteScanConfigRequest.newBuilder().setName("name3373707").build();
ApiFuture<Empty> future =
webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
// Do something.
future.get();
}
public final ScanConfig getScanConfig(GetScanConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
GetScanConfigRequest request =
GetScanConfigRequest.newBuilder().setName("name3373707").build();
ScanConfig response = webSecurityScannerClient.getScanConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetScanConfigRequest,ScanConfig> getScanConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
GetScanConfigRequest request =
GetScanConfigRequest.newBuilder().setName("name3373707").build();
ApiFuture<ScanConfig> future =
webSecurityScannerClient.getScanConfigCallable().futureCall(request);
// Do something.
ScanConfig response = future.get();
}
public final WebSecurityScannerClient.ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListScanConfigsRequest,WebSecurityScannerClient.ListScanConfigsPagedResponse> listScanConfigsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListScanConfigsRequest request =
ListScanConfigsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<ScanConfig> future =
webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request);
// Do something.
for (ScanConfig element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListScanConfigsRequest,ListScanConfigsResponse> listScanConfigsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListScanConfigsRequest request =
ListScanConfigsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListScanConfigsResponse response =
webSecurityScannerClient.listScanConfigsCallable().call(request);
for (ScanConfig element : response.getScanConfigsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ScanConfig updateScanConfig(UpdateScanConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
UpdateScanConfigRequest request =
UpdateScanConfigRequest.newBuilder()
.setScanConfig(ScanConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ScanConfig response = webSecurityScannerClient.updateScanConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateScanConfigRequest,ScanConfig> updateScanConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
UpdateScanConfigRequest request =
UpdateScanConfigRequest.newBuilder()
.setScanConfig(ScanConfig.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<ScanConfig> future =
webSecurityScannerClient.updateScanConfigCallable().futureCall(request);
// Do something.
ScanConfig response = future.get();
}
public final ScanRun startScanRun(StartScanRunRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
StartScanRunRequest request = StartScanRunRequest.newBuilder().setName("name3373707").build();
ScanRun response = webSecurityScannerClient.startScanRun(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<StartScanRunRequest,ScanRun> startScanRunCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
StartScanRunRequest request = StartScanRunRequest.newBuilder().setName("name3373707").build();
ApiFuture<ScanRun> future =
webSecurityScannerClient.startScanRunCallable().futureCall(request);
// Do something.
ScanRun response = future.get();
}
public final ScanRun getScanRun(GetScanRunRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
GetScanRunRequest request = GetScanRunRequest.newBuilder().setName("name3373707").build();
ScanRun response = webSecurityScannerClient.getScanRun(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetScanRunRequest,ScanRun> getScanRunCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
GetScanRunRequest request = GetScanRunRequest.newBuilder().setName("name3373707").build();
ApiFuture<ScanRun> future = webSecurityScannerClient.getScanRunCallable().futureCall(request);
// Do something.
ScanRun response = future.get();
}
public final WebSecurityScannerClient.ListScanRunsPagedResponse listScanRuns(ListScanRunsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListScanRunsRequest,WebSecurityScannerClient.ListScanRunsPagedResponse> listScanRunsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListScanRunsRequest request =
ListScanRunsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<ScanRun> future =
webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request);
// Do something.
for (ScanRun element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListScanRunsRequest,ListScanRunsResponse> listScanRunsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListScanRunsRequest request =
ListScanRunsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListScanRunsResponse response =
webSecurityScannerClient.listScanRunsCallable().call(request);
for (ScanRun element : response.getScanRunsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ScanRun stopScanRun(StopScanRunRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
StopScanRunRequest request = StopScanRunRequest.newBuilder().setName("name3373707").build();
ScanRun response = webSecurityScannerClient.stopScanRun(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<StopScanRunRequest,ScanRun> stopScanRunCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
StopScanRunRequest request = StopScanRunRequest.newBuilder().setName("name3373707").build();
ApiFuture<ScanRun> future =
webSecurityScannerClient.stopScanRunCallable().futureCall(request);
// Do something.
ScanRun response = future.get();
}
public final WebSecurityScannerClient.ListCrawledUrlsPagedResponse listCrawledUrls(ListCrawledUrlsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListCrawledUrlsRequest,WebSecurityScannerClient.ListCrawledUrlsPagedResponse> listCrawledUrlsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListCrawledUrlsRequest request =
ListCrawledUrlsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<CrawledUrl> future =
webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request);
// Do something.
for (CrawledUrl element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListCrawledUrlsRequest,ListCrawledUrlsResponse> listCrawledUrlsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListCrawledUrlsRequest request =
ListCrawledUrlsRequest.newBuilder()
.setParent("parent-995424086")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListCrawledUrlsResponse response =
webSecurityScannerClient.listCrawledUrlsCallable().call(request);
for (CrawledUrl element : response.getCrawledUrlsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Finding getFinding(GetFindingRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
GetFindingRequest request = GetFindingRequest.newBuilder().setName("name3373707").build();
Finding response = webSecurityScannerClient.getFinding(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetFindingRequest,Finding> getFindingCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
GetFindingRequest request = GetFindingRequest.newBuilder().setName("name3373707").build();
ApiFuture<Finding> future = webSecurityScannerClient.getFindingCallable().futureCall(request);
// Do something.
Finding response = future.get();
}
public final WebSecurityScannerClient.ListFindingsPagedResponse listFindings(ListFindingsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
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);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListFindingsRequest,WebSecurityScannerClient.ListFindingsPagedResponse> listFindingsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent("parent-995424086")
.setFilter("filter-1274492040")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
ApiFuture<Finding> future =
webSecurityScannerClient.listFindingsPagedCallable().futureCall(request);
// Do something.
for (Finding element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListFindingsRequest,ListFindingsResponse> listFindingsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListFindingsRequest request =
ListFindingsRequest.newBuilder()
.setParent("parent-995424086")
.setFilter("filter-1274492040")
.setPageToken("pageToken873572522")
.setPageSize(883849137)
.build();
while (true) {
ListFindingsResponse response =
webSecurityScannerClient.listFindingsCallable().call(request);
for (Finding element : response.getFindingsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ListFindingTypeStatsResponse listFindingTypeStats(ListFindingTypeStatsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListFindingTypeStatsRequest request =
ListFindingTypeStatsRequest.newBuilder().setParent("parent-995424086").build();
ListFindingTypeStatsResponse response =
webSecurityScannerClient.listFindingTypeStats(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListFindingTypeStatsRequest,ListFindingTypeStatsResponse> listFindingTypeStatsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
ListFindingTypeStatsRequest request =
ListFindingTypeStatsRequest.newBuilder().setParent("parent-995424086").build();
ApiFuture<ListFindingTypeStatsResponse> future =
webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request);
// Do something.
ListFindingTypeStatsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.