diff --git a/google-cloud-websecurityscanner-bom/pom.xml b/google-cloud-websecurityscanner-bom/pom.xml index 680582a6..7a8ea63b 100644 --- a/google-cloud-websecurityscanner-bom/pom.xml +++ b/google-cloud-websecurityscanner-bom/pom.xml @@ -73,14 +73,24 @@ com.google.api.grpc - grpc-google-cloud-websecurityscanner-v1beta - 0.81.4-SNAPSHOT + proto-google-cloud-websecurityscanner-v1 + 0.81.4-SNAPSHOT com.google.api.grpc proto-google-cloud-websecurityscanner-v1alpha 0.81.4-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-websecurityscanner-v1beta + 0.81.4-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-websecurityscanner-v1 + 0.81.4-SNAPSHOT + com.google.cloud google-cloud-websecurityscanner diff --git a/google-cloud-websecurityscanner/pom.xml b/google-cloud-websecurityscanner/pom.xml index 02942dee..f3a3a9f7 100644 --- a/google-cloud-websecurityscanner/pom.xml +++ b/google-cloud-websecurityscanner/pom.xml @@ -42,13 +42,17 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-websecurityscanner-v1alpha + com.google.api.grpc proto-google-cloud-websecurityscanner-v1beta com.google.api.grpc - proto-google-cloud-websecurityscanner-v1alpha + proto-google-cloud-websecurityscanner-v1 com.google.guava @@ -94,6 +98,11 @@ grpc-google-cloud-websecurityscanner-v1beta test + + com.google.api.grpc + grpc-google-cloud-websecurityscanner-v1 + test + com.google.api diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerClient.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerClient.java new file mode 100644 index 00000000..1582f7c5 --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerClient.java @@ -0,0 +1,1156 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.websecurityscanner.v1.stub.WebSecurityScannerStub; +import com.google.cloud.websecurityscanner.v1.stub.WebSecurityScannerStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Web Security Scanner Service identifies security vulnerabilities in web + * applications hosted on Google Cloud. It crawls your application, and attempts to exercise as many + * user inputs and event handlers as possible. + * + *

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: + * + *

+ * 
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ *   CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder().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(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns 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: + * + *

+ * 
+ * WebSecurityScannerSettings webSecurityScannerSettings =
+ *     WebSecurityScannerSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * WebSecurityScannerClient webSecurityScannerClient =
+ *     WebSecurityScannerClient.create(webSecurityScannerSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * WebSecurityScannerSettings webSecurityScannerSettings =
+ *     WebSecurityScannerSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * WebSecurityScannerClient webSecurityScannerClient =
+ *     WebSecurityScannerClient.create(webSecurityScannerSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class WebSecurityScannerClient implements BackgroundResource { + private final WebSecurityScannerSettings settings; + private final WebSecurityScannerStub stub; + + /** Constructs an instance of WebSecurityScannerClient with default settings. */ + public static final WebSecurityScannerClient create() throws IOException { + return create(WebSecurityScannerSettings.newBuilder().build()); + } + + /** + * Constructs an instance of WebSecurityScannerClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final WebSecurityScannerClient create(WebSecurityScannerSettings settings) + throws IOException { + return new WebSecurityScannerClient(settings); + } + + /** + * Constructs an instance of WebSecurityScannerClient, using the given stub for making calls. This + * is for advanced usage - prefer to use WebSecurityScannerSettings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final WebSecurityScannerClient create(WebSecurityScannerStub stub) { + return new WebSecurityScannerClient(stub); + } + + /** + * Constructs an instance of WebSecurityScannerClient, using the given settings. This is protected + * so that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected WebSecurityScannerClient(WebSecurityScannerSettings settings) throws IOException { + this.settings = settings; + this.stub = ((WebSecurityScannerStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected WebSecurityScannerClient(WebSecurityScannerStub stub) { + this.settings = null; + this.stub = stub; + } + + public final WebSecurityScannerSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public WebSecurityScannerStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder().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 + */ + public final ScanConfig createScanConfig(CreateScanConfigRequest request) { + return createScanConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder().build();
+   *   ApiFuture<ScanConfig> future = webSecurityScannerClient.createScanConfigCallable().futureCall(request);
+   *   // Do something
+   *   ScanConfig response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createScanConfigCallable() { + return stub.createScanConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing ScanConfig and its child resources. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder().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 + */ + public final void deleteScanConfig(DeleteScanConfigRequest request) { + deleteScanConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes an existing ScanConfig and its child resources. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder().build();
+   *   ApiFuture<Void> future = webSecurityScannerClient.deleteScanConfigCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteScanConfigCallable() { + return stub.deleteScanConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   GetScanConfigRequest request = GetScanConfigRequest.newBuilder().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 + */ + public final ScanConfig getScanConfig(GetScanConfigRequest request) { + return getScanConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   GetScanConfigRequest request = GetScanConfigRequest.newBuilder().build();
+   *   ApiFuture<ScanConfig> future = webSecurityScannerClient.getScanConfigCallable().futureCall(request);
+   *   // Do something
+   *   ScanConfig response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getScanConfigCallable() { + return stub.getScanConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScanConfigs under a given project. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder().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 + */ + public final ListScanConfigsPagedResponse listScanConfigs(ListScanConfigsRequest request) { + return listScanConfigsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScanConfigs under a given project. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder().build();
+   *   ApiFuture<ListScanConfigsPagedResponse> future = webSecurityScannerClient.listScanConfigsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ScanConfig element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listScanConfigsPagedCallable() { + return stub.listScanConfigsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScanConfigs under a given project. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder().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 UnaryCallable + listScanConfigsCallable() { + return stub.listScanConfigsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a ScanConfig. This method support partial update of a ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder().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 + */ + public final ScanConfig updateScanConfig(UpdateScanConfigRequest request) { + return updateScanConfigCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates a ScanConfig. This method support partial update of a ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder().build();
+   *   ApiFuture<ScanConfig> future = webSecurityScannerClient.updateScanConfigCallable().futureCall(request);
+   *   // Do something
+   *   ScanConfig response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateScanConfigCallable() { + return stub.updateScanConfigCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Start a ScanRun according to the given ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   StartScanRunRequest request = StartScanRunRequest.newBuilder().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 + */ + public final ScanRun startScanRun(StartScanRunRequest request) { + return startScanRunCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Start a ScanRun according to the given ScanConfig. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   StartScanRunRequest request = StartScanRunRequest.newBuilder().build();
+   *   ApiFuture<ScanRun> future = webSecurityScannerClient.startScanRunCallable().futureCall(request);
+   *   // Do something
+   *   ScanRun response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable startScanRunCallable() { + return stub.startScanRunCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   GetScanRunRequest request = GetScanRunRequest.newBuilder().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 + */ + public final ScanRun getScanRun(GetScanRunRequest request) { + return getScanRunCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   GetScanRunRequest request = GetScanRunRequest.newBuilder().build();
+   *   ApiFuture<ScanRun> future = webSecurityScannerClient.getScanRunCallable().futureCall(request);
+   *   // Do something
+   *   ScanRun response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getScanRunCallable() { + return stub.getScanRunCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListScanRunsRequest request = ListScanRunsRequest.newBuilder().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 + */ + public final ListScanRunsPagedResponse listScanRuns(ListScanRunsRequest request) { + return listScanRunsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListScanRunsRequest request = ListScanRunsRequest.newBuilder().build();
+   *   ApiFuture<ListScanRunsPagedResponse> future = webSecurityScannerClient.listScanRunsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (ScanRun element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listScanRunsPagedCallable() { + return stub.listScanRunsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun stop time. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListScanRunsRequest request = ListScanRunsRequest.newBuilder().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 UnaryCallable listScanRunsCallable() { + return stub.listScanRunsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Stops a ScanRun. The stopped ScanRun is returned. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   StopScanRunRequest request = StopScanRunRequest.newBuilder().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 + */ + public final ScanRun stopScanRun(StopScanRunRequest request) { + return stopScanRunCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Stops a ScanRun. The stopped ScanRun is returned. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   StopScanRunRequest request = StopScanRunRequest.newBuilder().build();
+   *   ApiFuture<ScanRun> future = webSecurityScannerClient.stopScanRunCallable().futureCall(request);
+   *   // Do something
+   *   ScanRun response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable stopScanRunCallable() { + return stub.stopScanRunCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List CrawledUrls under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder().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 + */ + public final ListCrawledUrlsPagedResponse listCrawledUrls(ListCrawledUrlsRequest request) { + return listCrawledUrlsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List CrawledUrls under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder().build();
+   *   ApiFuture<ListCrawledUrlsPagedResponse> future = webSecurityScannerClient.listCrawledUrlsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (CrawledUrl element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listCrawledUrlsPagedCallable() { + return stub.listCrawledUrlsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List CrawledUrls under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder().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 UnaryCallable + listCrawledUrlsCallable() { + return stub.listCrawledUrlsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a Finding. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   GetFindingRequest request = GetFindingRequest.newBuilder().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 + */ + public final Finding getFinding(GetFindingRequest request) { + return getFindingCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Gets a Finding. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   GetFindingRequest request = GetFindingRequest.newBuilder().build();
+   *   ApiFuture<Finding> future = webSecurityScannerClient.getFindingCallable().futureCall(request);
+   *   // Do something
+   *   Finding response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getFindingCallable() { + return stub.getFindingCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List Findings under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListFindingsRequest request = ListFindingsRequest.newBuilder().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 + */ + public final ListFindingsPagedResponse listFindings(ListFindingsRequest request) { + return listFindingsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List Findings under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListFindingsRequest request = ListFindingsRequest.newBuilder().build();
+   *   ApiFuture<ListFindingsPagedResponse> future = webSecurityScannerClient.listFindingsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Finding element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable + listFindingsPagedCallable() { + return stub.listFindingsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List Findings under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListFindingsRequest request = ListFindingsRequest.newBuilder().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 UnaryCallable listFindingsCallable() { + return stub.listFindingsCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all FindingTypeStats under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder().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 + */ + public final ListFindingTypeStatsResponse listFindingTypeStats( + ListFindingTypeStatsRequest request) { + return listFindingTypeStatsCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * List all FindingTypeStats under a given ScanRun. + * + *

Sample code: + * + *


+   * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+   *   ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder().build();
+   *   ApiFuture<ListFindingTypeStatsResponse> future = webSecurityScannerClient.listFindingTypeStatsCallable().futureCall(request);
+   *   // Do something
+   *   ListFindingTypeStatsResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + listFindingTypeStatsCallable() { + return stub.listFindingTypeStatsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListScanConfigsPagedResponse + extends AbstractPagedListResponse< + ListScanConfigsRequest, + ListScanConfigsResponse, + ScanConfig, + ListScanConfigsPage, + ListScanConfigsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListScanConfigsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListScanConfigsPagedResponse apply(ListScanConfigsPage input) { + return new ListScanConfigsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListScanConfigsPagedResponse(ListScanConfigsPage page) { + super(page, ListScanConfigsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListScanConfigsPage + extends AbstractPage< + ListScanConfigsRequest, ListScanConfigsResponse, ScanConfig, ListScanConfigsPage> { + + private ListScanConfigsPage( + PageContext context, + ListScanConfigsResponse response) { + super(context, response); + } + + private static ListScanConfigsPage createEmptyPage() { + return new ListScanConfigsPage(null, null); + } + + @Override + protected ListScanConfigsPage createPage( + PageContext context, + ListScanConfigsResponse response) { + return new ListScanConfigsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListScanConfigsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListScanConfigsRequest, + ListScanConfigsResponse, + ScanConfig, + ListScanConfigsPage, + ListScanConfigsFixedSizeCollection> { + + private ListScanConfigsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListScanConfigsFixedSizeCollection createEmptyCollection() { + return new ListScanConfigsFixedSizeCollection(null, 0); + } + + @Override + protected ListScanConfigsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListScanConfigsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListScanRunsPagedResponse + extends AbstractPagedListResponse< + ListScanRunsRequest, + ListScanRunsResponse, + ScanRun, + ListScanRunsPage, + ListScanRunsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListScanRunsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListScanRunsPagedResponse apply(ListScanRunsPage input) { + return new ListScanRunsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListScanRunsPagedResponse(ListScanRunsPage page) { + super(page, ListScanRunsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListScanRunsPage + extends AbstractPage { + + private ListScanRunsPage( + PageContext context, + ListScanRunsResponse response) { + super(context, response); + } + + private static ListScanRunsPage createEmptyPage() { + return new ListScanRunsPage(null, null); + } + + @Override + protected ListScanRunsPage createPage( + PageContext context, + ListScanRunsResponse response) { + return new ListScanRunsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListScanRunsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListScanRunsRequest, + ListScanRunsResponse, + ScanRun, + ListScanRunsPage, + ListScanRunsFixedSizeCollection> { + + private ListScanRunsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListScanRunsFixedSizeCollection createEmptyCollection() { + return new ListScanRunsFixedSizeCollection(null, 0); + } + + @Override + protected ListScanRunsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListScanRunsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListCrawledUrlsPagedResponse + extends AbstractPagedListResponse< + ListCrawledUrlsRequest, + ListCrawledUrlsResponse, + CrawledUrl, + ListCrawledUrlsPage, + ListCrawledUrlsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListCrawledUrlsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListCrawledUrlsPagedResponse apply(ListCrawledUrlsPage input) { + return new ListCrawledUrlsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListCrawledUrlsPagedResponse(ListCrawledUrlsPage page) { + super(page, ListCrawledUrlsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListCrawledUrlsPage + extends AbstractPage< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, CrawledUrl, ListCrawledUrlsPage> { + + private ListCrawledUrlsPage( + PageContext context, + ListCrawledUrlsResponse response) { + super(context, response); + } + + private static ListCrawledUrlsPage createEmptyPage() { + return new ListCrawledUrlsPage(null, null); + } + + @Override + protected ListCrawledUrlsPage createPage( + PageContext context, + ListCrawledUrlsResponse response) { + return new ListCrawledUrlsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListCrawledUrlsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListCrawledUrlsRequest, + ListCrawledUrlsResponse, + CrawledUrl, + ListCrawledUrlsPage, + ListCrawledUrlsFixedSizeCollection> { + + private ListCrawledUrlsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListCrawledUrlsFixedSizeCollection createEmptyCollection() { + return new ListCrawledUrlsFixedSizeCollection(null, 0); + } + + @Override + protected ListCrawledUrlsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListCrawledUrlsFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListFindingsPagedResponse + extends AbstractPagedListResponse< + ListFindingsRequest, + ListFindingsResponse, + Finding, + ListFindingsPage, + ListFindingsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListFindingsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListFindingsPagedResponse apply(ListFindingsPage input) { + return new ListFindingsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListFindingsPagedResponse(ListFindingsPage page) { + super(page, ListFindingsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListFindingsPage + extends AbstractPage { + + private ListFindingsPage( + PageContext context, + ListFindingsResponse response) { + super(context, response); + } + + private static ListFindingsPage createEmptyPage() { + return new ListFindingsPage(null, null); + } + + @Override + protected ListFindingsPage createPage( + PageContext context, + ListFindingsResponse response) { + return new ListFindingsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListFindingsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListFindingsRequest, + ListFindingsResponse, + Finding, + ListFindingsPage, + ListFindingsFixedSizeCollection> { + + private ListFindingsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListFindingsFixedSizeCollection createEmptyCollection() { + return new ListFindingsFixedSizeCollection(null, 0); + } + + @Override + protected ListFindingsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListFindingsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerSettings.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerSettings.java new file mode 100644 index 00000000..01e6c68f --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerSettings.java @@ -0,0 +1,325 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1; + +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListCrawledUrlsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListFindingsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanConfigsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanRunsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.websecurityscanner.v1.stub.WebSecurityScannerStubSettings; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link WebSecurityScannerClient}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (websecurityscanner.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createScanConfig to 30 seconds: + * + *

+ * 
+ * WebSecurityScannerSettings.Builder webSecurityScannerSettingsBuilder =
+ *     WebSecurityScannerSettings.newBuilder();
+ * webSecurityScannerSettingsBuilder
+ *     .createScanConfigSettings()
+ *     .setRetrySettings(
+ *         webSecurityScannerSettingsBuilder.createScanConfigSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WebSecurityScannerSettings webSecurityScannerSettings = webSecurityScannerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class WebSecurityScannerSettings extends ClientSettings { + /** Returns the object with the settings used for calls to createScanConfig. */ + public UnaryCallSettings createScanConfigSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).createScanConfigSettings(); + } + + /** Returns the object with the settings used for calls to deleteScanConfig. */ + public UnaryCallSettings deleteScanConfigSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).deleteScanConfigSettings(); + } + + /** Returns the object with the settings used for calls to getScanConfig. */ + public UnaryCallSettings getScanConfigSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).getScanConfigSettings(); + } + + /** Returns the object with the settings used for calls to listScanConfigs. */ + public PagedCallSettings< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).listScanConfigsSettings(); + } + + /** Returns the object with the settings used for calls to updateScanConfig. */ + public UnaryCallSettings updateScanConfigSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).updateScanConfigSettings(); + } + + /** Returns the object with the settings used for calls to startScanRun. */ + public UnaryCallSettings startScanRunSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).startScanRunSettings(); + } + + /** Returns the object with the settings used for calls to getScanRun. */ + public UnaryCallSettings getScanRunSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).getScanRunSettings(); + } + + /** Returns the object with the settings used for calls to listScanRuns. */ + public PagedCallSettings + listScanRunsSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).listScanRunsSettings(); + } + + /** Returns the object with the settings used for calls to stopScanRun. */ + public UnaryCallSettings stopScanRunSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).stopScanRunSettings(); + } + + /** Returns the object with the settings used for calls to listCrawledUrls. */ + public PagedCallSettings< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + listCrawledUrlsSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).listCrawledUrlsSettings(); + } + + /** Returns the object with the settings used for calls to getFinding. */ + public UnaryCallSettings getFindingSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).getFindingSettings(); + } + + /** Returns the object with the settings used for calls to listFindings. */ + public PagedCallSettings + listFindingsSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).listFindingsSettings(); + } + + /** Returns the object with the settings used for calls to listFindingTypeStats. */ + public UnaryCallSettings + listFindingTypeStatsSettings() { + return ((WebSecurityScannerStubSettings) getStubSettings()).listFindingTypeStatsSettings(); + } + + public static final WebSecurityScannerSettings create(WebSecurityScannerStubSettings stub) + throws IOException { + return new WebSecurityScannerSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return WebSecurityScannerStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return WebSecurityScannerStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return WebSecurityScannerStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return WebSecurityScannerStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return WebSecurityScannerStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return WebSecurityScannerStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return WebSecurityScannerStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected WebSecurityScannerSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for WebSecurityScannerSettings. */ + public static class Builder extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(WebSecurityScannerStubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(WebSecurityScannerStubSettings.newBuilder()); + } + + protected Builder(WebSecurityScannerSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(WebSecurityScannerStubSettings.Builder stubSettings) { + super(stubSettings); + } + + public WebSecurityScannerStubSettings.Builder getStubSettingsBuilder() { + return ((WebSecurityScannerStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createScanConfig. */ + public UnaryCallSettings.Builder + createScanConfigSettings() { + return getStubSettingsBuilder().createScanConfigSettings(); + } + + /** Returns the builder for the settings used for calls to deleteScanConfig. */ + public UnaryCallSettings.Builder deleteScanConfigSettings() { + return getStubSettingsBuilder().deleteScanConfigSettings(); + } + + /** Returns the builder for the settings used for calls to getScanConfig. */ + public UnaryCallSettings.Builder getScanConfigSettings() { + return getStubSettingsBuilder().getScanConfigSettings(); + } + + /** Returns the builder for the settings used for calls to listScanConfigs. */ + public PagedCallSettings.Builder< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return getStubSettingsBuilder().listScanConfigsSettings(); + } + + /** Returns the builder for the settings used for calls to updateScanConfig. */ + public UnaryCallSettings.Builder + updateScanConfigSettings() { + return getStubSettingsBuilder().updateScanConfigSettings(); + } + + /** Returns the builder for the settings used for calls to startScanRun. */ + public UnaryCallSettings.Builder startScanRunSettings() { + return getStubSettingsBuilder().startScanRunSettings(); + } + + /** Returns the builder for the settings used for calls to getScanRun. */ + public UnaryCallSettings.Builder getScanRunSettings() { + return getStubSettingsBuilder().getScanRunSettings(); + } + + /** Returns the builder for the settings used for calls to listScanRuns. */ + public PagedCallSettings.Builder< + ListScanRunsRequest, ListScanRunsResponse, ListScanRunsPagedResponse> + listScanRunsSettings() { + return getStubSettingsBuilder().listScanRunsSettings(); + } + + /** Returns the builder for the settings used for calls to stopScanRun. */ + public UnaryCallSettings.Builder stopScanRunSettings() { + return getStubSettingsBuilder().stopScanRunSettings(); + } + + /** Returns the builder for the settings used for calls to listCrawledUrls. */ + public PagedCallSettings.Builder< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + listCrawledUrlsSettings() { + return getStubSettingsBuilder().listCrawledUrlsSettings(); + } + + /** Returns the builder for the settings used for calls to getFinding. */ + public UnaryCallSettings.Builder getFindingSettings() { + return getStubSettingsBuilder().getFindingSettings(); + } + + /** Returns the builder for the settings used for calls to listFindings. */ + public PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings() { + return getStubSettingsBuilder().listFindingsSettings(); + } + + /** Returns the builder for the settings used for calls to listFindingTypeStats. */ + public UnaryCallSettings.Builder + listFindingTypeStatsSettings() { + return getStubSettingsBuilder().listFindingTypeStatsSettings(); + } + + @Override + public WebSecurityScannerSettings build() throws IOException { + return new WebSecurityScannerSettings(this); + } + } +} diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/package-info.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/package-info.java new file mode 100644 index 00000000..27608fb3 --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/package-info.java @@ -0,0 +1,42 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Web Security Scanner API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================== WebSecurityScannerClient ======================== + * + *

Service Description: Web Security Scanner Service identifies security vulnerabilities in web + * applications hosted on Google Cloud. It crawls your application, and attempts to exercise as many + * user inputs and event handlers as possible. + * + *

Sample for WebSecurityScannerClient: + * + *

+ * 
+ * try (WebSecurityScannerClient webSecurityScannerClient = WebSecurityScannerClient.create()) {
+ *   CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder().build();
+ *   ScanConfig response = webSecurityScannerClient.createScanConfig(request);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.websecurityscanner.v1; + +import javax.annotation.Generated; diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/GrpcWebSecurityScannerCallableFactory.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/GrpcWebSecurityScannerCallableFactory.java new file mode 100644 index 00000000..725ff9dd --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/GrpcWebSecurityScannerCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Web Security Scanner API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcWebSecurityScannerCallableFactory implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/GrpcWebSecurityScannerStub.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/GrpcWebSecurityScannerStub.java new file mode 100644 index 00000000..0038fe80 --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/GrpcWebSecurityScannerStub.java @@ -0,0 +1,592 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1.stub; + +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListCrawledUrlsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListFindingsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanConfigsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanRunsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.Finding; +import com.google.cloud.websecurityscanner.v1.GetFindingRequest; +import com.google.cloud.websecurityscanner.v1.GetScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.GetScanRunRequest; +import com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; +import com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; +import com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; +import com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; +import com.google.cloud.websecurityscanner.v1.ListFindingsRequest; +import com.google.cloud.websecurityscanner.v1.ListFindingsResponse; +import com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest; +import com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse; +import com.google.cloud.websecurityscanner.v1.ListScanRunsRequest; +import com.google.cloud.websecurityscanner.v1.ListScanRunsResponse; +import com.google.cloud.websecurityscanner.v1.ScanConfig; +import com.google.cloud.websecurityscanner.v1.ScanRun; +import com.google.cloud.websecurityscanner.v1.StartScanRunRequest; +import com.google.cloud.websecurityscanner.v1.StopScanRunRequest; +import com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; +import com.google.common.collect.ImmutableMap; +import com.google.protobuf.Empty; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for Web Security Scanner API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcWebSecurityScannerStub extends WebSecurityScannerStub { + + private static final MethodDescriptor + createScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/CreateScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor + deleteScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/DeleteScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); + private static final MethodDescriptor + getScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(GetScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listScanConfigsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanConfigs") + .setRequestMarshaller( + ProtoUtils.marshaller(ListScanConfigsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListScanConfigsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + updateScanConfigMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/UpdateScanConfig") + .setRequestMarshaller( + ProtoUtils.marshaller(UpdateScanConfigRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanConfig.getDefaultInstance())) + .build(); + private static final MethodDescriptor startScanRunMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.websecurityscanner.v1.WebSecurityScanner/StartScanRun") + .setRequestMarshaller(ProtoUtils.marshaller(StartScanRunRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanRun.getDefaultInstance())) + .build(); + private static final MethodDescriptor getScanRunMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.websecurityscanner.v1.WebSecurityScanner/GetScanRun") + .setRequestMarshaller(ProtoUtils.marshaller(GetScanRunRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanRun.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listScanRunsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/ListScanRuns") + .setRequestMarshaller(ProtoUtils.marshaller(ListScanRunsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListScanRunsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor stopScanRunMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.websecurityscanner.v1.WebSecurityScanner/StopScanRun") + .setRequestMarshaller(ProtoUtils.marshaller(StopScanRunRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ScanRun.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listCrawledUrlsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/ListCrawledUrls") + .setRequestMarshaller( + ProtoUtils.marshaller(ListCrawledUrlsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListCrawledUrlsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getFindingMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.websecurityscanner.v1.WebSecurityScanner/GetFinding") + .setRequestMarshaller(ProtoUtils.marshaller(GetFindingRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Finding.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listFindingsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindings") + .setRequestMarshaller(ProtoUtils.marshaller(ListFindingsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFindingsResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listFindingTypeStatsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.websecurityscanner.v1.WebSecurityScanner/ListFindingTypeStats") + .setRequestMarshaller( + ProtoUtils.marshaller(ListFindingTypeStatsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListFindingTypeStatsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createScanConfigCallable; + private final UnaryCallable deleteScanConfigCallable; + private final UnaryCallable getScanConfigCallable; + private final UnaryCallable + listScanConfigsCallable; + private final UnaryCallable + listScanConfigsPagedCallable; + private final UnaryCallable updateScanConfigCallable; + private final UnaryCallable startScanRunCallable; + private final UnaryCallable getScanRunCallable; + private final UnaryCallable listScanRunsCallable; + private final UnaryCallable + listScanRunsPagedCallable; + private final UnaryCallable stopScanRunCallable; + private final UnaryCallable + listCrawledUrlsCallable; + private final UnaryCallable + listCrawledUrlsPagedCallable; + private final UnaryCallable getFindingCallable; + private final UnaryCallable listFindingsCallable; + private final UnaryCallable + listFindingsPagedCallable; + private final UnaryCallable + listFindingTypeStatsCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcWebSecurityScannerStub create(WebSecurityScannerStubSettings settings) + throws IOException { + return new GrpcWebSecurityScannerStub(settings, ClientContext.create(settings)); + } + + public static final GrpcWebSecurityScannerStub create(ClientContext clientContext) + throws IOException { + return new GrpcWebSecurityScannerStub( + WebSecurityScannerStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcWebSecurityScannerStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcWebSecurityScannerStub( + WebSecurityScannerStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcWebSecurityScannerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcWebSecurityScannerStub( + WebSecurityScannerStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcWebSecurityScannerCallableFactory()); + } + + /** + * Constructs an instance of GrpcWebSecurityScannerStub, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected GrpcWebSecurityScannerStub( + WebSecurityScannerStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createScanConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateScanConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteScanConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteScanConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getScanConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetScanConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listScanConfigsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listScanConfigsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListScanConfigsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateScanConfigTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateScanConfigMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateScanConfigRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put( + "scan_config.name", String.valueOf(request.getScanConfig().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings startScanRunTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(startScanRunMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(StartScanRunRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getScanRunTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getScanRunMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetScanRunRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listScanRunsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listScanRunsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListScanRunsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings stopScanRunTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(stopScanRunMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(StopScanRunRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listCrawledUrlsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listCrawledUrlsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListCrawledUrlsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getFindingTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getFindingMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetFindingRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listFindingsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFindingsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListFindingsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + listFindingTypeStatsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listFindingTypeStatsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListFindingTypeStatsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.createScanConfigCallable = + callableFactory.createUnaryCallable( + createScanConfigTransportSettings, settings.createScanConfigSettings(), clientContext); + this.deleteScanConfigCallable = + callableFactory.createUnaryCallable( + deleteScanConfigTransportSettings, settings.deleteScanConfigSettings(), clientContext); + this.getScanConfigCallable = + callableFactory.createUnaryCallable( + getScanConfigTransportSettings, settings.getScanConfigSettings(), clientContext); + this.listScanConfigsCallable = + callableFactory.createUnaryCallable( + listScanConfigsTransportSettings, settings.listScanConfigsSettings(), clientContext); + this.listScanConfigsPagedCallable = + callableFactory.createPagedCallable( + listScanConfigsTransportSettings, settings.listScanConfigsSettings(), clientContext); + this.updateScanConfigCallable = + callableFactory.createUnaryCallable( + updateScanConfigTransportSettings, settings.updateScanConfigSettings(), clientContext); + this.startScanRunCallable = + callableFactory.createUnaryCallable( + startScanRunTransportSettings, settings.startScanRunSettings(), clientContext); + this.getScanRunCallable = + callableFactory.createUnaryCallable( + getScanRunTransportSettings, settings.getScanRunSettings(), clientContext); + this.listScanRunsCallable = + callableFactory.createUnaryCallable( + listScanRunsTransportSettings, settings.listScanRunsSettings(), clientContext); + this.listScanRunsPagedCallable = + callableFactory.createPagedCallable( + listScanRunsTransportSettings, settings.listScanRunsSettings(), clientContext); + this.stopScanRunCallable = + callableFactory.createUnaryCallable( + stopScanRunTransportSettings, settings.stopScanRunSettings(), clientContext); + this.listCrawledUrlsCallable = + callableFactory.createUnaryCallable( + listCrawledUrlsTransportSettings, settings.listCrawledUrlsSettings(), clientContext); + this.listCrawledUrlsPagedCallable = + callableFactory.createPagedCallable( + listCrawledUrlsTransportSettings, settings.listCrawledUrlsSettings(), clientContext); + this.getFindingCallable = + callableFactory.createUnaryCallable( + getFindingTransportSettings, settings.getFindingSettings(), clientContext); + this.listFindingsCallable = + callableFactory.createUnaryCallable( + listFindingsTransportSettings, settings.listFindingsSettings(), clientContext); + this.listFindingsPagedCallable = + callableFactory.createPagedCallable( + listFindingsTransportSettings, settings.listFindingsSettings(), clientContext); + this.listFindingTypeStatsCallable = + callableFactory.createUnaryCallable( + listFindingTypeStatsTransportSettings, + settings.listFindingTypeStatsSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createScanConfigCallable() { + return createScanConfigCallable; + } + + public UnaryCallable deleteScanConfigCallable() { + return deleteScanConfigCallable; + } + + public UnaryCallable getScanConfigCallable() { + return getScanConfigCallable; + } + + public UnaryCallable + listScanConfigsPagedCallable() { + return listScanConfigsPagedCallable; + } + + public UnaryCallable listScanConfigsCallable() { + return listScanConfigsCallable; + } + + public UnaryCallable updateScanConfigCallable() { + return updateScanConfigCallable; + } + + public UnaryCallable startScanRunCallable() { + return startScanRunCallable; + } + + public UnaryCallable getScanRunCallable() { + return getScanRunCallable; + } + + public UnaryCallable listScanRunsPagedCallable() { + return listScanRunsPagedCallable; + } + + public UnaryCallable listScanRunsCallable() { + return listScanRunsCallable; + } + + public UnaryCallable stopScanRunCallable() { + return stopScanRunCallable; + } + + public UnaryCallable + listCrawledUrlsPagedCallable() { + return listCrawledUrlsPagedCallable; + } + + public UnaryCallable listCrawledUrlsCallable() { + return listCrawledUrlsCallable; + } + + public UnaryCallable getFindingCallable() { + return getFindingCallable; + } + + public UnaryCallable listFindingsPagedCallable() { + return listFindingsPagedCallable; + } + + public UnaryCallable listFindingsCallable() { + return listFindingsCallable; + } + + public UnaryCallable + listFindingTypeStatsCallable() { + return listFindingTypeStatsCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStub.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStub.java new file mode 100644 index 00000000..b86d047e --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStub.java @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1.stub; + +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListCrawledUrlsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListFindingsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanConfigsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanRunsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.Finding; +import com.google.cloud.websecurityscanner.v1.GetFindingRequest; +import com.google.cloud.websecurityscanner.v1.GetScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.GetScanRunRequest; +import com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; +import com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; +import com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; +import com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; +import com.google.cloud.websecurityscanner.v1.ListFindingsRequest; +import com.google.cloud.websecurityscanner.v1.ListFindingsResponse; +import com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest; +import com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse; +import com.google.cloud.websecurityscanner.v1.ListScanRunsRequest; +import com.google.cloud.websecurityscanner.v1.ListScanRunsResponse; +import com.google.cloud.websecurityscanner.v1.ScanConfig; +import com.google.cloud.websecurityscanner.v1.ScanRun; +import com.google.cloud.websecurityscanner.v1.StartScanRunRequest; +import com.google.cloud.websecurityscanner.v1.StopScanRunRequest; +import com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Web Security Scanner API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class WebSecurityScannerStub implements BackgroundResource { + + public UnaryCallable createScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: createScanConfigCallable()"); + } + + public UnaryCallable deleteScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: deleteScanConfigCallable()"); + } + + public UnaryCallable getScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: getScanConfigCallable()"); + } + + public UnaryCallable + listScanConfigsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listScanConfigsPagedCallable()"); + } + + public UnaryCallable listScanConfigsCallable() { + throw new UnsupportedOperationException("Not implemented: listScanConfigsCallable()"); + } + + public UnaryCallable updateScanConfigCallable() { + throw new UnsupportedOperationException("Not implemented: updateScanConfigCallable()"); + } + + public UnaryCallable startScanRunCallable() { + throw new UnsupportedOperationException("Not implemented: startScanRunCallable()"); + } + + public UnaryCallable getScanRunCallable() { + throw new UnsupportedOperationException("Not implemented: getScanRunCallable()"); + } + + public UnaryCallable listScanRunsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listScanRunsPagedCallable()"); + } + + public UnaryCallable listScanRunsCallable() { + throw new UnsupportedOperationException("Not implemented: listScanRunsCallable()"); + } + + public UnaryCallable stopScanRunCallable() { + throw new UnsupportedOperationException("Not implemented: stopScanRunCallable()"); + } + + public UnaryCallable + listCrawledUrlsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listCrawledUrlsPagedCallable()"); + } + + public UnaryCallable listCrawledUrlsCallable() { + throw new UnsupportedOperationException("Not implemented: listCrawledUrlsCallable()"); + } + + public UnaryCallable getFindingCallable() { + throw new UnsupportedOperationException("Not implemented: getFindingCallable()"); + } + + public UnaryCallable listFindingsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingsPagedCallable()"); + } + + public UnaryCallable listFindingsCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingsCallable()"); + } + + public UnaryCallable + listFindingTypeStatsCallable() { + throw new UnsupportedOperationException("Not implemented: listFindingTypeStatsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStubSettings.java b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStubSettings.java new file mode 100644 index 00000000..966f0d60 --- /dev/null +++ b/google-cloud-websecurityscanner/src/main/java/com/google/cloud/websecurityscanner/v1/stub/WebSecurityScannerStubSettings.java @@ -0,0 +1,841 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1.stub; + +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListCrawledUrlsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListFindingsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanConfigsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanRunsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.websecurityscanner.v1.CrawledUrl; +import com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.Finding; +import com.google.cloud.websecurityscanner.v1.GetFindingRequest; +import com.google.cloud.websecurityscanner.v1.GetScanConfigRequest; +import com.google.cloud.websecurityscanner.v1.GetScanRunRequest; +import com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest; +import com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse; +import com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest; +import com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse; +import com.google.cloud.websecurityscanner.v1.ListFindingsRequest; +import com.google.cloud.websecurityscanner.v1.ListFindingsResponse; +import com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest; +import com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse; +import com.google.cloud.websecurityscanner.v1.ListScanRunsRequest; +import com.google.cloud.websecurityscanner.v1.ListScanRunsResponse; +import com.google.cloud.websecurityscanner.v1.ScanConfig; +import com.google.cloud.websecurityscanner.v1.ScanRun; +import com.google.cloud.websecurityscanner.v1.StartScanRunRequest; +import com.google.cloud.websecurityscanner.v1.StopScanRunRequest; +import com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link WebSecurityScannerStub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (websecurityscanner.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *

For example, to set the total timeout of createScanConfig to 30 seconds: + * + *

+ * 
+ * WebSecurityScannerStubSettings.Builder webSecurityScannerSettingsBuilder =
+ *     WebSecurityScannerStubSettings.newBuilder();
+ * webSecurityScannerSettingsBuilder
+ *     .createScanConfigSettings()
+ *     .setRetrySettings(
+ *         webSecurityScannerSettingsBuilder.createScanConfigSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * WebSecurityScannerStubSettings webSecurityScannerSettings = webSecurityScannerSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class WebSecurityScannerStubSettings extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createScanConfigSettings; + private final UnaryCallSettings deleteScanConfigSettings; + private final UnaryCallSettings getScanConfigSettings; + private final PagedCallSettings< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings; + private final UnaryCallSettings updateScanConfigSettings; + private final UnaryCallSettings startScanRunSettings; + private final UnaryCallSettings getScanRunSettings; + private final PagedCallSettings< + ListScanRunsRequest, ListScanRunsResponse, ListScanRunsPagedResponse> + listScanRunsSettings; + private final UnaryCallSettings stopScanRunSettings; + private final PagedCallSettings< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + listCrawledUrlsSettings; + private final UnaryCallSettings getFindingSettings; + private final PagedCallSettings< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings; + private final UnaryCallSettings + listFindingTypeStatsSettings; + + /** Returns the object with the settings used for calls to createScanConfig. */ + public UnaryCallSettings createScanConfigSettings() { + return createScanConfigSettings; + } + + /** Returns the object with the settings used for calls to deleteScanConfig. */ + public UnaryCallSettings deleteScanConfigSettings() { + return deleteScanConfigSettings; + } + + /** Returns the object with the settings used for calls to getScanConfig. */ + public UnaryCallSettings getScanConfigSettings() { + return getScanConfigSettings; + } + + /** Returns the object with the settings used for calls to listScanConfigs. */ + public PagedCallSettings< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return listScanConfigsSettings; + } + + /** Returns the object with the settings used for calls to updateScanConfig. */ + public UnaryCallSettings updateScanConfigSettings() { + return updateScanConfigSettings; + } + + /** Returns the object with the settings used for calls to startScanRun. */ + public UnaryCallSettings startScanRunSettings() { + return startScanRunSettings; + } + + /** Returns the object with the settings used for calls to getScanRun. */ + public UnaryCallSettings getScanRunSettings() { + return getScanRunSettings; + } + + /** Returns the object with the settings used for calls to listScanRuns. */ + public PagedCallSettings + listScanRunsSettings() { + return listScanRunsSettings; + } + + /** Returns the object with the settings used for calls to stopScanRun. */ + public UnaryCallSettings stopScanRunSettings() { + return stopScanRunSettings; + } + + /** Returns the object with the settings used for calls to listCrawledUrls. */ + public PagedCallSettings< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + listCrawledUrlsSettings() { + return listCrawledUrlsSettings; + } + + /** Returns the object with the settings used for calls to getFinding. */ + public UnaryCallSettings getFindingSettings() { + return getFindingSettings; + } + + /** Returns the object with the settings used for calls to listFindings. */ + public PagedCallSettings + listFindingsSettings() { + return listFindingsSettings; + } + + /** Returns the object with the settings used for calls to listFindingTypeStats. */ + public UnaryCallSettings + listFindingTypeStatsSettings() { + return listFindingTypeStatsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public WebSecurityScannerStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcWebSecurityScannerStub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "websecurityscanner.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(WebSecurityScannerStubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected WebSecurityScannerStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + createScanConfigSettings = settingsBuilder.createScanConfigSettings().build(); + deleteScanConfigSettings = settingsBuilder.deleteScanConfigSettings().build(); + getScanConfigSettings = settingsBuilder.getScanConfigSettings().build(); + listScanConfigsSettings = settingsBuilder.listScanConfigsSettings().build(); + updateScanConfigSettings = settingsBuilder.updateScanConfigSettings().build(); + startScanRunSettings = settingsBuilder.startScanRunSettings().build(); + getScanRunSettings = settingsBuilder.getScanRunSettings().build(); + listScanRunsSettings = settingsBuilder.listScanRunsSettings().build(); + stopScanRunSettings = settingsBuilder.stopScanRunSettings().build(); + listCrawledUrlsSettings = settingsBuilder.listCrawledUrlsSettings().build(); + getFindingSettings = settingsBuilder.getFindingSettings().build(); + listFindingsSettings = settingsBuilder.listFindingsSettings().build(); + listFindingTypeStatsSettings = settingsBuilder.listFindingTypeStatsSettings().build(); + } + + private static final PagedListDescriptor< + ListScanConfigsRequest, ListScanConfigsResponse, ScanConfig> + LIST_SCAN_CONFIGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListScanConfigsRequest injectToken( + ListScanConfigsRequest payload, String token) { + return ListScanConfigsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListScanConfigsRequest injectPageSize( + ListScanConfigsRequest payload, int pageSize) { + return ListScanConfigsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListScanConfigsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListScanConfigsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListScanConfigsResponse payload) { + return payload.getScanConfigsList() != null + ? payload.getScanConfigsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_SCAN_RUNS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListScanRunsRequest injectToken(ListScanRunsRequest payload, String token) { + return ListScanRunsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListScanRunsRequest injectPageSize(ListScanRunsRequest payload, int pageSize) { + return ListScanRunsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListScanRunsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListScanRunsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListScanRunsResponse payload) { + return payload.getScanRunsList() != null + ? payload.getScanRunsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, CrawledUrl> + LIST_CRAWLED_URLS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListCrawledUrlsRequest injectToken( + ListCrawledUrlsRequest payload, String token) { + return ListCrawledUrlsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListCrawledUrlsRequest injectPageSize( + ListCrawledUrlsRequest payload, int pageSize) { + return ListCrawledUrlsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListCrawledUrlsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListCrawledUrlsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListCrawledUrlsResponse payload) { + return payload.getCrawledUrlsList() != null + ? payload.getCrawledUrlsList() + : ImmutableList.of(); + } + }; + + private static final PagedListDescriptor + LIST_FINDINGS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListFindingsRequest injectToken(ListFindingsRequest payload, String token) { + return ListFindingsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListFindingsRequest injectPageSize(ListFindingsRequest payload, int pageSize) { + return ListFindingsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListFindingsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListFindingsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListFindingsResponse payload) { + return payload.getFindingsList() != null + ? payload.getFindingsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + LIST_SCAN_CONFIGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListScanConfigsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SCAN_CONFIGS_PAGE_STR_DESC, request, context); + return ListScanConfigsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListScanRunsRequest, ListScanRunsResponse, ListScanRunsPagedResponse> + LIST_SCAN_RUNS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListScanRunsRequest, ListScanRunsResponse, ListScanRunsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListScanRunsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_SCAN_RUNS_PAGE_STR_DESC, request, context); + return ListScanRunsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + LIST_CRAWLED_URLS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListCrawledUrlsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_CRAWLED_URLS_PAGE_STR_DESC, request, context); + return ListCrawledUrlsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + LIST_FINDINGS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListFindingsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_FINDINGS_PAGE_STR_DESC, request, context); + return ListFindingsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for WebSecurityScannerStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createScanConfigSettings; + private final UnaryCallSettings.Builder + deleteScanConfigSettings; + private final UnaryCallSettings.Builder getScanConfigSettings; + private final PagedCallSettings.Builder< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings; + private final UnaryCallSettings.Builder + updateScanConfigSettings; + private final UnaryCallSettings.Builder startScanRunSettings; + private final UnaryCallSettings.Builder getScanRunSettings; + private final PagedCallSettings.Builder< + ListScanRunsRequest, ListScanRunsResponse, ListScanRunsPagedResponse> + listScanRunsSettings; + private final UnaryCallSettings.Builder stopScanRunSettings; + private final PagedCallSettings.Builder< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + listCrawledUrlsSettings; + private final UnaryCallSettings.Builder getFindingSettings; + private final PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings; + private final UnaryCallSettings.Builder< + ListFindingTypeStatsRequest, ListFindingTypeStatsResponse> + listFindingTypeStatsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listScanConfigsSettings = PagedCallSettings.newBuilder(LIST_SCAN_CONFIGS_PAGE_STR_FACT); + + updateScanConfigSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + startScanRunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + getScanRunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listScanRunsSettings = PagedCallSettings.newBuilder(LIST_SCAN_RUNS_PAGE_STR_FACT); + + stopScanRunSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listCrawledUrlsSettings = PagedCallSettings.newBuilder(LIST_CRAWLED_URLS_PAGE_STR_FACT); + + getFindingSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listFindingsSettings = PagedCallSettings.newBuilder(LIST_FINDINGS_PAGE_STR_FACT); + + listFindingTypeStatsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createScanConfigSettings, + deleteScanConfigSettings, + getScanConfigSettings, + listScanConfigsSettings, + updateScanConfigSettings, + startScanRunSettings, + getScanRunSettings, + listScanRunsSettings, + stopScanRunSettings, + listCrawledUrlsSettings, + getFindingSettings, + listFindingsSettings, + listFindingTypeStatsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createScanConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteScanConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getScanConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listScanConfigsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateScanConfigSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .startScanRunSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getScanRunSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listScanRunsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .stopScanRunSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listCrawledUrlsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getFindingSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listFindingsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listFindingTypeStatsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(WebSecurityScannerStubSettings settings) { + super(settings); + + createScanConfigSettings = settings.createScanConfigSettings.toBuilder(); + deleteScanConfigSettings = settings.deleteScanConfigSettings.toBuilder(); + getScanConfigSettings = settings.getScanConfigSettings.toBuilder(); + listScanConfigsSettings = settings.listScanConfigsSettings.toBuilder(); + updateScanConfigSettings = settings.updateScanConfigSettings.toBuilder(); + startScanRunSettings = settings.startScanRunSettings.toBuilder(); + getScanRunSettings = settings.getScanRunSettings.toBuilder(); + listScanRunsSettings = settings.listScanRunsSettings.toBuilder(); + stopScanRunSettings = settings.stopScanRunSettings.toBuilder(); + listCrawledUrlsSettings = settings.listCrawledUrlsSettings.toBuilder(); + getFindingSettings = settings.getFindingSettings.toBuilder(); + listFindingsSettings = settings.listFindingsSettings.toBuilder(); + listFindingTypeStatsSettings = settings.listFindingTypeStatsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createScanConfigSettings, + deleteScanConfigSettings, + getScanConfigSettings, + listScanConfigsSettings, + updateScanConfigSettings, + startScanRunSettings, + getScanRunSettings, + listScanRunsSettings, + stopScanRunSettings, + listCrawledUrlsSettings, + getFindingSettings, + listFindingsSettings, + listFindingTypeStatsSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createScanConfig. */ + public UnaryCallSettings.Builder + createScanConfigSettings() { + return createScanConfigSettings; + } + + /** Returns the builder for the settings used for calls to deleteScanConfig. */ + public UnaryCallSettings.Builder deleteScanConfigSettings() { + return deleteScanConfigSettings; + } + + /** Returns the builder for the settings used for calls to getScanConfig. */ + public UnaryCallSettings.Builder getScanConfigSettings() { + return getScanConfigSettings; + } + + /** Returns the builder for the settings used for calls to listScanConfigs. */ + public PagedCallSettings.Builder< + ListScanConfigsRequest, ListScanConfigsResponse, ListScanConfigsPagedResponse> + listScanConfigsSettings() { + return listScanConfigsSettings; + } + + /** Returns the builder for the settings used for calls to updateScanConfig. */ + public UnaryCallSettings.Builder + updateScanConfigSettings() { + return updateScanConfigSettings; + } + + /** Returns the builder for the settings used for calls to startScanRun. */ + public UnaryCallSettings.Builder startScanRunSettings() { + return startScanRunSettings; + } + + /** Returns the builder for the settings used for calls to getScanRun. */ + public UnaryCallSettings.Builder getScanRunSettings() { + return getScanRunSettings; + } + + /** Returns the builder for the settings used for calls to listScanRuns. */ + public PagedCallSettings.Builder< + ListScanRunsRequest, ListScanRunsResponse, ListScanRunsPagedResponse> + listScanRunsSettings() { + return listScanRunsSettings; + } + + /** Returns the builder for the settings used for calls to stopScanRun. */ + public UnaryCallSettings.Builder stopScanRunSettings() { + return stopScanRunSettings; + } + + /** Returns the builder for the settings used for calls to listCrawledUrls. */ + public PagedCallSettings.Builder< + ListCrawledUrlsRequest, ListCrawledUrlsResponse, ListCrawledUrlsPagedResponse> + listCrawledUrlsSettings() { + return listCrawledUrlsSettings; + } + + /** Returns the builder for the settings used for calls to getFinding. */ + public UnaryCallSettings.Builder getFindingSettings() { + return getFindingSettings; + } + + /** Returns the builder for the settings used for calls to listFindings. */ + public PagedCallSettings.Builder< + ListFindingsRequest, ListFindingsResponse, ListFindingsPagedResponse> + listFindingsSettings() { + return listFindingsSettings; + } + + /** Returns the builder for the settings used for calls to listFindingTypeStats. */ + public UnaryCallSettings.Builder + listFindingTypeStatsSettings() { + return listFindingTypeStatsSettings; + } + + @Override + public WebSecurityScannerStubSettings build() throws IOException { + return new WebSecurityScannerStubSettings(this); + } + } +} diff --git a/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/MockWebSecurityScanner.java b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/MockWebSecurityScanner.java new file mode 100644 index 00000000..7e41588f --- /dev/null +++ b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/MockWebSecurityScanner.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockWebSecurityScanner implements MockGrpcService { + private final MockWebSecurityScannerImpl serviceImpl; + + public MockWebSecurityScanner() { + serviceImpl = new MockWebSecurityScannerImpl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/MockWebSecurityScannerImpl.java b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/MockWebSecurityScannerImpl.java new file mode 100644 index 00000000..ee2da876 --- /dev/null +++ b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/MockWebSecurityScannerImpl.java @@ -0,0 +1,251 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.websecurityscanner.v1.WebSecurityScannerGrpc.WebSecurityScannerImplBase; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockWebSecurityScannerImpl extends WebSecurityScannerImplBase { + private List requests; + private Queue responses; + + public MockWebSecurityScannerImpl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createScanConfig( + CreateScanConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanConfig) { + requests.add(request); + responseObserver.onNext((ScanConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteScanConfig( + DeleteScanConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getScanConfig( + GetScanConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanConfig) { + requests.add(request); + responseObserver.onNext((ScanConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listScanConfigs( + ListScanConfigsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListScanConfigsResponse) { + requests.add(request); + responseObserver.onNext((ListScanConfigsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateScanConfig( + UpdateScanConfigRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanConfig) { + requests.add(request); + responseObserver.onNext((ScanConfig) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void startScanRun(StartScanRunRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanRun) { + requests.add(request); + responseObserver.onNext((ScanRun) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getScanRun(GetScanRunRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanRun) { + requests.add(request); + responseObserver.onNext((ScanRun) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listScanRuns( + ListScanRunsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListScanRunsResponse) { + requests.add(request); + responseObserver.onNext((ListScanRunsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void stopScanRun(StopScanRunRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ScanRun) { + requests.add(request); + responseObserver.onNext((ScanRun) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listCrawledUrls( + ListCrawledUrlsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListCrawledUrlsResponse) { + requests.add(request); + responseObserver.onNext((ListCrawledUrlsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getFinding(GetFindingRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Finding) { + requests.add(request); + responseObserver.onNext((Finding) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listFindings( + ListFindingsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFindingsResponse) { + requests.add(request); + responseObserver.onNext((ListFindingsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listFindingTypeStats( + ListFindingTypeStatsRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListFindingTypeStatsResponse) { + requests.add(request); + responseObserver.onNext((ListFindingTypeStatsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerClientTest.java b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerClientTest.java new file mode 100644 index 00000000..57c671ec --- /dev/null +++ b/google-cloud-websecurityscanner/src/test/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerClientTest.java @@ -0,0 +1,698 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1; + +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListCrawledUrlsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListFindingsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanConfigsPagedResponse; +import static com.google.cloud.websecurityscanner.v1.WebSecurityScannerClient.ListScanRunsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class WebSecurityScannerClientTest { + private static MockWebSecurityScanner mockWebSecurityScanner; + private static MockServiceHelper serviceHelper; + private WebSecurityScannerClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockWebSecurityScanner = new MockWebSecurityScanner(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockWebSecurityScanner)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + WebSecurityScannerSettings settings = + WebSecurityScannerSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = WebSecurityScannerClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createScanConfigTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + int maxQps = 844445913; + boolean managedScan = false; + boolean staticIpScan = true; + ScanConfig expectedResponse = + ScanConfig.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setMaxQps(maxQps) + .setManagedScan(managedScan) + .setStaticIpScan(staticIpScan) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder().build(); + + ScanConfig actualResponse = client.createScanConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateScanConfigRequest actualRequest = (CreateScanConfigRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createScanConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + CreateScanConfigRequest request = CreateScanConfigRequest.newBuilder().build(); + + client.createScanConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void deleteScanConfigTest() { + Empty expectedResponse = Empty.newBuilder().build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder().build(); + + client.deleteScanConfig(request); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + DeleteScanConfigRequest actualRequest = (DeleteScanConfigRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void deleteScanConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + DeleteScanConfigRequest request = DeleteScanConfigRequest.newBuilder().build(); + + client.deleteScanConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getScanConfigTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + int maxQps = 844445913; + boolean managedScan = false; + boolean staticIpScan = true; + ScanConfig expectedResponse = + ScanConfig.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setMaxQps(maxQps) + .setManagedScan(managedScan) + .setStaticIpScan(staticIpScan) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + GetScanConfigRequest request = GetScanConfigRequest.newBuilder().build(); + + ScanConfig actualResponse = client.getScanConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetScanConfigRequest actualRequest = (GetScanConfigRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getScanConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + GetScanConfigRequest request = GetScanConfigRequest.newBuilder().build(); + + client.getScanConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listScanConfigsTest() { + String nextPageToken = ""; + ScanConfig scanConfigsElement = ScanConfig.newBuilder().build(); + List scanConfigs = Arrays.asList(scanConfigsElement); + ListScanConfigsResponse expectedResponse = + ListScanConfigsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllScanConfigs(scanConfigs) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder().build(); + + ListScanConfigsPagedResponse pagedListResponse = client.listScanConfigs(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getScanConfigsList().get(0), resources.get(0)); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListScanConfigsRequest actualRequest = (ListScanConfigsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listScanConfigsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + ListScanConfigsRequest request = ListScanConfigsRequest.newBuilder().build(); + + client.listScanConfigs(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void updateScanConfigTest() { + String name = "name3373707"; + String displayName = "displayName1615086568"; + int maxQps = 844445913; + boolean managedScan = false; + boolean staticIpScan = true; + ScanConfig expectedResponse = + ScanConfig.newBuilder() + .setName(name) + .setDisplayName(displayName) + .setMaxQps(maxQps) + .setManagedScan(managedScan) + .setStaticIpScan(staticIpScan) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder().build(); + + ScanConfig actualResponse = client.updateScanConfig(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + UpdateScanConfigRequest actualRequest = (UpdateScanConfigRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void updateScanConfigExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + UpdateScanConfigRequest request = UpdateScanConfigRequest.newBuilder().build(); + + client.updateScanConfig(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void startScanRunTest() { + String name = "name3373707"; + long urlsCrawledCount = 1749797253L; + long urlsTestedCount = 1498664068L; + boolean hasVulnerabilities = false; + int progressPercent = 2137894861; + ScanRun expectedResponse = + ScanRun.newBuilder() + .setName(name) + .setUrlsCrawledCount(urlsCrawledCount) + .setUrlsTestedCount(urlsTestedCount) + .setHasVulnerabilities(hasVulnerabilities) + .setProgressPercent(progressPercent) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + StartScanRunRequest request = StartScanRunRequest.newBuilder().build(); + + ScanRun actualResponse = client.startScanRun(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StartScanRunRequest actualRequest = (StartScanRunRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void startScanRunExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + StartScanRunRequest request = StartScanRunRequest.newBuilder().build(); + + client.startScanRun(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getScanRunTest() { + String name = "name3373707"; + long urlsCrawledCount = 1749797253L; + long urlsTestedCount = 1498664068L; + boolean hasVulnerabilities = false; + int progressPercent = 2137894861; + ScanRun expectedResponse = + ScanRun.newBuilder() + .setName(name) + .setUrlsCrawledCount(urlsCrawledCount) + .setUrlsTestedCount(urlsTestedCount) + .setHasVulnerabilities(hasVulnerabilities) + .setProgressPercent(progressPercent) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + GetScanRunRequest request = GetScanRunRequest.newBuilder().build(); + + ScanRun actualResponse = client.getScanRun(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetScanRunRequest actualRequest = (GetScanRunRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getScanRunExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + GetScanRunRequest request = GetScanRunRequest.newBuilder().build(); + + client.getScanRun(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listScanRunsTest() { + String nextPageToken = ""; + ScanRun scanRunsElement = ScanRun.newBuilder().build(); + List scanRuns = Arrays.asList(scanRunsElement); + ListScanRunsResponse expectedResponse = + ListScanRunsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllScanRuns(scanRuns) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + ListScanRunsRequest request = ListScanRunsRequest.newBuilder().build(); + + ListScanRunsPagedResponse pagedListResponse = client.listScanRuns(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getScanRunsList().get(0), resources.get(0)); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListScanRunsRequest actualRequest = (ListScanRunsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listScanRunsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + ListScanRunsRequest request = ListScanRunsRequest.newBuilder().build(); + + client.listScanRuns(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void stopScanRunTest() { + String name = "name3373707"; + long urlsCrawledCount = 1749797253L; + long urlsTestedCount = 1498664068L; + boolean hasVulnerabilities = false; + int progressPercent = 2137894861; + ScanRun expectedResponse = + ScanRun.newBuilder() + .setName(name) + .setUrlsCrawledCount(urlsCrawledCount) + .setUrlsTestedCount(urlsTestedCount) + .setHasVulnerabilities(hasVulnerabilities) + .setProgressPercent(progressPercent) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + StopScanRunRequest request = StopScanRunRequest.newBuilder().build(); + + ScanRun actualResponse = client.stopScanRun(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + StopScanRunRequest actualRequest = (StopScanRunRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void stopScanRunExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + StopScanRunRequest request = StopScanRunRequest.newBuilder().build(); + + client.stopScanRun(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listCrawledUrlsTest() { + String nextPageToken = ""; + CrawledUrl crawledUrlsElement = CrawledUrl.newBuilder().build(); + List crawledUrls = Arrays.asList(crawledUrlsElement); + ListCrawledUrlsResponse expectedResponse = + ListCrawledUrlsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllCrawledUrls(crawledUrls) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder().build(); + + ListCrawledUrlsPagedResponse pagedListResponse = client.listCrawledUrls(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getCrawledUrlsList().get(0), resources.get(0)); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListCrawledUrlsRequest actualRequest = (ListCrawledUrlsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listCrawledUrlsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + ListCrawledUrlsRequest request = ListCrawledUrlsRequest.newBuilder().build(); + + client.listCrawledUrls(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void getFindingTest() { + FindingName name = FindingName.of("[PROJECT]", "[SCAN_CONFIG]", "[SCAN_RUN]", "[FINDING]"); + String findingType = "findingType274496048"; + String httpMethod = "httpMethod820747384"; + String fuzzedUrl = "fuzzedUrl-2120677666"; + String body = "body3029410"; + String description = "description-1724546052"; + String reproductionUrl = "reproductionUrl-244934180"; + String frameUrl = "frameUrl545464221"; + String finalUrl = "finalUrl355601190"; + String trackingId = "trackingId1878901667"; + Finding expectedResponse = + Finding.newBuilder() + .setName(name.toString()) + .setFindingType(findingType) + .setHttpMethod(httpMethod) + .setFuzzedUrl(fuzzedUrl) + .setBody(body) + .setDescription(description) + .setReproductionUrl(reproductionUrl) + .setFrameUrl(frameUrl) + .setFinalUrl(finalUrl) + .setTrackingId(trackingId) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + GetFindingRequest request = GetFindingRequest.newBuilder().build(); + + Finding actualResponse = client.getFinding(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetFindingRequest actualRequest = (GetFindingRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void getFindingExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + GetFindingRequest request = GetFindingRequest.newBuilder().build(); + + client.getFinding(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listFindingsTest() { + String nextPageToken = ""; + Finding findingsElement = Finding.newBuilder().build(); + List findings = Arrays.asList(findingsElement); + ListFindingsResponse expectedResponse = + ListFindingsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllFindings(findings) + .build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + ListFindingsRequest request = ListFindingsRequest.newBuilder().build(); + + ListFindingsPagedResponse pagedListResponse = client.listFindings(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getFindingsList().get(0), resources.get(0)); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFindingsRequest actualRequest = (ListFindingsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listFindingsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + ListFindingsRequest request = ListFindingsRequest.newBuilder().build(); + + client.listFindings(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void listFindingTypeStatsTest() { + ListFindingTypeStatsResponse expectedResponse = + ListFindingTypeStatsResponse.newBuilder().build(); + mockWebSecurityScanner.addResponse(expectedResponse); + + ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder().build(); + + ListFindingTypeStatsResponse actualResponse = client.listFindingTypeStats(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockWebSecurityScanner.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListFindingTypeStatsRequest actualRequest = (ListFindingTypeStatsRequest) actualRequests.get(0); + + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listFindingTypeStatsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockWebSecurityScanner.addException(exception); + + try { + ListFindingTypeStatsRequest request = ListFindingTypeStatsRequest.newBuilder().build(); + + client.listFindingTypeStats(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/grpc-google-cloud-websecurityscanner-v1/pom.xml b/grpc-google-cloud-websecurityscanner-v1/pom.xml new file mode 100644 index 00000000..1613ca21 --- /dev/null +++ b/grpc-google-cloud-websecurityscanner-v1/pom.xml @@ -0,0 +1,56 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-websecurityscanner-v1 + 0.81.4-SNAPSHOT + grpc-google-cloud-websecurityscanner-v1 + GRPC library for grpc-google-cloud-websecurityscanner-v1 + + com.google.cloud + google-cloud-websecurityscanner-parent + 0.116.4-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-websecurityscanner-v1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + \ No newline at end of file diff --git a/grpc-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerGrpc.java b/grpc-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerGrpc.java new file mode 100644 index 00000000..9784ee44 --- /dev/null +++ b/grpc-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerGrpc.java @@ -0,0 +1,1809 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.websecurityscanner.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Web Security Scanner Service identifies security vulnerabilities in web
+ * applications hosted on Google Cloud. It crawls your application, and
+ * attempts to exercise as many user inputs and event handlers as possible.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/websecurityscanner/v1/web_security_scanner.proto") +public final class WebSecurityScannerGrpc { + + private WebSecurityScannerGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.websecurityscanner.v1.WebSecurityScanner"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getCreateScanConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateScanConfig", + requestType = com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ScanConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getCreateScanConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getCreateScanConfigMethod; + if ((getCreateScanConfigMethod = WebSecurityScannerGrpc.getCreateScanConfigMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getCreateScanConfigMethod = WebSecurityScannerGrpc.getCreateScanConfigMethod) + == null) { + WebSecurityScannerGrpc.getCreateScanConfigMethod = + getCreateScanConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CreateScanConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ScanConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("CreateScanConfig")) + .build(); + } + } + } + return getCreateScanConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest, com.google.protobuf.Empty> + getDeleteScanConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteScanConfig", + requestType = com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest, com.google.protobuf.Empty> + getDeleteScanConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest, + com.google.protobuf.Empty> + getDeleteScanConfigMethod; + if ((getDeleteScanConfigMethod = WebSecurityScannerGrpc.getDeleteScanConfigMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getDeleteScanConfigMethod = WebSecurityScannerGrpc.getDeleteScanConfigMethod) + == null) { + WebSecurityScannerGrpc.getDeleteScanConfigMethod = + getDeleteScanConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteScanConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("DeleteScanConfig")) + .build(); + } + } + } + return getDeleteScanConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getGetScanConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetScanConfig", + requestType = com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ScanConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getGetScanConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getGetScanConfigMethod; + if ((getGetScanConfigMethod = WebSecurityScannerGrpc.getGetScanConfigMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getGetScanConfigMethod = WebSecurityScannerGrpc.getGetScanConfigMethod) == null) { + WebSecurityScannerGrpc.getGetScanConfigMethod = + getGetScanConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetScanConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ScanConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("GetScanConfig")) + .build(); + } + } + } + return getGetScanConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest, + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse> + getListScanConfigsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListScanConfigs", + requestType = com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest, + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse> + getListScanConfigsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest, + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse> + getListScanConfigsMethod; + if ((getListScanConfigsMethod = WebSecurityScannerGrpc.getListScanConfigsMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getListScanConfigsMethod = WebSecurityScannerGrpc.getListScanConfigsMethod) == null) { + WebSecurityScannerGrpc.getListScanConfigsMethod = + getListScanConfigsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListScanConfigs")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("ListScanConfigs")) + .build(); + } + } + } + return getListScanConfigsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getUpdateScanConfigMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateScanConfig", + requestType = com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ScanConfig.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getUpdateScanConfigMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig> + getUpdateScanConfigMethod; + if ((getUpdateScanConfigMethod = WebSecurityScannerGrpc.getUpdateScanConfigMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getUpdateScanConfigMethod = WebSecurityScannerGrpc.getUpdateScanConfigMethod) + == null) { + WebSecurityScannerGrpc.getUpdateScanConfigMethod = + getUpdateScanConfigMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "UpdateScanConfig")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ScanConfig + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("UpdateScanConfig")) + .build(); + } + } + } + return getUpdateScanConfigMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.StartScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getStartScanRunMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StartScanRun", + requestType = com.google.cloud.websecurityscanner.v1.StartScanRunRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ScanRun.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.StartScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getStartScanRunMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.StartScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getStartScanRunMethod; + if ((getStartScanRunMethod = WebSecurityScannerGrpc.getStartScanRunMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getStartScanRunMethod = WebSecurityScannerGrpc.getStartScanRunMethod) == null) { + WebSecurityScannerGrpc.getStartScanRunMethod = + getStartScanRunMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StartScanRun")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("StartScanRun")) + .build(); + } + } + } + return getStartScanRunMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getGetScanRunMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetScanRun", + requestType = com.google.cloud.websecurityscanner.v1.GetScanRunRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ScanRun.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getGetScanRunMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getGetScanRunMethod; + if ((getGetScanRunMethod = WebSecurityScannerGrpc.getGetScanRunMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getGetScanRunMethod = WebSecurityScannerGrpc.getGetScanRunMethod) == null) { + WebSecurityScannerGrpc.getGetScanRunMethod = + getGetScanRunMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetScanRun")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("GetScanRun")) + .build(); + } + } + } + return getGetScanRunMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest, + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse> + getListScanRunsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListScanRuns", + requestType = com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest, + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse> + getListScanRunsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest, + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse> + getListScanRunsMethod; + if ((getListScanRunsMethod = WebSecurityScannerGrpc.getListScanRunsMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getListScanRunsMethod = WebSecurityScannerGrpc.getListScanRunsMethod) == null) { + WebSecurityScannerGrpc.getListScanRunsMethod = + getListScanRunsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListScanRuns")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("ListScanRuns")) + .build(); + } + } + } + return getListScanRunsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.StopScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getStopScanRunMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "StopScanRun", + requestType = com.google.cloud.websecurityscanner.v1.StopScanRunRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ScanRun.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.StopScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getStopScanRunMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.StopScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun> + getStopScanRunMethod; + if ((getStopScanRunMethod = WebSecurityScannerGrpc.getStopScanRunMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getStopScanRunMethod = WebSecurityScannerGrpc.getStopScanRunMethod) == null) { + WebSecurityScannerGrpc.getStopScanRunMethod = + getStopScanRunMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StopScanRun")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("StopScanRun")) + .build(); + } + } + } + return getStopScanRunMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse> + getListCrawledUrlsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListCrawledUrls", + requestType = com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse> + getListCrawledUrlsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse> + getListCrawledUrlsMethod; + if ((getListCrawledUrlsMethod = WebSecurityScannerGrpc.getListCrawledUrlsMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getListCrawledUrlsMethod = WebSecurityScannerGrpc.getListCrawledUrlsMethod) == null) { + WebSecurityScannerGrpc.getListCrawledUrlsMethod = + getListCrawledUrlsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListCrawledUrls")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("ListCrawledUrls")) + .build(); + } + } + } + return getListCrawledUrlsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetFindingRequest, + com.google.cloud.websecurityscanner.v1.Finding> + getGetFindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFinding", + requestType = com.google.cloud.websecurityscanner.v1.GetFindingRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.Finding.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetFindingRequest, + com.google.cloud.websecurityscanner.v1.Finding> + getGetFindingMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.GetFindingRequest, + com.google.cloud.websecurityscanner.v1.Finding> + getGetFindingMethod; + if ((getGetFindingMethod = WebSecurityScannerGrpc.getGetFindingMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getGetFindingMethod = WebSecurityScannerGrpc.getGetFindingMethod) == null) { + WebSecurityScannerGrpc.getGetFindingMethod = + getGetFindingMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.GetFindingRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.Finding.getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("GetFinding")) + .build(); + } + } + } + return getGetFindingMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListFindingsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingsResponse> + getListFindingsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFindings", + requestType = com.google.cloud.websecurityscanner.v1.ListFindingsRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ListFindingsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListFindingsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingsResponse> + getListFindingsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListFindingsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingsResponse> + getListFindingsMethod; + if ((getListFindingsMethod = WebSecurityScannerGrpc.getListFindingsMethod) == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getListFindingsMethod = WebSecurityScannerGrpc.getListFindingsMethod) == null) { + WebSecurityScannerGrpc.getListFindingsMethod = + getListFindingsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFindings")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListFindingsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("ListFindings")) + .build(); + } + } + } + return getListFindingsMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse> + getListFindingTypeStatsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFindingTypeStats", + requestType = com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.class, + responseType = com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse> + getListFindingTypeStatsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse> + getListFindingTypeStatsMethod; + if ((getListFindingTypeStatsMethod = WebSecurityScannerGrpc.getListFindingTypeStatsMethod) + == null) { + synchronized (WebSecurityScannerGrpc.class) { + if ((getListFindingTypeStatsMethod = WebSecurityScannerGrpc.getListFindingTypeStatsMethod) + == null) { + WebSecurityScannerGrpc.getListFindingTypeStatsMethod = + getListFindingTypeStatsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListFindingTypeStats")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new WebSecurityScannerMethodDescriptorSupplier("ListFindingTypeStats")) + .build(); + } + } + } + return getListFindingTypeStatsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static WebSecurityScannerStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WebSecurityScannerStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebSecurityScannerStub(channel, callOptions); + } + }; + return WebSecurityScannerStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static WebSecurityScannerBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WebSecurityScannerBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebSecurityScannerBlockingStub(channel, callOptions); + } + }; + return WebSecurityScannerBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static WebSecurityScannerFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public WebSecurityScannerFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebSecurityScannerFutureStub(channel, callOptions); + } + }; + return WebSecurityScannerFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Web Security Scanner Service identifies security vulnerabilities in web
+   * applications hosted on Google Cloud. It crawls your application, and
+   * attempts to exercise as many user inputs and event handlers as possible.
+   * 
+ */ + public abstract static class WebSecurityScannerImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates a new ScanConfig.
+     * 
+ */ + public void createScanConfig( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateScanConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes an existing ScanConfig and its child resources.
+     * 
+ */ + public void deleteScanConfig( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteScanConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a ScanConfig.
+     * 
+ */ + public void getScanConfig( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetScanConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists ScanConfigs under a given project.
+     * 
+ */ + public void listScanConfigs( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListScanConfigsMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates a ScanConfig. This method support partial update of a ScanConfig.
+     * 
+ */ + public void updateScanConfig( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getUpdateScanConfigMethod(), responseObserver); + } + + /** + * + * + *
+     * Start a ScanRun according to the given ScanConfig.
+     * 
+ */ + public void startScanRun( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getStartScanRunMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a ScanRun.
+     * 
+ */ + public void getScanRun( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetScanRunMethod(), responseObserver); + } + + /** + * + * + *
+     * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
+     * stop time.
+     * 
+ */ + public void listScanRuns( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListScanRunsMethod(), responseObserver); + } + + /** + * + * + *
+     * Stops a ScanRun. The stopped ScanRun is returned.
+     * 
+ */ + public void stopScanRun( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getStopScanRunMethod(), responseObserver); + } + + /** + * + * + *
+     * List CrawledUrls under a given ScanRun.
+     * 
+ */ + public void listCrawledUrls( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListCrawledUrlsMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets a Finding.
+     * 
+ */ + public void getFinding( + com.google.cloud.websecurityscanner.v1.GetFindingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getGetFindingMethod(), responseObserver); + } + + /** + * + * + *
+     * List Findings under a given ScanRun.
+     * 
+ */ + public void listFindings( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListFindingsMethod(), responseObserver); + } + + /** + * + * + *
+     * List all FindingTypeStats under a given ScanRun.
+     * 
+ */ + public void listFindingTypeStats( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getListFindingTypeStatsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateScanConfigMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig>( + this, METHODID_CREATE_SCAN_CONFIG))) + .addMethod( + getDeleteScanConfigMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_SCAN_CONFIG))) + .addMethod( + getGetScanConfigMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig>( + this, METHODID_GET_SCAN_CONFIG))) + .addMethod( + getListScanConfigsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest, + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse>( + this, METHODID_LIST_SCAN_CONFIGS))) + .addMethod( + getUpdateScanConfigMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest, + com.google.cloud.websecurityscanner.v1.ScanConfig>( + this, METHODID_UPDATE_SCAN_CONFIG))) + .addMethod( + getStartScanRunMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.StartScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun>( + this, METHODID_START_SCAN_RUN))) + .addMethod( + getGetScanRunMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.GetScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun>(this, METHODID_GET_SCAN_RUN))) + .addMethod( + getListScanRunsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest, + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse>( + this, METHODID_LIST_SCAN_RUNS))) + .addMethod( + getStopScanRunMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.StopScanRunRequest, + com.google.cloud.websecurityscanner.v1.ScanRun>( + this, METHODID_STOP_SCAN_RUN))) + .addMethod( + getListCrawledUrlsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse>( + this, METHODID_LIST_CRAWLED_URLS))) + .addMethod( + getGetFindingMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.GetFindingRequest, + com.google.cloud.websecurityscanner.v1.Finding>(this, METHODID_GET_FINDING))) + .addMethod( + getListFindingsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.ListFindingsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingsResponse>( + this, METHODID_LIST_FINDINGS))) + .addMethod( + getListFindingTypeStatsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse>( + this, METHODID_LIST_FINDING_TYPE_STATS))) + .build(); + } + } + + /** + * + * + *
+   * Web Security Scanner Service identifies security vulnerabilities in web
+   * applications hosted on Google Cloud. It crawls your application, and
+   * attempts to exercise as many user inputs and event handlers as possible.
+   * 
+ */ + public static final class WebSecurityScannerStub + extends io.grpc.stub.AbstractAsyncStub { + private WebSecurityScannerStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WebSecurityScannerStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebSecurityScannerStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new ScanConfig.
+     * 
+ */ + public void createScanConfig( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateScanConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes an existing ScanConfig and its child resources.
+     * 
+ */ + public void deleteScanConfig( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteScanConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a ScanConfig.
+     * 
+ */ + public void getScanConfig( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetScanConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Lists ScanConfigs under a given project.
+     * 
+ */ + public void listScanConfigs( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListScanConfigsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates a ScanConfig. This method support partial update of a ScanConfig.
+     * 
+ */ + public void updateScanConfig( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateScanConfigMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Start a ScanRun according to the given ScanConfig.
+     * 
+ */ + public void startScanRun( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getStartScanRunMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a ScanRun.
+     * 
+ */ + public void getScanRun( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetScanRunMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
+     * stop time.
+     * 
+ */ + public void listScanRuns( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListScanRunsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Stops a ScanRun. The stopped ScanRun is returned.
+     * 
+ */ + public void stopScanRun( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getStopScanRunMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List CrawledUrls under a given ScanRun.
+     * 
+ */ + public void listCrawledUrls( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListCrawledUrlsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets a Finding.
+     * 
+ */ + public void getFinding( + com.google.cloud.websecurityscanner.v1.GetFindingRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetFindingMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * List Findings under a given ScanRun.
+     * 
+ */ + public void listFindings( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFindingsMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List all FindingTypeStats under a given ScanRun.
+     * 
+ */ + public void listFindingTypeStats( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest request, + io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFindingTypeStatsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Web Security Scanner Service identifies security vulnerabilities in web
+   * applications hosted on Google Cloud. It crawls your application, and
+   * attempts to exercise as many user inputs and event handlers as possible.
+   * 
+ */ + public static final class WebSecurityScannerBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private WebSecurityScannerBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WebSecurityScannerBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebSecurityScannerBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new ScanConfig.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ScanConfig createScanConfig( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest request) { + return blockingUnaryCall( + getChannel(), getCreateScanConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes an existing ScanConfig and its child resources.
+     * 
+ */ + public com.google.protobuf.Empty deleteScanConfig( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteScanConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a ScanConfig.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest request) { + return blockingUnaryCall(getChannel(), getGetScanConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists ScanConfigs under a given project.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse listScanConfigs( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest request) { + return blockingUnaryCall(getChannel(), getListScanConfigsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates a ScanConfig. This method support partial update of a ScanConfig.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ScanConfig updateScanConfig( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest request) { + return blockingUnaryCall( + getChannel(), getUpdateScanConfigMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Start a ScanRun according to the given ScanConfig.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ScanRun startScanRun( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest request) { + return blockingUnaryCall(getChannel(), getStartScanRunMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a ScanRun.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ScanRun getScanRun( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest request) { + return blockingUnaryCall(getChannel(), getGetScanRunMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
+     * stop time.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ListScanRunsResponse listScanRuns( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest request) { + return blockingUnaryCall(getChannel(), getListScanRunsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Stops a ScanRun. The stopped ScanRun is returned.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ScanRun stopScanRun( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest request) { + return blockingUnaryCall(getChannel(), getStopScanRunMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List CrawledUrls under a given ScanRun.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse listCrawledUrls( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest request) { + return blockingUnaryCall(getChannel(), getListCrawledUrlsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets a Finding.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.Finding getFinding( + com.google.cloud.websecurityscanner.v1.GetFindingRequest request) { + return blockingUnaryCall(getChannel(), getGetFindingMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List Findings under a given ScanRun.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ListFindingsResponse listFindings( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest request) { + return blockingUnaryCall(getChannel(), getListFindingsMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List all FindingTypeStats under a given ScanRun.
+     * 
+ */ + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse listFindingTypeStats( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest request) { + return blockingUnaryCall( + getChannel(), getListFindingTypeStatsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Web Security Scanner Service identifies security vulnerabilities in web
+   * applications hosted on Google Cloud. It crawls your application, and
+   * attempts to exercise as many user inputs and event handlers as possible.
+   * 
+ */ + public static final class WebSecurityScannerFutureStub + extends io.grpc.stub.AbstractFutureStub { + private WebSecurityScannerFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected WebSecurityScannerFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new WebSecurityScannerFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates a new ScanConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ScanConfig> + createScanConfig(com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateScanConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes an existing ScanConfig and its child resources.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteScanConfig(com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteScanConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a ScanConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ScanConfig> + getScanConfig(com.google.cloud.websecurityscanner.v1.GetScanConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetScanConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists ScanConfigs under a given project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse> + listScanConfigs(com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListScanConfigsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates a ScanConfig. This method support partial update of a ScanConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ScanConfig> + updateScanConfig(com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateScanConfigMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Start a ScanRun according to the given ScanConfig.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ScanRun> + startScanRun(com.google.cloud.websecurityscanner.v1.StartScanRunRequest request) { + return futureUnaryCall( + getChannel().newCall(getStartScanRunMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a ScanRun.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ScanRun> + getScanRun(com.google.cloud.websecurityscanner.v1.GetScanRunRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetScanRunMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Lists ScanRuns under a given ScanConfig, in descending order of ScanRun
+     * stop time.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse> + listScanRuns(com.google.cloud.websecurityscanner.v1.ListScanRunsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListScanRunsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Stops a ScanRun. The stopped ScanRun is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ScanRun> + stopScanRun(com.google.cloud.websecurityscanner.v1.StopScanRunRequest request) { + return futureUnaryCall( + getChannel().newCall(getStopScanRunMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List CrawledUrls under a given ScanRun.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse> + listCrawledUrls(com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListCrawledUrlsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets a Finding.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.Finding> + getFinding(com.google.cloud.websecurityscanner.v1.GetFindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetFindingMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List Findings under a given ScanRun.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ListFindingsResponse> + listFindings(com.google.cloud.websecurityscanner.v1.ListFindingsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFindingsMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List all FindingTypeStats under a given ScanRun.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse> + listFindingTypeStats( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFindingTypeStatsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_SCAN_CONFIG = 0; + private static final int METHODID_DELETE_SCAN_CONFIG = 1; + private static final int METHODID_GET_SCAN_CONFIG = 2; + private static final int METHODID_LIST_SCAN_CONFIGS = 3; + private static final int METHODID_UPDATE_SCAN_CONFIG = 4; + private static final int METHODID_START_SCAN_RUN = 5; + private static final int METHODID_GET_SCAN_RUN = 6; + private static final int METHODID_LIST_SCAN_RUNS = 7; + private static final int METHODID_STOP_SCAN_RUN = 8; + private static final int METHODID_LIST_CRAWLED_URLS = 9; + private static final int METHODID_GET_FINDING = 10; + private static final int METHODID_LIST_FINDINGS = 11; + private static final int METHODID_LIST_FINDING_TYPE_STATS = 12; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final WebSecurityScannerImplBase serviceImpl; + private final int methodId; + + MethodHandlers(WebSecurityScannerImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_SCAN_CONFIG: + serviceImpl.createScanConfig( + (com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_SCAN_CONFIG: + serviceImpl.deleteScanConfig( + (com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_SCAN_CONFIG: + serviceImpl.getScanConfig( + (com.google.cloud.websecurityscanner.v1.GetScanConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SCAN_CONFIGS: + serviceImpl.listScanConfigs( + (com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse>) + responseObserver); + break; + case METHODID_UPDATE_SCAN_CONFIG: + serviceImpl.updateScanConfig( + (com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_START_SCAN_RUN: + serviceImpl.startScanRun( + (com.google.cloud.websecurityscanner.v1.StartScanRunRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_SCAN_RUN: + serviceImpl.getScanRun( + (com.google.cloud.websecurityscanner.v1.GetScanRunRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_SCAN_RUNS: + serviceImpl.listScanRuns( + (com.google.cloud.websecurityscanner.v1.ListScanRunsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse>) + responseObserver); + break; + case METHODID_STOP_SCAN_RUN: + serviceImpl.stopScanRun( + (com.google.cloud.websecurityscanner.v1.StopScanRunRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_CRAWLED_URLS: + serviceImpl.listCrawledUrls( + (com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse>) + responseObserver); + break; + case METHODID_GET_FINDING: + serviceImpl.getFinding( + (com.google.cloud.websecurityscanner.v1.GetFindingRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_FINDINGS: + serviceImpl.listFindings( + (com.google.cloud.websecurityscanner.v1.ListFindingsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListFindingsResponse>) + responseObserver); + break; + case METHODID_LIST_FINDING_TYPE_STATS: + serviceImpl.listFindingTypeStats( + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class WebSecurityScannerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + WebSecurityScannerBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("WebSecurityScanner"); + } + } + + private static final class WebSecurityScannerFileDescriptorSupplier + extends WebSecurityScannerBaseDescriptorSupplier { + WebSecurityScannerFileDescriptorSupplier() {} + } + + private static final class WebSecurityScannerMethodDescriptorSupplier + extends WebSecurityScannerBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + WebSecurityScannerMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (WebSecurityScannerGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new WebSecurityScannerFileDescriptorSupplier()) + .addMethod(getCreateScanConfigMethod()) + .addMethod(getDeleteScanConfigMethod()) + .addMethod(getGetScanConfigMethod()) + .addMethod(getListScanConfigsMethod()) + .addMethod(getUpdateScanConfigMethod()) + .addMethod(getStartScanRunMethod()) + .addMethod(getGetScanRunMethod()) + .addMethod(getListScanRunsMethod()) + .addMethod(getStopScanRunMethod()) + .addMethod(getListCrawledUrlsMethod()) + .addMethod(getGetFindingMethod()) + .addMethod(getListFindingsMethod()) + .addMethod(getListFindingTypeStatsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 8d791adf..c9961f1c 100644 --- a/pom.xml +++ b/pom.xml @@ -80,6 +80,11 @@ + + com.google.api.grpc + proto-google-cloud-websecurityscanner-v1alpha + 0.81.4-SNAPSHOT + com.google.api.grpc proto-google-cloud-websecurityscanner-v1beta @@ -87,8 +92,8 @@ com.google.api.grpc - proto-google-cloud-websecurityscanner-v1alpha - 0.81.4-SNAPSHOT + proto-google-cloud-websecurityscanner-v1 + 0.81.4-SNAPSHOT com.google.api.grpc @@ -100,6 +105,11 @@ grpc-google-cloud-websecurityscanner-v1beta 0.81.4-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-websecurityscanner-v1 + 0.81.4-SNAPSHOT + com.google.cloud google-cloud-websecurityscanner @@ -203,10 +213,12 @@ - proto-google-cloud-websecurityscanner-v1beta proto-google-cloud-websecurityscanner-v1alpha + proto-google-cloud-websecurityscanner-v1beta + proto-google-cloud-websecurityscanner-v1 grpc-google-cloud-websecurityscanner-v1alpha grpc-google-cloud-websecurityscanner-v1beta + grpc-google-cloud-websecurityscanner-v1 google-cloud-websecurityscanner google-cloud-websecurityscanner-bom diff --git a/proto-google-cloud-websecurityscanner-v1/pom.xml b/proto-google-cloud-websecurityscanner-v1/pom.xml new file mode 100644 index 00000000..c4ca5844 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/pom.xml @@ -0,0 +1,33 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-websecurityscanner-v1 + 0.81.4-SNAPSHOT + proto-google-cloud-websecurityscanner-v1 + PROTO library for proto-google-cloud-websecurityscanner-v1 + + com.google.cloud + google-cloud-websecurityscanner-parent + 0.116.4-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api + api-common + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrl.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrl.java new file mode 100644 index 00000000..2e5ef2c6 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrl.java @@ -0,0 +1,1005 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/crawled_url.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web
+ * Security Scanner Service crawls the web applications, following all links
+ * within the scope of sites, to find the URLs to test against.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.CrawledUrl} + */ +public final class CrawledUrl extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.CrawledUrl) + CrawledUrlOrBuilder { + private static final long serialVersionUID = 0L; + // Use CrawledUrl.newBuilder() to construct. + private CrawledUrl(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CrawledUrl() { + httpMethod_ = ""; + url_ = ""; + body_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CrawledUrl(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CrawledUrl( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + httpMethod_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + url_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + body_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.CrawledUrlProto + .internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.CrawledUrlProto + .internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.CrawledUrl.class, + com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder.class); + } + + public static final int HTTP_METHOD_FIELD_NUMBER = 1; + private volatile java.lang.Object httpMethod_; + /** + * + * + *
+   * Output only. The http method of the request that was used to visit the URL, in
+   * uppercase.
+   * 
+ * + * string http_method = 1; + * + * @return The httpMethod. + */ + @java.lang.Override + public java.lang.String getHttpMethod() { + java.lang.Object ref = httpMethod_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + httpMethod_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The http method of the request that was used to visit the URL, in
+   * uppercase.
+   * 
+ * + * string http_method = 1; + * + * @return The bytes for httpMethod. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHttpMethodBytes() { + java.lang.Object ref = httpMethod_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + httpMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_FIELD_NUMBER = 2; + private volatile java.lang.Object url_; + /** + * + * + *
+   * Output only. The URL that was crawled.
+   * 
+ * + * string url = 2; + * + * @return The url. + */ + @java.lang.Override + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URL that was crawled.
+   * 
+ * + * string url = 2; + * + * @return The bytes for url. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 3; + private volatile java.lang.Object body_; + /** + * + * + *
+   * Output only. The body of the request that was used to visit the URL.
+   * 
+ * + * string body = 3; + * + * @return The body. + */ + @java.lang.Override + public java.lang.String getBody() { + java.lang.Object ref = body_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + body_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The body of the request that was used to visit the URL.
+   * 
+ * + * string body = 3; + * + * @return The bytes for body. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBodyBytes() { + java.lang.Object ref = body_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getHttpMethodBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, httpMethod_); + } + if (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, url_); + } + if (!getBodyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, body_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getHttpMethodBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, httpMethod_); + } + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, url_); + } + if (!getBodyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, body_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.CrawledUrl)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.CrawledUrl other = + (com.google.cloud.websecurityscanner.v1.CrawledUrl) obj; + + if (!getHttpMethod().equals(other.getHttpMethod())) return false; + if (!getUrl().equals(other.getUrl())) return false; + if (!getBody().equals(other.getBody())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HTTP_METHOD_FIELD_NUMBER; + hash = (53 * hash) + getHttpMethod().hashCode(); + hash = (37 * hash) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.websecurityscanner.v1.CrawledUrl prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web
+   * Security Scanner Service crawls the web applications, following all links
+   * within the scope of sites, to find the URLs to test against.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.CrawledUrl} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.CrawledUrl) + com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.CrawledUrlProto + .internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.CrawledUrlProto + .internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.CrawledUrl.class, + com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.CrawledUrl.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + httpMethod_ = ""; + + url_ = ""; + + body_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.CrawledUrlProto + .internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CrawledUrl getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.CrawledUrl.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CrawledUrl build() { + com.google.cloud.websecurityscanner.v1.CrawledUrl result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CrawledUrl buildPartial() { + com.google.cloud.websecurityscanner.v1.CrawledUrl result = + new com.google.cloud.websecurityscanner.v1.CrawledUrl(this); + result.httpMethod_ = httpMethod_; + result.url_ = url_; + result.body_ = body_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.CrawledUrl) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.CrawledUrl) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.CrawledUrl other) { + if (other == com.google.cloud.websecurityscanner.v1.CrawledUrl.getDefaultInstance()) + return this; + if (!other.getHttpMethod().isEmpty()) { + httpMethod_ = other.httpMethod_; + onChanged(); + } + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (!other.getBody().isEmpty()) { + body_ = other.body_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.CrawledUrl parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.CrawledUrl) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object httpMethod_ = ""; + /** + * + * + *
+     * Output only. The http method of the request that was used to visit the URL, in
+     * uppercase.
+     * 
+ * + * string http_method = 1; + * + * @return The httpMethod. + */ + public java.lang.String getHttpMethod() { + java.lang.Object ref = httpMethod_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + httpMethod_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The http method of the request that was used to visit the URL, in
+     * uppercase.
+     * 
+ * + * string http_method = 1; + * + * @return The bytes for httpMethod. + */ + public com.google.protobuf.ByteString getHttpMethodBytes() { + java.lang.Object ref = httpMethod_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + httpMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The http method of the request that was used to visit the URL, in
+     * uppercase.
+     * 
+ * + * string http_method = 1; + * + * @param value The httpMethod to set. + * @return This builder for chaining. + */ + public Builder setHttpMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + httpMethod_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The http method of the request that was used to visit the URL, in
+     * uppercase.
+     * 
+ * + * string http_method = 1; + * + * @return This builder for chaining. + */ + public Builder clearHttpMethod() { + + httpMethod_ = getDefaultInstance().getHttpMethod(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The http method of the request that was used to visit the URL, in
+     * uppercase.
+     * 
+ * + * string http_method = 1; + * + * @param value The bytes for httpMethod to set. + * @return This builder for chaining. + */ + public Builder setHttpMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + httpMethod_ = value; + onChanged(); + return this; + } + + private java.lang.Object url_ = ""; + /** + * + * + *
+     * Output only. The URL that was crawled.
+     * 
+ * + * string url = 2; + * + * @return The url. + */ + public java.lang.String getUrl() { + java.lang.Object ref = url_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + url_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URL that was crawled.
+     * 
+ * + * string url = 2; + * + * @return The bytes for url. + */ + public com.google.protobuf.ByteString getUrlBytes() { + java.lang.Object ref = url_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + url_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URL that was crawled.
+     * 
+ * + * string url = 2; + * + * @param value The url to set. + * @return This builder for chaining. + */ + public Builder setUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + url_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL that was crawled.
+     * 
+ * + * string url = 2; + * + * @return This builder for chaining. + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL that was crawled.
+     * 
+ * + * string url = 2; + * + * @param value The bytes for url to set. + * @return This builder for chaining. + */ + public Builder setUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + url_ = value; + onChanged(); + return this; + } + + private java.lang.Object body_ = ""; + /** + * + * + *
+     * Output only. The body of the request that was used to visit the URL.
+     * 
+ * + * string body = 3; + * + * @return The body. + */ + public java.lang.String getBody() { + java.lang.Object ref = body_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + body_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The body of the request that was used to visit the URL.
+     * 
+ * + * string body = 3; + * + * @return The bytes for body. + */ + public com.google.protobuf.ByteString getBodyBytes() { + java.lang.Object ref = body_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The body of the request that was used to visit the URL.
+     * 
+ * + * string body = 3; + * + * @param value The body to set. + * @return This builder for chaining. + */ + public Builder setBody(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The body of the request that was used to visit the URL.
+     * 
+ * + * string body = 3; + * + * @return This builder for chaining. + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The body of the request that was used to visit the URL.
+     * 
+ * + * string body = 3; + * + * @param value The bytes for body to set. + * @return This builder for chaining. + */ + public Builder setBodyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + body_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.CrawledUrl) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.CrawledUrl) + private static final com.google.cloud.websecurityscanner.v1.CrawledUrl DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.CrawledUrl(); + } + + public static com.google.cloud.websecurityscanner.v1.CrawledUrl getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CrawledUrl parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CrawledUrl(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CrawledUrl getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrlOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrlOrBuilder.java new file mode 100644 index 00000000..b72ebfe7 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrlOrBuilder.java @@ -0,0 +1,102 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/crawled_url.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface CrawledUrlOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.CrawledUrl) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The http method of the request that was used to visit the URL, in
+   * uppercase.
+   * 
+ * + * string http_method = 1; + * + * @return The httpMethod. + */ + java.lang.String getHttpMethod(); + /** + * + * + *
+   * Output only. The http method of the request that was used to visit the URL, in
+   * uppercase.
+   * 
+ * + * string http_method = 1; + * + * @return The bytes for httpMethod. + */ + com.google.protobuf.ByteString getHttpMethodBytes(); + + /** + * + * + *
+   * Output only. The URL that was crawled.
+   * 
+ * + * string url = 2; + * + * @return The url. + */ + java.lang.String getUrl(); + /** + * + * + *
+   * Output only. The URL that was crawled.
+   * 
+ * + * string url = 2; + * + * @return The bytes for url. + */ + com.google.protobuf.ByteString getUrlBytes(); + + /** + * + * + *
+   * Output only. The body of the request that was used to visit the URL.
+   * 
+ * + * string body = 3; + * + * @return The body. + */ + java.lang.String getBody(); + /** + * + * + *
+   * Output only. The body of the request that was used to visit the URL.
+   * 
+ * + * string body = 3; + * + * @return The bytes for body. + */ + com.google.protobuf.ByteString getBodyBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrlProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrlProto.java new file mode 100644 index 00000000..93c140d2 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CrawledUrlProto.java @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/crawled_url.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class CrawledUrlProto { + private CrawledUrlProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/websecurityscanner/v1/cra" + + "wled_url.proto\022\"google.cloud.websecurity" + + "scanner.v1\"<\n\nCrawledUrl\022\023\n\013http_method\030" + + "\001 \001(\t\022\013\n\003url\030\002 \001(\t\022\014\n\004body\030\003 \001(\tB\221\001\n&com" + + ".google.cloud.websecurityscanner.v1B\017Cra" + + "wledUrlProtoP\001ZTgoogle.golang.org/genpro" + + "to/googleapis/cloud/websecurityscanner/v" + + "1;websecurityscannerb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_CrawledUrl_descriptor, + new java.lang.String[] { + "HttpMethod", "Url", "Body", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CreateScanConfigRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CreateScanConfigRequest.java new file mode 100644 index 00000000..1e2c309f --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CreateScanConfigRequest.java @@ -0,0 +1,929 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `CreateScanConfig` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.CreateScanConfigRequest} + */ +public final class CreateScanConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + CreateScanConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateScanConfigRequest.newBuilder() to construct. + private CreateScanConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateScanConfigRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateScanConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateScanConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder subBuilder = null; + if (scanConfig_ != null) { + subBuilder = scanConfig_.toBuilder(); + } + scanConfig_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scanConfig_); + scanConfig_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name where the scan is created, which should be a
+   * project resource name in the format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name where the scan is created, which should be a
+   * project resource name in the format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SCAN_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.websecurityscanner.v1.ScanConfig scanConfig_; + /** + * + * + *
+   * Required. The ScanConfig to be created.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return Whether the scanConfig field is set. + */ + @java.lang.Override + public boolean hasScanConfig() { + return scanConfig_ != null; + } + /** + * + * + *
+   * Required. The ScanConfig to be created.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return The scanConfig. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig() { + return scanConfig_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance() + : scanConfig_; + } + /** + * + * + *
+   * Required. The ScanConfig to be created.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigOrBuilder() { + return getScanConfig(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (scanConfig_ != null) { + output.writeMessage(2, getScanConfig()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (scanConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getScanConfig()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest other = + (com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasScanConfig() != other.hasScanConfig()) return false; + if (hasScanConfig()) { + if (!getScanConfig().equals(other.getScanConfig())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasScanConfig()) { + hash = (37 * hash) + SCAN_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getScanConfig().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `CreateScanConfig` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.CreateScanConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (scanConfigBuilder_ == null) { + scanConfig_ = null; + } else { + scanConfig_ = null; + scanConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest build() { + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest result = + new com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest(this); + result.parent_ = parent_; + if (scanConfigBuilder_ == null) { + result.scanConfig_ = scanConfig_; + } else { + result.scanConfig_ = scanConfigBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest other) { + if (other + == com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasScanConfig()) { + mergeScanConfig(other.getScanConfig()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name where the scan is created, which should be a
+     * project resource name in the format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name where the scan is created, which should be a
+     * project resource name in the format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name where the scan is created, which should be a
+     * project resource name in the format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name where the scan is created, which should be a
+     * project resource name in the format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name where the scan is created, which should be a
+     * project resource name in the format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.cloud.websecurityscanner.v1.ScanConfig scanConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder> + scanConfigBuilder_; + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return Whether the scanConfig field is set. + */ + public boolean hasScanConfig() { + return scanConfigBuilder_ != null || scanConfig_ != null; + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return The scanConfig. + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig() { + if (scanConfigBuilder_ == null) { + return scanConfig_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance() + : scanConfig_; + } else { + return scanConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder setScanConfig(com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scanConfig_ = value; + onChanged(); + } else { + scanConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder setScanConfig( + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder builderForValue) { + if (scanConfigBuilder_ == null) { + scanConfig_ = builderForValue.build(); + onChanged(); + } else { + scanConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder mergeScanConfig(com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigBuilder_ == null) { + if (scanConfig_ != null) { + scanConfig_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.newBuilder(scanConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + scanConfig_ = value; + } + onChanged(); + } else { + scanConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder clearScanConfig() { + if (scanConfigBuilder_ == null) { + scanConfig_ = null; + onChanged(); + } else { + scanConfig_ = null; + scanConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Builder getScanConfigBuilder() { + + onChanged(); + return getScanConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigOrBuilder() { + if (scanConfigBuilder_ != null) { + return scanConfigBuilder_.getMessageOrBuilder(); + } else { + return scanConfig_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance() + : scanConfig_; + } + } + /** + * + * + *
+     * Required. The ScanConfig to be created.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder> + getScanConfigFieldBuilder() { + if (scanConfigBuilder_ == null) { + scanConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder>( + getScanConfig(), getParentForChildren(), isClean()); + scanConfig_ = null; + } + return scanConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + private static final com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateScanConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateScanConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CreateScanConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CreateScanConfigRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CreateScanConfigRequestOrBuilder.java new file mode 100644 index 00000000..65bbadbe --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/CreateScanConfigRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface CreateScanConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.CreateScanConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name where the scan is created, which should be a
+   * project resource name in the format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name where the scan is created, which should be a
+   * project resource name in the format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ScanConfig to be created.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return Whether the scanConfig field is set. + */ + boolean hasScanConfig(); + /** + * + * + *
+   * Required. The ScanConfig to be created.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return The scanConfig. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig(); + /** + * + * + *
+   * Required. The ScanConfig to be created.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigOrBuilder(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/DeleteScanConfigRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/DeleteScanConfigRequest.java new file mode 100644 index 00000000..0d710640 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/DeleteScanConfigRequest.java @@ -0,0 +1,650 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `DeleteScanConfig` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} + */ +public final class DeleteScanConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + DeleteScanConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteScanConfigRequest.newBuilder() to construct. + private DeleteScanConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteScanConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteScanConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteScanConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be deleted. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be deleted. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest other = + (com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `DeleteScanConfig` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.DeleteScanConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest build() { + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest result = + new com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest other) { + if (other + == com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be deleted. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be deleted. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be deleted. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be deleted. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be deleted. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + private static final com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteScanConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteScanConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/DeleteScanConfigRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/DeleteScanConfigRequestOrBuilder.java new file mode 100644 index 00000000..06f88c17 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/DeleteScanConfigRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface DeleteScanConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.DeleteScanConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be deleted. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be deleted. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/Finding.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/Finding.java new file mode 100644 index 00000000..55ad7974 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/Finding.java @@ -0,0 +1,4421 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * A Finding resource represents a vulnerability instance identified during a
+ * ScanRun.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.Finding} + */ +public final class Finding extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.Finding) + FindingOrBuilder { + private static final long serialVersionUID = 0L; + // Use Finding.newBuilder() to construct. + private Finding(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Finding() { + name_ = ""; + findingType_ = ""; + severity_ = 0; + httpMethod_ = ""; + fuzzedUrl_ = ""; + body_ = ""; + description_ = ""; + reproductionUrl_ = ""; + frameUrl_ = ""; + finalUrl_ = ""; + trackingId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Finding(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Finding( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + findingType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + httpMethod_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + fuzzedUrl_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + body_ = s; + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + + reproductionUrl_ = s; + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + frameUrl_ = s; + break; + } + case 74: + { + java.lang.String s = input.readStringRequireUtf8(); + + finalUrl_ = s; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + + trackingId_ = s; + break; + } + case 90: + { + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder subBuilder = null; + if (outdatedLibrary_ != null) { + subBuilder = outdatedLibrary_.toBuilder(); + } + outdatedLibrary_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outdatedLibrary_); + outdatedLibrary_ = subBuilder.buildPartial(); + } + + break; + } + case 98: + { + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder subBuilder = null; + if (violatingResource_ != null) { + subBuilder = violatingResource_.toBuilder(); + } + violatingResource_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ViolatingResource.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(violatingResource_); + violatingResource_ = subBuilder.buildPartial(); + } + + break; + } + case 106: + { + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder subBuilder = null; + if (vulnerableParameters_ != null) { + subBuilder = vulnerableParameters_.toBuilder(); + } + vulnerableParameters_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.VulnerableParameters.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(vulnerableParameters_); + vulnerableParameters_ = subBuilder.buildPartial(); + } + + break; + } + case 114: + { + com.google.cloud.websecurityscanner.v1.Xss.Builder subBuilder = null; + if (xss_ != null) { + subBuilder = xss_.toBuilder(); + } + xss_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.Xss.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(xss_); + xss_ = subBuilder.buildPartial(); + } + + break; + } + case 122: + { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder subBuilder = null; + if (vulnerableHeaders_ != null) { + subBuilder = vulnerableHeaders_.toBuilder(); + } + vulnerableHeaders_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(vulnerableHeaders_); + vulnerableHeaders_ = subBuilder.buildPartial(); + } + + break; + } + case 130: + { + com.google.cloud.websecurityscanner.v1.Form.Builder subBuilder = null; + if (form_ != null) { + subBuilder = form_.toBuilder(); + } + form_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.Form.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(form_); + form_ = subBuilder.buildPartial(); + } + + break; + } + case 136: + { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingProto + .internal_static_google_cloud_websecurityscanner_v1_Finding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingProto + .internal_static_google_cloud_websecurityscanner_v1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.Finding.class, + com.google.cloud.websecurityscanner.v1.Finding.Builder.class); + } + + /** + * + * + *
+   * The severity level of a vulnerability.
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.Finding.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No severity specified. The default value.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+     * Critical severity.
+     * 
+ * + * CRITICAL = 1; + */ + CRITICAL(1), + /** + * + * + *
+     * High severity.
+     * 
+ * + * HIGH = 2; + */ + HIGH(2), + /** + * + * + *
+     * Medium severity.
+     * 
+ * + * MEDIUM = 3; + */ + MEDIUM(3), + /** + * + * + *
+     * Low severity.
+     * 
+ * + * LOW = 4; + */ + LOW(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No severity specified. The default value.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Critical severity.
+     * 
+ * + * CRITICAL = 1; + */ + public static final int CRITICAL_VALUE = 1; + /** + * + * + *
+     * High severity.
+     * 
+ * + * HIGH = 2; + */ + public static final int HIGH_VALUE = 2; + /** + * + * + *
+     * Medium severity.
+     * 
+ * + * MEDIUM = 3; + */ + public static final int MEDIUM_VALUE = 3; + /** + * + * + *
+     * Low severity.
+     * 
+ * + * LOW = 4; + */ + public static final int LOW_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return CRITICAL; + case 2: + return HIGH; + case 3: + return MEDIUM; + case 4: + return LOW; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.Finding.getDescriptor().getEnumTypes().get(0); + } + + private static final Severity[] VALUES = values(); + + public static Severity valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.Finding.Severity) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the Finding. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+   * The finding IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the Finding. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+   * The finding IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINDING_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object findingType_; + /** + * + * + *
+   * Output only. The type of the Finding.
+   * Detailed and up-to-date information on findings can be found here:
+   * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+   * 
+ * + * string finding_type = 2; + * + * @return The findingType. + */ + @java.lang.Override + public java.lang.String getFindingType() { + java.lang.Object ref = findingType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingType_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The type of the Finding.
+   * Detailed and up-to-date information on findings can be found here:
+   * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+   * 
+ * + * string finding_type = 2; + * + * @return The bytes for findingType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFindingTypeBytes() { + java.lang.Object ref = findingType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SEVERITY_FIELD_NUMBER = 17; + private int severity_; + /** + * + * + *
+   * Output only. The severity level of the reported vulnerability.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Output only. The severity level of the reported vulnerability.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.Finding.Severity result = + com.google.cloud.websecurityscanner.v1.Finding.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.websecurityscanner.v1.Finding.Severity.UNRECOGNIZED + : result; + } + + public static final int HTTP_METHOD_FIELD_NUMBER = 3; + private volatile java.lang.Object httpMethod_; + /** + * + * + *
+   * Output only. The http method of the request that triggered the vulnerability, in
+   * uppercase.
+   * 
+ * + * string http_method = 3; + * + * @return The httpMethod. + */ + @java.lang.Override + public java.lang.String getHttpMethod() { + java.lang.Object ref = httpMethod_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + httpMethod_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The http method of the request that triggered the vulnerability, in
+   * uppercase.
+   * 
+ * + * string http_method = 3; + * + * @return The bytes for httpMethod. + */ + @java.lang.Override + public com.google.protobuf.ByteString getHttpMethodBytes() { + java.lang.Object ref = httpMethod_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + httpMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FUZZED_URL_FIELD_NUMBER = 4; + private volatile java.lang.Object fuzzedUrl_; + /** + * + * + *
+   * Output only. The URL produced by the server-side fuzzer and used in the request that
+   * triggered the vulnerability.
+   * 
+ * + * string fuzzed_url = 4; + * + * @return The fuzzedUrl. + */ + @java.lang.Override + public java.lang.String getFuzzedUrl() { + java.lang.Object ref = fuzzedUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fuzzedUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URL produced by the server-side fuzzer and used in the request that
+   * triggered the vulnerability.
+   * 
+ * + * string fuzzed_url = 4; + * + * @return The bytes for fuzzedUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFuzzedUrlBytes() { + java.lang.Object ref = fuzzedUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fuzzedUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BODY_FIELD_NUMBER = 5; + private volatile java.lang.Object body_; + /** + * + * + *
+   * Output only. The body of the request that triggered the vulnerability.
+   * 
+ * + * string body = 5; + * + * @return The body. + */ + @java.lang.Override + public java.lang.String getBody() { + java.lang.Object ref = body_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + body_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The body of the request that triggered the vulnerability.
+   * 
+ * + * string body = 5; + * + * @return The bytes for body. + */ + @java.lang.Override + public com.google.protobuf.ByteString getBodyBytes() { + java.lang.Object ref = body_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 6; + private volatile java.lang.Object description_; + /** + * + * + *
+   * Output only. The description of the vulnerability.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + @java.lang.Override + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The description of the vulnerability.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REPRODUCTION_URL_FIELD_NUMBER = 7; + private volatile java.lang.Object reproductionUrl_; + /** + * + * + *
+   * Output only. The URL containing human-readable payload that user can leverage to
+   * reproduce the vulnerability.
+   * 
+ * + * string reproduction_url = 7; + * + * @return The reproductionUrl. + */ + @java.lang.Override + public java.lang.String getReproductionUrl() { + java.lang.Object ref = reproductionUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reproductionUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URL containing human-readable payload that user can leverage to
+   * reproduce the vulnerability.
+   * 
+ * + * string reproduction_url = 7; + * + * @return The bytes for reproductionUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getReproductionUrlBytes() { + java.lang.Object ref = reproductionUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reproductionUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FRAME_URL_FIELD_NUMBER = 8; + private volatile java.lang.Object frameUrl_; + /** + * + * + *
+   * Output only. If the vulnerability was originated from nested IFrame, the immediate
+   * parent IFrame is reported.
+   * 
+ * + * string frame_url = 8; + * + * @return The frameUrl. + */ + @java.lang.Override + public java.lang.String getFrameUrl() { + java.lang.Object ref = frameUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + frameUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. If the vulnerability was originated from nested IFrame, the immediate
+   * parent IFrame is reported.
+   * 
+ * + * string frame_url = 8; + * + * @return The bytes for frameUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFrameUrlBytes() { + java.lang.Object ref = frameUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + frameUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINAL_URL_FIELD_NUMBER = 9; + private volatile java.lang.Object finalUrl_; + /** + * + * + *
+   * Output only. The URL where the browser lands when the vulnerability is detected.
+   * 
+ * + * string final_url = 9; + * + * @return The finalUrl. + */ + @java.lang.Override + public java.lang.String getFinalUrl() { + java.lang.Object ref = finalUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalUrl_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URL where the browser lands when the vulnerability is detected.
+   * 
+ * + * string final_url = 9; + * + * @return The bytes for finalUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFinalUrlBytes() { + java.lang.Object ref = finalUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRACKING_ID_FIELD_NUMBER = 10; + private volatile java.lang.Object trackingId_; + /** + * + * + *
+   * Output only. The tracking ID uniquely identifies a vulnerability instance across
+   * multiple ScanRuns.
+   * 
+ * + * string tracking_id = 10; + * + * @return The trackingId. + */ + @java.lang.Override + public java.lang.String getTrackingId() { + java.lang.Object ref = trackingId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trackingId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The tracking ID uniquely identifies a vulnerability instance across
+   * multiple ScanRuns.
+   * 
+ * + * string tracking_id = 10; + * + * @return The bytes for trackingId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTrackingIdBytes() { + java.lang.Object ref = trackingId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trackingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORM_FIELD_NUMBER = 16; + private com.google.cloud.websecurityscanner.v1.Form form_; + /** + * + * + *
+   * Output only. An addon containing information reported for a vulnerability with an HTML
+   * form, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + * + * @return Whether the form field is set. + */ + @java.lang.Override + public boolean hasForm() { + return form_ != null; + } + /** + * + * + *
+   * Output only. An addon containing information reported for a vulnerability with an HTML
+   * form, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + * + * @return The form. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Form getForm() { + return form_ == null ? com.google.cloud.websecurityscanner.v1.Form.getDefaultInstance() : form_; + } + /** + * + * + *
+   * Output only. An addon containing information reported for a vulnerability with an HTML
+   * form, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FormOrBuilder getFormOrBuilder() { + return getForm(); + } + + public static final int OUTDATED_LIBRARY_FIELD_NUMBER = 11; + private com.google.cloud.websecurityscanner.v1.OutdatedLibrary outdatedLibrary_; + /** + * + * + *
+   * Output only. An addon containing information about outdated libraries.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + * + * @return Whether the outdatedLibrary field is set. + */ + @java.lang.Override + public boolean hasOutdatedLibrary() { + return outdatedLibrary_ != null; + } + /** + * + * + *
+   * Output only. An addon containing information about outdated libraries.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + * + * @return The outdatedLibrary. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary getOutdatedLibrary() { + return outdatedLibrary_ == null + ? com.google.cloud.websecurityscanner.v1.OutdatedLibrary.getDefaultInstance() + : outdatedLibrary_; + } + /** + * + * + *
+   * Output only. An addon containing information about outdated libraries.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder + getOutdatedLibraryOrBuilder() { + return getOutdatedLibrary(); + } + + public static final int VIOLATING_RESOURCE_FIELD_NUMBER = 12; + private com.google.cloud.websecurityscanner.v1.ViolatingResource violatingResource_; + /** + * + * + *
+   * Output only. An addon containing detailed information regarding any resource causing the
+   * vulnerability such as JavaScript sources, image, audio files, etc.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + * + * @return Whether the violatingResource field is set. + */ + @java.lang.Override + public boolean hasViolatingResource() { + return violatingResource_ != null; + } + /** + * + * + *
+   * Output only. An addon containing detailed information regarding any resource causing the
+   * vulnerability such as JavaScript sources, image, audio files, etc.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + * + * @return The violatingResource. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ViolatingResource getViolatingResource() { + return violatingResource_ == null + ? com.google.cloud.websecurityscanner.v1.ViolatingResource.getDefaultInstance() + : violatingResource_; + } + /** + * + * + *
+   * Output only. An addon containing detailed information regarding any resource causing the
+   * vulnerability such as JavaScript sources, image, audio files, etc.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder + getViolatingResourceOrBuilder() { + return getViolatingResource(); + } + + public static final int VULNERABLE_HEADERS_FIELD_NUMBER = 15; + private com.google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerableHeaders_; + /** + * + * + *
+   * Output only. An addon containing information about vulnerable or missing HTTP headers.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + * + * @return Whether the vulnerableHeaders field is set. + */ + @java.lang.Override + public boolean hasVulnerableHeaders() { + return vulnerableHeaders_ != null; + } + /** + * + * + *
+   * Output only. An addon containing information about vulnerable or missing HTTP headers.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + * + * @return The vulnerableHeaders. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders getVulnerableHeaders() { + return vulnerableHeaders_ == null + ? com.google.cloud.websecurityscanner.v1.VulnerableHeaders.getDefaultInstance() + : vulnerableHeaders_; + } + /** + * + * + *
+   * Output only. An addon containing information about vulnerable or missing HTTP headers.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder + getVulnerableHeadersOrBuilder() { + return getVulnerableHeaders(); + } + + public static final int VULNERABLE_PARAMETERS_FIELD_NUMBER = 13; + private com.google.cloud.websecurityscanner.v1.VulnerableParameters vulnerableParameters_; + /** + * + * + *
+   * Output only. An addon containing information about request parameters which were found
+   * to be vulnerable.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + * + * @return Whether the vulnerableParameters field is set. + */ + @java.lang.Override + public boolean hasVulnerableParameters() { + return vulnerableParameters_ != null; + } + /** + * + * + *
+   * Output only. An addon containing information about request parameters which were found
+   * to be vulnerable.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + * + * @return The vulnerableParameters. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableParameters getVulnerableParameters() { + return vulnerableParameters_ == null + ? com.google.cloud.websecurityscanner.v1.VulnerableParameters.getDefaultInstance() + : vulnerableParameters_; + } + /** + * + * + *
+   * Output only. An addon containing information about request parameters which were found
+   * to be vulnerable.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder + getVulnerableParametersOrBuilder() { + return getVulnerableParameters(); + } + + public static final int XSS_FIELD_NUMBER = 14; + private com.google.cloud.websecurityscanner.v1.Xss xss_; + /** + * + * + *
+   * Output only. An addon containing information reported for an XSS, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + * + * @return Whether the xss field is set. + */ + @java.lang.Override + public boolean hasXss() { + return xss_ != null; + } + /** + * + * + *
+   * Output only. An addon containing information reported for an XSS, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + * + * @return The xss. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss getXss() { + return xss_ == null ? com.google.cloud.websecurityscanner.v1.Xss.getDefaultInstance() : xss_; + } + /** + * + * + *
+   * Output only. An addon containing information reported for an XSS, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.XssOrBuilder getXssOrBuilder() { + return getXss(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getFindingTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, findingType_); + } + if (!getHttpMethodBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, httpMethod_); + } + if (!getFuzzedUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fuzzedUrl_); + } + if (!getBodyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, body_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, description_); + } + if (!getReproductionUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, reproductionUrl_); + } + if (!getFrameUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, frameUrl_); + } + if (!getFinalUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 9, finalUrl_); + } + if (!getTrackingIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, trackingId_); + } + if (outdatedLibrary_ != null) { + output.writeMessage(11, getOutdatedLibrary()); + } + if (violatingResource_ != null) { + output.writeMessage(12, getViolatingResource()); + } + if (vulnerableParameters_ != null) { + output.writeMessage(13, getVulnerableParameters()); + } + if (xss_ != null) { + output.writeMessage(14, getXss()); + } + if (vulnerableHeaders_ != null) { + output.writeMessage(15, getVulnerableHeaders()); + } + if (form_ != null) { + output.writeMessage(16, getForm()); + } + if (severity_ + != com.google.cloud.websecurityscanner.v1.Finding.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(17, severity_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getFindingTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, findingType_); + } + if (!getHttpMethodBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, httpMethod_); + } + if (!getFuzzedUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, fuzzedUrl_); + } + if (!getBodyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, body_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, description_); + } + if (!getReproductionUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, reproductionUrl_); + } + if (!getFrameUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, frameUrl_); + } + if (!getFinalUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(9, finalUrl_); + } + if (!getTrackingIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, trackingId_); + } + if (outdatedLibrary_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getOutdatedLibrary()); + } + if (violatingResource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(12, getViolatingResource()); + } + if (vulnerableParameters_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(13, getVulnerableParameters()); + } + if (xss_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getXss()); + } + if (vulnerableHeaders_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, getVulnerableHeaders()); + } + if (form_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, getForm()); + } + if (severity_ + != com.google.cloud.websecurityscanner.v1.Finding.Severity.SEVERITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(17, severity_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.Finding)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.Finding other = + (com.google.cloud.websecurityscanner.v1.Finding) obj; + + if (!getName().equals(other.getName())) return false; + if (!getFindingType().equals(other.getFindingType())) return false; + if (severity_ != other.severity_) return false; + if (!getHttpMethod().equals(other.getHttpMethod())) return false; + if (!getFuzzedUrl().equals(other.getFuzzedUrl())) return false; + if (!getBody().equals(other.getBody())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getReproductionUrl().equals(other.getReproductionUrl())) return false; + if (!getFrameUrl().equals(other.getFrameUrl())) return false; + if (!getFinalUrl().equals(other.getFinalUrl())) return false; + if (!getTrackingId().equals(other.getTrackingId())) return false; + if (hasForm() != other.hasForm()) return false; + if (hasForm()) { + if (!getForm().equals(other.getForm())) return false; + } + if (hasOutdatedLibrary() != other.hasOutdatedLibrary()) return false; + if (hasOutdatedLibrary()) { + if (!getOutdatedLibrary().equals(other.getOutdatedLibrary())) return false; + } + if (hasViolatingResource() != other.hasViolatingResource()) return false; + if (hasViolatingResource()) { + if (!getViolatingResource().equals(other.getViolatingResource())) return false; + } + if (hasVulnerableHeaders() != other.hasVulnerableHeaders()) return false; + if (hasVulnerableHeaders()) { + if (!getVulnerableHeaders().equals(other.getVulnerableHeaders())) return false; + } + if (hasVulnerableParameters() != other.hasVulnerableParameters()) return false; + if (hasVulnerableParameters()) { + if (!getVulnerableParameters().equals(other.getVulnerableParameters())) return false; + } + if (hasXss() != other.hasXss()) return false; + if (hasXss()) { + if (!getXss().equals(other.getXss())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + FINDING_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFindingType().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + HTTP_METHOD_FIELD_NUMBER; + hash = (53 * hash) + getHttpMethod().hashCode(); + hash = (37 * hash) + FUZZED_URL_FIELD_NUMBER; + hash = (53 * hash) + getFuzzedUrl().hashCode(); + hash = (37 * hash) + BODY_FIELD_NUMBER; + hash = (53 * hash) + getBody().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + hash = (37 * hash) + REPRODUCTION_URL_FIELD_NUMBER; + hash = (53 * hash) + getReproductionUrl().hashCode(); + hash = (37 * hash) + FRAME_URL_FIELD_NUMBER; + hash = (53 * hash) + getFrameUrl().hashCode(); + hash = (37 * hash) + FINAL_URL_FIELD_NUMBER; + hash = (53 * hash) + getFinalUrl().hashCode(); + hash = (37 * hash) + TRACKING_ID_FIELD_NUMBER; + hash = (53 * hash) + getTrackingId().hashCode(); + if (hasForm()) { + hash = (37 * hash) + FORM_FIELD_NUMBER; + hash = (53 * hash) + getForm().hashCode(); + } + if (hasOutdatedLibrary()) { + hash = (37 * hash) + OUTDATED_LIBRARY_FIELD_NUMBER; + hash = (53 * hash) + getOutdatedLibrary().hashCode(); + } + if (hasViolatingResource()) { + hash = (37 * hash) + VIOLATING_RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getViolatingResource().hashCode(); + } + if (hasVulnerableHeaders()) { + hash = (37 * hash) + VULNERABLE_HEADERS_FIELD_NUMBER; + hash = (53 * hash) + getVulnerableHeaders().hashCode(); + } + if (hasVulnerableParameters()) { + hash = (37 * hash) + VULNERABLE_PARAMETERS_FIELD_NUMBER; + hash = (53 * hash) + getVulnerableParameters().hashCode(); + } + if (hasXss()) { + hash = (37 * hash) + XSS_FIELD_NUMBER; + hash = (53 * hash) + getXss().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Finding parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.websecurityscanner.v1.Finding prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Finding resource represents a vulnerability instance identified during a
+   * ScanRun.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.Finding} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.Finding) + com.google.cloud.websecurityscanner.v1.FindingOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingProto + .internal_static_google_cloud_websecurityscanner_v1_Finding_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingProto + .internal_static_google_cloud_websecurityscanner_v1_Finding_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.Finding.class, + com.google.cloud.websecurityscanner.v1.Finding.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.Finding.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + findingType_ = ""; + + severity_ = 0; + + httpMethod_ = ""; + + fuzzedUrl_ = ""; + + body_ = ""; + + description_ = ""; + + reproductionUrl_ = ""; + + frameUrl_ = ""; + + finalUrl_ = ""; + + trackingId_ = ""; + + if (formBuilder_ == null) { + form_ = null; + } else { + form_ = null; + formBuilder_ = null; + } + if (outdatedLibraryBuilder_ == null) { + outdatedLibrary_ = null; + } else { + outdatedLibrary_ = null; + outdatedLibraryBuilder_ = null; + } + if (violatingResourceBuilder_ == null) { + violatingResource_ = null; + } else { + violatingResource_ = null; + violatingResourceBuilder_ = null; + } + if (vulnerableHeadersBuilder_ == null) { + vulnerableHeaders_ = null; + } else { + vulnerableHeaders_ = null; + vulnerableHeadersBuilder_ = null; + } + if (vulnerableParametersBuilder_ == null) { + vulnerableParameters_ = null; + } else { + vulnerableParameters_ = null; + vulnerableParametersBuilder_ = null; + } + if (xssBuilder_ == null) { + xss_ = null; + } else { + xss_ = null; + xssBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingProto + .internal_static_google_cloud_websecurityscanner_v1_Finding_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.Finding.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding build() { + com.google.cloud.websecurityscanner.v1.Finding result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding buildPartial() { + com.google.cloud.websecurityscanner.v1.Finding result = + new com.google.cloud.websecurityscanner.v1.Finding(this); + result.name_ = name_; + result.findingType_ = findingType_; + result.severity_ = severity_; + result.httpMethod_ = httpMethod_; + result.fuzzedUrl_ = fuzzedUrl_; + result.body_ = body_; + result.description_ = description_; + result.reproductionUrl_ = reproductionUrl_; + result.frameUrl_ = frameUrl_; + result.finalUrl_ = finalUrl_; + result.trackingId_ = trackingId_; + if (formBuilder_ == null) { + result.form_ = form_; + } else { + result.form_ = formBuilder_.build(); + } + if (outdatedLibraryBuilder_ == null) { + result.outdatedLibrary_ = outdatedLibrary_; + } else { + result.outdatedLibrary_ = outdatedLibraryBuilder_.build(); + } + if (violatingResourceBuilder_ == null) { + result.violatingResource_ = violatingResource_; + } else { + result.violatingResource_ = violatingResourceBuilder_.build(); + } + if (vulnerableHeadersBuilder_ == null) { + result.vulnerableHeaders_ = vulnerableHeaders_; + } else { + result.vulnerableHeaders_ = vulnerableHeadersBuilder_.build(); + } + if (vulnerableParametersBuilder_ == null) { + result.vulnerableParameters_ = vulnerableParameters_; + } else { + result.vulnerableParameters_ = vulnerableParametersBuilder_.build(); + } + if (xssBuilder_ == null) { + result.xss_ = xss_; + } else { + result.xss_ = xssBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.Finding) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.Finding) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.Finding other) { + if (other == com.google.cloud.websecurityscanner.v1.Finding.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getFindingType().isEmpty()) { + findingType_ = other.findingType_; + onChanged(); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getHttpMethod().isEmpty()) { + httpMethod_ = other.httpMethod_; + onChanged(); + } + if (!other.getFuzzedUrl().isEmpty()) { + fuzzedUrl_ = other.fuzzedUrl_; + onChanged(); + } + if (!other.getBody().isEmpty()) { + body_ = other.body_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (!other.getReproductionUrl().isEmpty()) { + reproductionUrl_ = other.reproductionUrl_; + onChanged(); + } + if (!other.getFrameUrl().isEmpty()) { + frameUrl_ = other.frameUrl_; + onChanged(); + } + if (!other.getFinalUrl().isEmpty()) { + finalUrl_ = other.finalUrl_; + onChanged(); + } + if (!other.getTrackingId().isEmpty()) { + trackingId_ = other.trackingId_; + onChanged(); + } + if (other.hasForm()) { + mergeForm(other.getForm()); + } + if (other.hasOutdatedLibrary()) { + mergeOutdatedLibrary(other.getOutdatedLibrary()); + } + if (other.hasViolatingResource()) { + mergeViolatingResource(other.getViolatingResource()); + } + if (other.hasVulnerableHeaders()) { + mergeVulnerableHeaders(other.getVulnerableHeaders()); + } + if (other.hasVulnerableParameters()) { + mergeVulnerableParameters(other.getVulnerableParameters()); + } + if (other.hasXss()) { + mergeXss(other.getXss()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.Finding parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.websecurityscanner.v1.Finding) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the Finding. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+     * The finding IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Finding. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+     * The finding IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the Finding. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+     * The finding IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Finding. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+     * The finding IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the Finding. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+     * The finding IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object findingType_ = ""; + /** + * + * + *
+     * Output only. The type of the Finding.
+     * Detailed and up-to-date information on findings can be found here:
+     * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+     * 
+ * + * string finding_type = 2; + * + * @return The findingType. + */ + public java.lang.String getFindingType() { + java.lang.Object ref = findingType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The type of the Finding.
+     * Detailed and up-to-date information on findings can be found here:
+     * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+     * 
+ * + * string finding_type = 2; + * + * @return The bytes for findingType. + */ + public com.google.protobuf.ByteString getFindingTypeBytes() { + java.lang.Object ref = findingType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The type of the Finding.
+     * Detailed and up-to-date information on findings can be found here:
+     * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+     * 
+ * + * string finding_type = 2; + * + * @param value The findingType to set. + * @return This builder for chaining. + */ + public Builder setFindingType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + findingType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the Finding.
+     * Detailed and up-to-date information on findings can be found here:
+     * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+     * 
+ * + * string finding_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearFindingType() { + + findingType_ = getDefaultInstance().getFindingType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The type of the Finding.
+     * Detailed and up-to-date information on findings can be found here:
+     * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+     * 
+ * + * string finding_type = 2; + * + * @param value The bytes for findingType to set. + * @return This builder for chaining. + */ + public Builder setFindingTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + findingType_ = value; + onChanged(); + return this; + } + + private int severity_ = 0; + /** + * + * + *
+     * Output only. The severity level of the reported vulnerability.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Output only. The severity level of the reported vulnerability.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The severity level of the reported vulnerability.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding.Severity getSeverity() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.Finding.Severity result = + com.google.cloud.websecurityscanner.v1.Finding.Severity.valueOf(severity_); + return result == null + ? com.google.cloud.websecurityscanner.v1.Finding.Severity.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The severity level of the reported vulnerability.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.cloud.websecurityscanner.v1.Finding.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The severity level of the reported vulnerability.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object httpMethod_ = ""; + /** + * + * + *
+     * Output only. The http method of the request that triggered the vulnerability, in
+     * uppercase.
+     * 
+ * + * string http_method = 3; + * + * @return The httpMethod. + */ + public java.lang.String getHttpMethod() { + java.lang.Object ref = httpMethod_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + httpMethod_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The http method of the request that triggered the vulnerability, in
+     * uppercase.
+     * 
+ * + * string http_method = 3; + * + * @return The bytes for httpMethod. + */ + public com.google.protobuf.ByteString getHttpMethodBytes() { + java.lang.Object ref = httpMethod_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + httpMethod_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The http method of the request that triggered the vulnerability, in
+     * uppercase.
+     * 
+ * + * string http_method = 3; + * + * @param value The httpMethod to set. + * @return This builder for chaining. + */ + public Builder setHttpMethod(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + httpMethod_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The http method of the request that triggered the vulnerability, in
+     * uppercase.
+     * 
+ * + * string http_method = 3; + * + * @return This builder for chaining. + */ + public Builder clearHttpMethod() { + + httpMethod_ = getDefaultInstance().getHttpMethod(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The http method of the request that triggered the vulnerability, in
+     * uppercase.
+     * 
+ * + * string http_method = 3; + * + * @param value The bytes for httpMethod to set. + * @return This builder for chaining. + */ + public Builder setHttpMethodBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + httpMethod_ = value; + onChanged(); + return this; + } + + private java.lang.Object fuzzedUrl_ = ""; + /** + * + * + *
+     * Output only. The URL produced by the server-side fuzzer and used in the request that
+     * triggered the vulnerability.
+     * 
+ * + * string fuzzed_url = 4; + * + * @return The fuzzedUrl. + */ + public java.lang.String getFuzzedUrl() { + java.lang.Object ref = fuzzedUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fuzzedUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URL produced by the server-side fuzzer and used in the request that
+     * triggered the vulnerability.
+     * 
+ * + * string fuzzed_url = 4; + * + * @return The bytes for fuzzedUrl. + */ + public com.google.protobuf.ByteString getFuzzedUrlBytes() { + java.lang.Object ref = fuzzedUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fuzzedUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URL produced by the server-side fuzzer and used in the request that
+     * triggered the vulnerability.
+     * 
+ * + * string fuzzed_url = 4; + * + * @param value The fuzzedUrl to set. + * @return This builder for chaining. + */ + public Builder setFuzzedUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fuzzedUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL produced by the server-side fuzzer and used in the request that
+     * triggered the vulnerability.
+     * 
+ * + * string fuzzed_url = 4; + * + * @return This builder for chaining. + */ + public Builder clearFuzzedUrl() { + + fuzzedUrl_ = getDefaultInstance().getFuzzedUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL produced by the server-side fuzzer and used in the request that
+     * triggered the vulnerability.
+     * 
+ * + * string fuzzed_url = 4; + * + * @param value The bytes for fuzzedUrl to set. + * @return This builder for chaining. + */ + public Builder setFuzzedUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fuzzedUrl_ = value; + onChanged(); + return this; + } + + private java.lang.Object body_ = ""; + /** + * + * + *
+     * Output only. The body of the request that triggered the vulnerability.
+     * 
+ * + * string body = 5; + * + * @return The body. + */ + public java.lang.String getBody() { + java.lang.Object ref = body_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + body_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The body of the request that triggered the vulnerability.
+     * 
+ * + * string body = 5; + * + * @return The bytes for body. + */ + public com.google.protobuf.ByteString getBodyBytes() { + java.lang.Object ref = body_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + body_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The body of the request that triggered the vulnerability.
+     * 
+ * + * string body = 5; + * + * @param value The body to set. + * @return This builder for chaining. + */ + public Builder setBody(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + body_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The body of the request that triggered the vulnerability.
+     * 
+ * + * string body = 5; + * + * @return This builder for chaining. + */ + public Builder clearBody() { + + body_ = getDefaultInstance().getBody(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The body of the request that triggered the vulnerability.
+     * 
+ * + * string body = 5; + * + * @param value The bytes for body to set. + * @return This builder for chaining. + */ + public Builder setBodyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + body_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+     * Output only. The description of the vulnerability.
+     * 
+ * + * string description = 6; + * + * @return The description. + */ + public java.lang.String getDescription() { + java.lang.Object ref = description_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + description_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The description of the vulnerability.
+     * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + public com.google.protobuf.ByteString getDescriptionBytes() { + java.lang.Object ref = description_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + description_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The description of the vulnerability.
+     * 
+ * + * string description = 6; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + description_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description of the vulnerability.
+     * 
+ * + * string description = 6; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The description of the vulnerability.
+     * 
+ * + * string description = 6; + * + * @param value The bytes for description to set. + * @return This builder for chaining. + */ + public Builder setDescriptionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + description_ = value; + onChanged(); + return this; + } + + private java.lang.Object reproductionUrl_ = ""; + /** + * + * + *
+     * Output only. The URL containing human-readable payload that user can leverage to
+     * reproduce the vulnerability.
+     * 
+ * + * string reproduction_url = 7; + * + * @return The reproductionUrl. + */ + public java.lang.String getReproductionUrl() { + java.lang.Object ref = reproductionUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + reproductionUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URL containing human-readable payload that user can leverage to
+     * reproduce the vulnerability.
+     * 
+ * + * string reproduction_url = 7; + * + * @return The bytes for reproductionUrl. + */ + public com.google.protobuf.ByteString getReproductionUrlBytes() { + java.lang.Object ref = reproductionUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + reproductionUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URL containing human-readable payload that user can leverage to
+     * reproduce the vulnerability.
+     * 
+ * + * string reproduction_url = 7; + * + * @param value The reproductionUrl to set. + * @return This builder for chaining. + */ + public Builder setReproductionUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + reproductionUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL containing human-readable payload that user can leverage to
+     * reproduce the vulnerability.
+     * 
+ * + * string reproduction_url = 7; + * + * @return This builder for chaining. + */ + public Builder clearReproductionUrl() { + + reproductionUrl_ = getDefaultInstance().getReproductionUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL containing human-readable payload that user can leverage to
+     * reproduce the vulnerability.
+     * 
+ * + * string reproduction_url = 7; + * + * @param value The bytes for reproductionUrl to set. + * @return This builder for chaining. + */ + public Builder setReproductionUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + reproductionUrl_ = value; + onChanged(); + return this; + } + + private java.lang.Object frameUrl_ = ""; + /** + * + * + *
+     * Output only. If the vulnerability was originated from nested IFrame, the immediate
+     * parent IFrame is reported.
+     * 
+ * + * string frame_url = 8; + * + * @return The frameUrl. + */ + public java.lang.String getFrameUrl() { + java.lang.Object ref = frameUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + frameUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. If the vulnerability was originated from nested IFrame, the immediate
+     * parent IFrame is reported.
+     * 
+ * + * string frame_url = 8; + * + * @return The bytes for frameUrl. + */ + public com.google.protobuf.ByteString getFrameUrlBytes() { + java.lang.Object ref = frameUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + frameUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. If the vulnerability was originated from nested IFrame, the immediate
+     * parent IFrame is reported.
+     * 
+ * + * string frame_url = 8; + * + * @param value The frameUrl to set. + * @return This builder for chaining. + */ + public Builder setFrameUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + frameUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If the vulnerability was originated from nested IFrame, the immediate
+     * parent IFrame is reported.
+     * 
+ * + * string frame_url = 8; + * + * @return This builder for chaining. + */ + public Builder clearFrameUrl() { + + frameUrl_ = getDefaultInstance().getFrameUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If the vulnerability was originated from nested IFrame, the immediate
+     * parent IFrame is reported.
+     * 
+ * + * string frame_url = 8; + * + * @param value The bytes for frameUrl to set. + * @return This builder for chaining. + */ + public Builder setFrameUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + frameUrl_ = value; + onChanged(); + return this; + } + + private java.lang.Object finalUrl_ = ""; + /** + * + * + *
+     * Output only. The URL where the browser lands when the vulnerability is detected.
+     * 
+ * + * string final_url = 9; + * + * @return The finalUrl. + */ + public java.lang.String getFinalUrl() { + java.lang.Object ref = finalUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + finalUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URL where the browser lands when the vulnerability is detected.
+     * 
+ * + * string final_url = 9; + * + * @return The bytes for finalUrl. + */ + public com.google.protobuf.ByteString getFinalUrlBytes() { + java.lang.Object ref = finalUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + finalUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URL where the browser lands when the vulnerability is detected.
+     * 
+ * + * string final_url = 9; + * + * @param value The finalUrl to set. + * @return This builder for chaining. + */ + public Builder setFinalUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + finalUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL where the browser lands when the vulnerability is detected.
+     * 
+ * + * string final_url = 9; + * + * @return This builder for chaining. + */ + public Builder clearFinalUrl() { + + finalUrl_ = getDefaultInstance().getFinalUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URL where the browser lands when the vulnerability is detected.
+     * 
+ * + * string final_url = 9; + * + * @param value The bytes for finalUrl to set. + * @return This builder for chaining. + */ + public Builder setFinalUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + finalUrl_ = value; + onChanged(); + return this; + } + + private java.lang.Object trackingId_ = ""; + /** + * + * + *
+     * Output only. The tracking ID uniquely identifies a vulnerability instance across
+     * multiple ScanRuns.
+     * 
+ * + * string tracking_id = 10; + * + * @return The trackingId. + */ + public java.lang.String getTrackingId() { + java.lang.Object ref = trackingId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + trackingId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The tracking ID uniquely identifies a vulnerability instance across
+     * multiple ScanRuns.
+     * 
+ * + * string tracking_id = 10; + * + * @return The bytes for trackingId. + */ + public com.google.protobuf.ByteString getTrackingIdBytes() { + java.lang.Object ref = trackingId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + trackingId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The tracking ID uniquely identifies a vulnerability instance across
+     * multiple ScanRuns.
+     * 
+ * + * string tracking_id = 10; + * + * @param value The trackingId to set. + * @return This builder for chaining. + */ + public Builder setTrackingId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + trackingId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The tracking ID uniquely identifies a vulnerability instance across
+     * multiple ScanRuns.
+     * 
+ * + * string tracking_id = 10; + * + * @return This builder for chaining. + */ + public Builder clearTrackingId() { + + trackingId_ = getDefaultInstance().getTrackingId(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The tracking ID uniquely identifies a vulnerability instance across
+     * multiple ScanRuns.
+     * 
+ * + * string tracking_id = 10; + * + * @param value The bytes for trackingId to set. + * @return This builder for chaining. + */ + public Builder setTrackingIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + trackingId_ = value; + onChanged(); + return this; + } + + private com.google.cloud.websecurityscanner.v1.Form form_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Form, + com.google.cloud.websecurityscanner.v1.Form.Builder, + com.google.cloud.websecurityscanner.v1.FormOrBuilder> + formBuilder_; + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + * + * @return Whether the form field is set. + */ + public boolean hasForm() { + return formBuilder_ != null || form_ != null; + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + * + * @return The form. + */ + public com.google.cloud.websecurityscanner.v1.Form getForm() { + if (formBuilder_ == null) { + return form_ == null + ? com.google.cloud.websecurityscanner.v1.Form.getDefaultInstance() + : form_; + } else { + return formBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + public Builder setForm(com.google.cloud.websecurityscanner.v1.Form value) { + if (formBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + form_ = value; + onChanged(); + } else { + formBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + public Builder setForm(com.google.cloud.websecurityscanner.v1.Form.Builder builderForValue) { + if (formBuilder_ == null) { + form_ = builderForValue.build(); + onChanged(); + } else { + formBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + public Builder mergeForm(com.google.cloud.websecurityscanner.v1.Form value) { + if (formBuilder_ == null) { + if (form_ != null) { + form_ = + com.google.cloud.websecurityscanner.v1.Form.newBuilder(form_) + .mergeFrom(value) + .buildPartial(); + } else { + form_ = value; + } + onChanged(); + } else { + formBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + public Builder clearForm() { + if (formBuilder_ == null) { + form_ = null; + onChanged(); + } else { + form_ = null; + formBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + public com.google.cloud.websecurityscanner.v1.Form.Builder getFormBuilder() { + + onChanged(); + return getFormFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + public com.google.cloud.websecurityscanner.v1.FormOrBuilder getFormOrBuilder() { + if (formBuilder_ != null) { + return formBuilder_.getMessageOrBuilder(); + } else { + return form_ == null + ? com.google.cloud.websecurityscanner.v1.Form.getDefaultInstance() + : form_; + } + } + /** + * + * + *
+     * Output only. An addon containing information reported for a vulnerability with an HTML
+     * form, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Form, + com.google.cloud.websecurityscanner.v1.Form.Builder, + com.google.cloud.websecurityscanner.v1.FormOrBuilder> + getFormFieldBuilder() { + if (formBuilder_ == null) { + formBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Form, + com.google.cloud.websecurityscanner.v1.Form.Builder, + com.google.cloud.websecurityscanner.v1.FormOrBuilder>( + getForm(), getParentForChildren(), isClean()); + form_ = null; + } + return formBuilder_; + } + + private com.google.cloud.websecurityscanner.v1.OutdatedLibrary outdatedLibrary_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.OutdatedLibrary, + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder, + com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder> + outdatedLibraryBuilder_; + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + * + * @return Whether the outdatedLibrary field is set. + */ + public boolean hasOutdatedLibrary() { + return outdatedLibraryBuilder_ != null || outdatedLibrary_ != null; + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + * + * @return The outdatedLibrary. + */ + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary getOutdatedLibrary() { + if (outdatedLibraryBuilder_ == null) { + return outdatedLibrary_ == null + ? com.google.cloud.websecurityscanner.v1.OutdatedLibrary.getDefaultInstance() + : outdatedLibrary_; + } else { + return outdatedLibraryBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + public Builder setOutdatedLibrary( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary value) { + if (outdatedLibraryBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outdatedLibrary_ = value; + onChanged(); + } else { + outdatedLibraryBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + public Builder setOutdatedLibrary( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder builderForValue) { + if (outdatedLibraryBuilder_ == null) { + outdatedLibrary_ = builderForValue.build(); + onChanged(); + } else { + outdatedLibraryBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + public Builder mergeOutdatedLibrary( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary value) { + if (outdatedLibraryBuilder_ == null) { + if (outdatedLibrary_ != null) { + outdatedLibrary_ = + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.newBuilder(outdatedLibrary_) + .mergeFrom(value) + .buildPartial(); + } else { + outdatedLibrary_ = value; + } + onChanged(); + } else { + outdatedLibraryBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + public Builder clearOutdatedLibrary() { + if (outdatedLibraryBuilder_ == null) { + outdatedLibrary_ = null; + onChanged(); + } else { + outdatedLibrary_ = null; + outdatedLibraryBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder + getOutdatedLibraryBuilder() { + + onChanged(); + return getOutdatedLibraryFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + public com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder + getOutdatedLibraryOrBuilder() { + if (outdatedLibraryBuilder_ != null) { + return outdatedLibraryBuilder_.getMessageOrBuilder(); + } else { + return outdatedLibrary_ == null + ? com.google.cloud.websecurityscanner.v1.OutdatedLibrary.getDefaultInstance() + : outdatedLibrary_; + } + } + /** + * + * + *
+     * Output only. An addon containing information about outdated libraries.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.OutdatedLibrary, + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder, + com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder> + getOutdatedLibraryFieldBuilder() { + if (outdatedLibraryBuilder_ == null) { + outdatedLibraryBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.OutdatedLibrary, + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder, + com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder>( + getOutdatedLibrary(), getParentForChildren(), isClean()); + outdatedLibrary_ = null; + } + return outdatedLibraryBuilder_; + } + + private com.google.cloud.websecurityscanner.v1.ViolatingResource violatingResource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ViolatingResource, + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder, + com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder> + violatingResourceBuilder_; + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + * + * @return Whether the violatingResource field is set. + */ + public boolean hasViolatingResource() { + return violatingResourceBuilder_ != null || violatingResource_ != null; + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + * + * @return The violatingResource. + */ + public com.google.cloud.websecurityscanner.v1.ViolatingResource getViolatingResource() { + if (violatingResourceBuilder_ == null) { + return violatingResource_ == null + ? com.google.cloud.websecurityscanner.v1.ViolatingResource.getDefaultInstance() + : violatingResource_; + } else { + return violatingResourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + public Builder setViolatingResource( + com.google.cloud.websecurityscanner.v1.ViolatingResource value) { + if (violatingResourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + violatingResource_ = value; + onChanged(); + } else { + violatingResourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + public Builder setViolatingResource( + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder builderForValue) { + if (violatingResourceBuilder_ == null) { + violatingResource_ = builderForValue.build(); + onChanged(); + } else { + violatingResourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + public Builder mergeViolatingResource( + com.google.cloud.websecurityscanner.v1.ViolatingResource value) { + if (violatingResourceBuilder_ == null) { + if (violatingResource_ != null) { + violatingResource_ = + com.google.cloud.websecurityscanner.v1.ViolatingResource.newBuilder( + violatingResource_) + .mergeFrom(value) + .buildPartial(); + } else { + violatingResource_ = value; + } + onChanged(); + } else { + violatingResourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + public Builder clearViolatingResource() { + if (violatingResourceBuilder_ == null) { + violatingResource_ = null; + onChanged(); + } else { + violatingResource_ = null; + violatingResourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + public com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder + getViolatingResourceBuilder() { + + onChanged(); + return getViolatingResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + public com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder + getViolatingResourceOrBuilder() { + if (violatingResourceBuilder_ != null) { + return violatingResourceBuilder_.getMessageOrBuilder(); + } else { + return violatingResource_ == null + ? com.google.cloud.websecurityscanner.v1.ViolatingResource.getDefaultInstance() + : violatingResource_; + } + } + /** + * + * + *
+     * Output only. An addon containing detailed information regarding any resource causing the
+     * vulnerability such as JavaScript sources, image, audio files, etc.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ViolatingResource, + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder, + com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder> + getViolatingResourceFieldBuilder() { + if (violatingResourceBuilder_ == null) { + violatingResourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ViolatingResource, + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder, + com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder>( + getViolatingResource(), getParentForChildren(), isClean()); + violatingResource_ = null; + } + return violatingResourceBuilder_; + } + + private com.google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerableHeaders_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder> + vulnerableHeadersBuilder_; + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + * + * @return Whether the vulnerableHeaders field is set. + */ + public boolean hasVulnerableHeaders() { + return vulnerableHeadersBuilder_ != null || vulnerableHeaders_ != null; + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + * + * @return The vulnerableHeaders. + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders getVulnerableHeaders() { + if (vulnerableHeadersBuilder_ == null) { + return vulnerableHeaders_ == null + ? com.google.cloud.websecurityscanner.v1.VulnerableHeaders.getDefaultInstance() + : vulnerableHeaders_; + } else { + return vulnerableHeadersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + public Builder setVulnerableHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders value) { + if (vulnerableHeadersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vulnerableHeaders_ = value; + onChanged(); + } else { + vulnerableHeadersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + public Builder setVulnerableHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder builderForValue) { + if (vulnerableHeadersBuilder_ == null) { + vulnerableHeaders_ = builderForValue.build(); + onChanged(); + } else { + vulnerableHeadersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + public Builder mergeVulnerableHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders value) { + if (vulnerableHeadersBuilder_ == null) { + if (vulnerableHeaders_ != null) { + vulnerableHeaders_ = + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.newBuilder( + vulnerableHeaders_) + .mergeFrom(value) + .buildPartial(); + } else { + vulnerableHeaders_ = value; + } + onChanged(); + } else { + vulnerableHeadersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + public Builder clearVulnerableHeaders() { + if (vulnerableHeadersBuilder_ == null) { + vulnerableHeaders_ = null; + onChanged(); + } else { + vulnerableHeaders_ = null; + vulnerableHeadersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder + getVulnerableHeadersBuilder() { + + onChanged(); + return getVulnerableHeadersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder + getVulnerableHeadersOrBuilder() { + if (vulnerableHeadersBuilder_ != null) { + return vulnerableHeadersBuilder_.getMessageOrBuilder(); + } else { + return vulnerableHeaders_ == null + ? com.google.cloud.websecurityscanner.v1.VulnerableHeaders.getDefaultInstance() + : vulnerableHeaders_; + } + } + /** + * + * + *
+     * Output only. An addon containing information about vulnerable or missing HTTP headers.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder> + getVulnerableHeadersFieldBuilder() { + if (vulnerableHeadersBuilder_ == null) { + vulnerableHeadersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder>( + getVulnerableHeaders(), getParentForChildren(), isClean()); + vulnerableHeaders_ = null; + } + return vulnerableHeadersBuilder_; + } + + private com.google.cloud.websecurityscanner.v1.VulnerableParameters vulnerableParameters_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableParameters, + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder> + vulnerableParametersBuilder_; + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + * + * @return Whether the vulnerableParameters field is set. + */ + public boolean hasVulnerableParameters() { + return vulnerableParametersBuilder_ != null || vulnerableParameters_ != null; + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + * + * @return The vulnerableParameters. + */ + public com.google.cloud.websecurityscanner.v1.VulnerableParameters getVulnerableParameters() { + if (vulnerableParametersBuilder_ == null) { + return vulnerableParameters_ == null + ? com.google.cloud.websecurityscanner.v1.VulnerableParameters.getDefaultInstance() + : vulnerableParameters_; + } else { + return vulnerableParametersBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + public Builder setVulnerableParameters( + com.google.cloud.websecurityscanner.v1.VulnerableParameters value) { + if (vulnerableParametersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + vulnerableParameters_ = value; + onChanged(); + } else { + vulnerableParametersBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + public Builder setVulnerableParameters( + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder builderForValue) { + if (vulnerableParametersBuilder_ == null) { + vulnerableParameters_ = builderForValue.build(); + onChanged(); + } else { + vulnerableParametersBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + public Builder mergeVulnerableParameters( + com.google.cloud.websecurityscanner.v1.VulnerableParameters value) { + if (vulnerableParametersBuilder_ == null) { + if (vulnerableParameters_ != null) { + vulnerableParameters_ = + com.google.cloud.websecurityscanner.v1.VulnerableParameters.newBuilder( + vulnerableParameters_) + .mergeFrom(value) + .buildPartial(); + } else { + vulnerableParameters_ = value; + } + onChanged(); + } else { + vulnerableParametersBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + public Builder clearVulnerableParameters() { + if (vulnerableParametersBuilder_ == null) { + vulnerableParameters_ = null; + onChanged(); + } else { + vulnerableParameters_ = null; + vulnerableParametersBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder + getVulnerableParametersBuilder() { + + onChanged(); + return getVulnerableParametersFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder + getVulnerableParametersOrBuilder() { + if (vulnerableParametersBuilder_ != null) { + return vulnerableParametersBuilder_.getMessageOrBuilder(); + } else { + return vulnerableParameters_ == null + ? com.google.cloud.websecurityscanner.v1.VulnerableParameters.getDefaultInstance() + : vulnerableParameters_; + } + } + /** + * + * + *
+     * Output only. An addon containing information about request parameters which were found
+     * to be vulnerable.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableParameters, + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder> + getVulnerableParametersFieldBuilder() { + if (vulnerableParametersBuilder_ == null) { + vulnerableParametersBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableParameters, + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder>( + getVulnerableParameters(), getParentForChildren(), isClean()); + vulnerableParameters_ = null; + } + return vulnerableParametersBuilder_; + } + + private com.google.cloud.websecurityscanner.v1.Xss xss_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Xss, + com.google.cloud.websecurityscanner.v1.Xss.Builder, + com.google.cloud.websecurityscanner.v1.XssOrBuilder> + xssBuilder_; + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + * + * @return Whether the xss field is set. + */ + public boolean hasXss() { + return xssBuilder_ != null || xss_ != null; + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + * + * @return The xss. + */ + public com.google.cloud.websecurityscanner.v1.Xss getXss() { + if (xssBuilder_ == null) { + return xss_ == null + ? com.google.cloud.websecurityscanner.v1.Xss.getDefaultInstance() + : xss_; + } else { + return xssBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + public Builder setXss(com.google.cloud.websecurityscanner.v1.Xss value) { + if (xssBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + xss_ = value; + onChanged(); + } else { + xssBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + public Builder setXss(com.google.cloud.websecurityscanner.v1.Xss.Builder builderForValue) { + if (xssBuilder_ == null) { + xss_ = builderForValue.build(); + onChanged(); + } else { + xssBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + public Builder mergeXss(com.google.cloud.websecurityscanner.v1.Xss value) { + if (xssBuilder_ == null) { + if (xss_ != null) { + xss_ = + com.google.cloud.websecurityscanner.v1.Xss.newBuilder(xss_) + .mergeFrom(value) + .buildPartial(); + } else { + xss_ = value; + } + onChanged(); + } else { + xssBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + public Builder clearXss() { + if (xssBuilder_ == null) { + xss_ = null; + onChanged(); + } else { + xss_ = null; + xssBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + public com.google.cloud.websecurityscanner.v1.Xss.Builder getXssBuilder() { + + onChanged(); + return getXssFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + public com.google.cloud.websecurityscanner.v1.XssOrBuilder getXssOrBuilder() { + if (xssBuilder_ != null) { + return xssBuilder_.getMessageOrBuilder(); + } else { + return xss_ == null + ? com.google.cloud.websecurityscanner.v1.Xss.getDefaultInstance() + : xss_; + } + } + /** + * + * + *
+     * Output only. An addon containing information reported for an XSS, if any.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Xss, + com.google.cloud.websecurityscanner.v1.Xss.Builder, + com.google.cloud.websecurityscanner.v1.XssOrBuilder> + getXssFieldBuilder() { + if (xssBuilder_ == null) { + xssBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Xss, + com.google.cloud.websecurityscanner.v1.Xss.Builder, + com.google.cloud.websecurityscanner.v1.XssOrBuilder>( + getXss(), getParentForChildren(), isClean()); + xss_ = null; + } + return xssBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.Finding) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.Finding) + private static final com.google.cloud.websecurityscanner.v1.Finding DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.Finding(); + } + + public static com.google.cloud.websecurityscanner.v1.Finding getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Finding parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Finding(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingAddonProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingAddonProto.java new file mode 100644 index 00000000..413264d0 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingAddonProto.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class FindingAddonProto { + private FindingAddonProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_Form_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_Form_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_Xss_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_Xss_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n6google/cloud/websecurityscanner/v1/fin" + + "ding_addon.proto\022\"google.cloud.websecuri" + + "tyscanner.v1\"*\n\004Form\022\022\n\naction_uri\030\001 \001(\t" + + "\022\016\n\006fields\030\002 \003(\t\"Q\n\017OutdatedLibrary\022\024\n\014l" + + "ibrary_name\030\001 \001(\t\022\017\n\007version\030\002 \001(\t\022\027\n\017le" + + "arn_more_urls\030\003 \003(\t\"?\n\021ViolatingResource" + + "\022\024\n\014content_type\030\001 \001(\t\022\024\n\014resource_url\030\002" + + " \001(\t\"/\n\024VulnerableParameters\022\027\n\017paramete" + + "r_names\030\001 \003(\t\"\340\001\n\021VulnerableHeaders\022M\n\007h" + + "eaders\030\001 \003(\0132<.google.cloud.websecuritys" + + "canner.v1.VulnerableHeaders.Header\022U\n\017mi" + + "ssing_headers\030\002 \003(\0132<.google.cloud.webse" + + "curityscanner.v1.VulnerableHeaders.Heade" + + "r\032%\n\006Header\022\014\n\004name\030\001 \001(\t\022\r\n\005value\030\002 \001(\t" + + "\"\333\003\n\003Xss\022\024\n\014stack_traces\030\001 \003(\t\022\025\n\rerror_" + + "message\030\002 \001(\t\022K\n\rattack_vector\030\003 \001(\01624.g" + + "oogle.cloud.websecurityscanner.v1.Xss.At" + + "tackVector\022\036\n\026stored_xss_seeding_url\030\004 \001" + + "(\t\"\271\002\n\014AttackVector\022\035\n\031ATTACK_VECTOR_UNS" + + "PECIFIED\020\000\022\021\n\rLOCAL_STORAGE\020\001\022\023\n\017SESSION" + + "_STORAGE\020\002\022\017\n\013WINDOW_NAME\020\003\022\014\n\010REFERRER\020" + + "\004\022\016\n\nFORM_INPUT\020\005\022\n\n\006COOKIE\020\006\022\020\n\014POST_ME" + + "SSAGE\020\007\022\022\n\016GET_PARAMETERS\020\010\022\020\n\014URL_FRAGM" + + "ENT\020\t\022\020\n\014HTML_COMMENT\020\n\022\023\n\017POST_PARAMETE" + + "RS\020\013\022\014\n\010PROTOCOL\020\014\022\016\n\nSTORED_XSS\020\r\022\017\n\013SA" + + "ME_ORIGIN\020\016\022\031\n\025USER_CONTROLLABLE_URL\020\017B\223" + + "\001\n&com.google.cloud.websecurityscanner.v" + + "1B\021FindingAddonProtoP\001ZTgoogle.golang.or" + + "g/genproto/googleapis/cloud/websecuritys" + + "canner/v1;websecurityscannerb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_websecurityscanner_v1_Form_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_Form_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_Form_descriptor, + new java.lang.String[] { + "ActionUri", "Fields", + }); + internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_descriptor, + new java.lang.String[] { + "LibraryName", "Version", "LearnMoreUrls", + }); + internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_descriptor, + new java.lang.String[] { + "ContentType", "ResourceUrl", + }); + internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_descriptor, + new java.lang.String[] { + "ParameterNames", + }); + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor, + new java.lang.String[] { + "Headers", "MissingHeaders", + }); + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_descriptor = + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_descriptor, + new java.lang.String[] { + "Name", "Value", + }); + internal_static_google_cloud_websecurityscanner_v1_Xss_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_websecurityscanner_v1_Xss_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_Xss_descriptor, + new java.lang.String[] { + "StackTraces", "ErrorMessage", "AttackVector", "StoredXssSeedingUrl", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingName.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingName.java new file mode 100644 index 00000000..1f1328f8 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingName.java @@ -0,0 +1,242 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.websecurityscanner.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +/** AUTO-GENERATED DOCUMENTATION AND CLASS */ +@javax.annotation.Generated("by GAPIC protoc plugin") +public class FindingName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String scanConfig; + private final String scanRun; + private final String finding; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public String getScanRun() { + return scanRun; + } + + public String getFinding() { + return finding; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private FindingName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + scanConfig = Preconditions.checkNotNull(builder.getScanConfig()); + scanRun = Preconditions.checkNotNull(builder.getScanRun()); + finding = Preconditions.checkNotNull(builder.getFinding()); + } + + public static FindingName of(String project, String scanConfig, String scanRun, String finding) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .setScanRun(scanRun) + .setFinding(finding) + .build(); + } + + public static String format(String project, String scanConfig, String scanRun, String finding) { + return newBuilder() + .setProject(project) + .setScanConfig(scanConfig) + .setScanRun(scanRun) + .setFinding(finding) + .build() + .toString(); + } + + public static FindingName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "FindingName.parse: formattedString not in valid format"); + return of( + matchMap.get("project"), + matchMap.get("scan_config"), + matchMap.get("scan_run"), + matchMap.get("finding")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (FindingName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("scanConfig", scanConfig); + fieldMapBuilder.put("scanRun", scanRun); + fieldMapBuilder.put("finding", finding); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate( + "project", project, "scan_config", scanConfig, "scan_run", scanRun, "finding", finding); + } + + /** Builder for FindingName. */ + public static class Builder { + + private String project; + private String scanConfig; + private String scanRun; + private String finding; + + public String getProject() { + return project; + } + + public String getScanConfig() { + return scanConfig; + } + + public String getScanRun() { + return scanRun; + } + + public String getFinding() { + return finding; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setScanConfig(String scanConfig) { + this.scanConfig = scanConfig; + return this; + } + + public Builder setScanRun(String scanRun) { + this.scanRun = scanRun; + return this; + } + + public Builder setFinding(String finding) { + this.finding = finding; + return this; + } + + private Builder() {} + + private Builder(FindingName findingName) { + project = findingName.project; + scanConfig = findingName.scanConfig; + scanRun = findingName.scanRun; + finding = findingName.finding; + } + + public FindingName build() { + return new FindingName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof FindingName) { + FindingName that = (FindingName) o; + return (this.project.equals(that.project)) + && (this.scanConfig.equals(that.scanConfig)) + && (this.scanRun.equals(that.scanRun)) + && (this.finding.equals(that.finding)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= scanConfig.hashCode(); + h *= 1000003; + h ^= scanRun.hashCode(); + h *= 1000003; + h ^= finding.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingOrBuilder.java new file mode 100644 index 00000000..338bf2e8 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingOrBuilder.java @@ -0,0 +1,545 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface FindingOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.Finding) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the Finding. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+   * The finding IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the Finding. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'.
+   * The finding IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The type of the Finding.
+   * Detailed and up-to-date information on findings can be found here:
+   * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+   * 
+ * + * string finding_type = 2; + * + * @return The findingType. + */ + java.lang.String getFindingType(); + /** + * + * + *
+   * Output only. The type of the Finding.
+   * Detailed and up-to-date information on findings can be found here:
+   * https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings
+   * 
+ * + * string finding_type = 2; + * + * @return The bytes for findingType. + */ + com.google.protobuf.ByteString getFindingTypeBytes(); + + /** + * + * + *
+   * Output only. The severity level of the reported vulnerability.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Output only. The severity level of the reported vulnerability.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.Finding.Severity severity = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The severity. + */ + com.google.cloud.websecurityscanner.v1.Finding.Severity getSeverity(); + + /** + * + * + *
+   * Output only. The http method of the request that triggered the vulnerability, in
+   * uppercase.
+   * 
+ * + * string http_method = 3; + * + * @return The httpMethod. + */ + java.lang.String getHttpMethod(); + /** + * + * + *
+   * Output only. The http method of the request that triggered the vulnerability, in
+   * uppercase.
+   * 
+ * + * string http_method = 3; + * + * @return The bytes for httpMethod. + */ + com.google.protobuf.ByteString getHttpMethodBytes(); + + /** + * + * + *
+   * Output only. The URL produced by the server-side fuzzer and used in the request that
+   * triggered the vulnerability.
+   * 
+ * + * string fuzzed_url = 4; + * + * @return The fuzzedUrl. + */ + java.lang.String getFuzzedUrl(); + /** + * + * + *
+   * Output only. The URL produced by the server-side fuzzer and used in the request that
+   * triggered the vulnerability.
+   * 
+ * + * string fuzzed_url = 4; + * + * @return The bytes for fuzzedUrl. + */ + com.google.protobuf.ByteString getFuzzedUrlBytes(); + + /** + * + * + *
+   * Output only. The body of the request that triggered the vulnerability.
+   * 
+ * + * string body = 5; + * + * @return The body. + */ + java.lang.String getBody(); + /** + * + * + *
+   * Output only. The body of the request that triggered the vulnerability.
+   * 
+ * + * string body = 5; + * + * @return The bytes for body. + */ + com.google.protobuf.ByteString getBodyBytes(); + + /** + * + * + *
+   * Output only. The description of the vulnerability.
+   * 
+ * + * string description = 6; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+   * Output only. The description of the vulnerability.
+   * 
+ * + * string description = 6; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+   * Output only. The URL containing human-readable payload that user can leverage to
+   * reproduce the vulnerability.
+   * 
+ * + * string reproduction_url = 7; + * + * @return The reproductionUrl. + */ + java.lang.String getReproductionUrl(); + /** + * + * + *
+   * Output only. The URL containing human-readable payload that user can leverage to
+   * reproduce the vulnerability.
+   * 
+ * + * string reproduction_url = 7; + * + * @return The bytes for reproductionUrl. + */ + com.google.protobuf.ByteString getReproductionUrlBytes(); + + /** + * + * + *
+   * Output only. If the vulnerability was originated from nested IFrame, the immediate
+   * parent IFrame is reported.
+   * 
+ * + * string frame_url = 8; + * + * @return The frameUrl. + */ + java.lang.String getFrameUrl(); + /** + * + * + *
+   * Output only. If the vulnerability was originated from nested IFrame, the immediate
+   * parent IFrame is reported.
+   * 
+ * + * string frame_url = 8; + * + * @return The bytes for frameUrl. + */ + com.google.protobuf.ByteString getFrameUrlBytes(); + + /** + * + * + *
+   * Output only. The URL where the browser lands when the vulnerability is detected.
+   * 
+ * + * string final_url = 9; + * + * @return The finalUrl. + */ + java.lang.String getFinalUrl(); + /** + * + * + *
+   * Output only. The URL where the browser lands when the vulnerability is detected.
+   * 
+ * + * string final_url = 9; + * + * @return The bytes for finalUrl. + */ + com.google.protobuf.ByteString getFinalUrlBytes(); + + /** + * + * + *
+   * Output only. The tracking ID uniquely identifies a vulnerability instance across
+   * multiple ScanRuns.
+   * 
+ * + * string tracking_id = 10; + * + * @return The trackingId. + */ + java.lang.String getTrackingId(); + /** + * + * + *
+   * Output only. The tracking ID uniquely identifies a vulnerability instance across
+   * multiple ScanRuns.
+   * 
+ * + * string tracking_id = 10; + * + * @return The bytes for trackingId. + */ + com.google.protobuf.ByteString getTrackingIdBytes(); + + /** + * + * + *
+   * Output only. An addon containing information reported for a vulnerability with an HTML
+   * form, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + * + * @return Whether the form field is set. + */ + boolean hasForm(); + /** + * + * + *
+   * Output only. An addon containing information reported for a vulnerability with an HTML
+   * form, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + * + * @return The form. + */ + com.google.cloud.websecurityscanner.v1.Form getForm(); + /** + * + * + *
+   * Output only. An addon containing information reported for a vulnerability with an HTML
+   * form, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Form form = 16; + */ + com.google.cloud.websecurityscanner.v1.FormOrBuilder getFormOrBuilder(); + + /** + * + * + *
+   * Output only. An addon containing information about outdated libraries.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + * + * @return Whether the outdatedLibrary field is set. + */ + boolean hasOutdatedLibrary(); + /** + * + * + *
+   * Output only. An addon containing information about outdated libraries.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + * + * @return The outdatedLibrary. + */ + com.google.cloud.websecurityscanner.v1.OutdatedLibrary getOutdatedLibrary(); + /** + * + * + *
+   * Output only. An addon containing information about outdated libraries.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.OutdatedLibrary outdated_library = 11; + */ + com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder getOutdatedLibraryOrBuilder(); + + /** + * + * + *
+   * Output only. An addon containing detailed information regarding any resource causing the
+   * vulnerability such as JavaScript sources, image, audio files, etc.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + * + * @return Whether the violatingResource field is set. + */ + boolean hasViolatingResource(); + /** + * + * + *
+   * Output only. An addon containing detailed information regarding any resource causing the
+   * vulnerability such as JavaScript sources, image, audio files, etc.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + * + * @return The violatingResource. + */ + com.google.cloud.websecurityscanner.v1.ViolatingResource getViolatingResource(); + /** + * + * + *
+   * Output only. An addon containing detailed information regarding any resource causing the
+   * vulnerability such as JavaScript sources, image, audio files, etc.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ViolatingResource violating_resource = 12; + */ + com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder getViolatingResourceOrBuilder(); + + /** + * + * + *
+   * Output only. An addon containing information about vulnerable or missing HTTP headers.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + * + * @return Whether the vulnerableHeaders field is set. + */ + boolean hasVulnerableHeaders(); + /** + * + * + *
+   * Output only. An addon containing information about vulnerable or missing HTTP headers.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + * + * @return The vulnerableHeaders. + */ + com.google.cloud.websecurityscanner.v1.VulnerableHeaders getVulnerableHeaders(); + /** + * + * + *
+   * Output only. An addon containing information about vulnerable or missing HTTP headers.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableHeaders vulnerable_headers = 15; + */ + com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder getVulnerableHeadersOrBuilder(); + + /** + * + * + *
+   * Output only. An addon containing information about request parameters which were found
+   * to be vulnerable.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + * + * @return Whether the vulnerableParameters field is set. + */ + boolean hasVulnerableParameters(); + /** + * + * + *
+   * Output only. An addon containing information about request parameters which were found
+   * to be vulnerable.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + * + * @return The vulnerableParameters. + */ + com.google.cloud.websecurityscanner.v1.VulnerableParameters getVulnerableParameters(); + /** + * + * + *
+   * Output only. An addon containing information about request parameters which were found
+   * to be vulnerable.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.VulnerableParameters vulnerable_parameters = 13; + * + */ + com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder + getVulnerableParametersOrBuilder(); + + /** + * + * + *
+   * Output only. An addon containing information reported for an XSS, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + * + * @return Whether the xss field is set. + */ + boolean hasXss(); + /** + * + * + *
+   * Output only. An addon containing information reported for an XSS, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + * + * @return The xss. + */ + com.google.cloud.websecurityscanner.v1.Xss getXss(); + /** + * + * + *
+   * Output only. An addon containing information reported for an XSS, if any.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss xss = 14; + */ + com.google.cloud.websecurityscanner.v1.XssOrBuilder getXssOrBuilder(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingProto.java new file mode 100644 index 00000000..4125dc42 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingProto.java @@ -0,0 +1,121 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class FindingProto { + private FindingProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_Finding_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_Finding_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/websecurityscanner/v1/fin" + + "ding.proto\022\"google.cloud.websecurityscan" + + "ner.v1\032\037google/api/field_behavior.proto\032" + + "\031google/api/resource.proto\0326google/cloud" + + "/websecurityscanner/v1/finding_addon.pro" + + "to\"\261\007\n\007Finding\022\014\n\004name\030\001 \001(\t\022\024\n\014finding_" + + "type\030\002 \001(\t\022K\n\010severity\030\021 \001(\01624.google.cl" + + "oud.websecurityscanner.v1.Finding.Severi" + + "tyB\003\340A\003\022\023\n\013http_method\030\003 \001(\t\022\022\n\nfuzzed_u" + + "rl\030\004 \001(\t\022\014\n\004body\030\005 \001(\t\022\023\n\013description\030\006 " + + "\001(\t\022\030\n\020reproduction_url\030\007 \001(\t\022\021\n\tframe_u" + + "rl\030\010 \001(\t\022\021\n\tfinal_url\030\t \001(\t\022\023\n\013tracking_" + + "id\030\n \001(\t\0226\n\004form\030\020 \001(\0132(.google.cloud.we" + + "bsecurityscanner.v1.Form\022M\n\020outdated_lib" + + "rary\030\013 \001(\01323.google.cloud.websecuritysca" + + "nner.v1.OutdatedLibrary\022Q\n\022violating_res" + + "ource\030\014 \001(\01325.google.cloud.websecuritysc" + + "anner.v1.ViolatingResource\022Q\n\022vulnerable" + + "_headers\030\017 \001(\01325.google.cloud.websecurit" + + "yscanner.v1.VulnerableHeaders\022W\n\025vulnera" + + "ble_parameters\030\r \001(\01328.google.cloud.webs" + + "ecurityscanner.v1.VulnerableParameters\0224" + + "\n\003xss\030\016 \001(\0132\'.google.cloud.websecuritysc" + + "anner.v1.Xss\"Q\n\010Severity\022\030\n\024SEVERITY_UNS" + + "PECIFIED\020\000\022\014\n\010CRITICAL\020\001\022\010\n\004HIGH\020\002\022\n\n\006ME" + + "DIUM\020\003\022\007\n\003LOW\020\004:\204\001\352A\200\001\n)websecurityscann" + + "er.googleapis.com/Finding\022Sprojects/{pro" + + "ject}/scanConfigs/{scan_config}/scanRuns" + + "/{scan_run}/findings/{finding}B\216\001\n&com.g" + + "oogle.cloud.websecurityscanner.v1B\014Findi" + + "ngProtoP\001ZTgoogle.golang.org/genproto/go" + + "ogleapis/cloud/websecurityscanner/v1;web" + + "securityscannerb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.websecurityscanner.v1.FindingAddonProto.getDescriptor(), + }); + internal_static_google_cloud_websecurityscanner_v1_Finding_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_Finding_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_Finding_descriptor, + new java.lang.String[] { + "Name", + "FindingType", + "Severity", + "HttpMethod", + "FuzzedUrl", + "Body", + "Description", + "ReproductionUrl", + "FrameUrl", + "FinalUrl", + "TrackingId", + "Form", + "OutdatedLibrary", + "ViolatingResource", + "VulnerableHeaders", + "VulnerableParameters", + "Xss", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.websecurityscanner.v1.FindingAddonProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStats.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStats.java new file mode 100644 index 00000000..9db576cc --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStats.java @@ -0,0 +1,729 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_type_stats.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * A FindingTypeStats resource represents stats regarding a specific FindingType
+ * of Findings under a given ScanRun.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.FindingTypeStats} + */ +public final class FindingTypeStats extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.FindingTypeStats) + FindingTypeStatsOrBuilder { + private static final long serialVersionUID = 0L; + // Use FindingTypeStats.newBuilder() to construct. + private FindingTypeStats(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private FindingTypeStats() { + findingType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new FindingTypeStats(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private FindingTypeStats( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + findingType_ = s; + break; + } + case 16: + { + findingCount_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingTypeStatsProto + .internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingTypeStatsProto + .internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.FindingTypeStats.class, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder.class); + } + + public static final int FINDING_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object findingType_; + /** + * + * + *
+   * Output only. The finding type associated with the stats.
+   * 
+ * + * string finding_type = 1; + * + * @return The findingType. + */ + @java.lang.Override + public java.lang.String getFindingType() { + java.lang.Object ref = findingType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingType_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The finding type associated with the stats.
+   * 
+ * + * string finding_type = 1; + * + * @return The bytes for findingType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFindingTypeBytes() { + java.lang.Object ref = findingType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FINDING_COUNT_FIELD_NUMBER = 2; + private int findingCount_; + /** + * + * + *
+   * Output only. The count of findings belonging to this finding type.
+   * 
+ * + * int32 finding_count = 2; + * + * @return The findingCount. + */ + @java.lang.Override + public int getFindingCount() { + return findingCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getFindingTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, findingType_); + } + if (findingCount_ != 0) { + output.writeInt32(2, findingCount_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFindingTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, findingType_); + } + if (findingCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, findingCount_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.FindingTypeStats)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.FindingTypeStats other = + (com.google.cloud.websecurityscanner.v1.FindingTypeStats) obj; + + if (!getFindingType().equals(other.getFindingType())) return false; + if (getFindingCount() != other.getFindingCount()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FINDING_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFindingType().hashCode(); + hash = (37 * hash) + FINDING_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getFindingCount(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.FindingTypeStats prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A FindingTypeStats resource represents stats regarding a specific FindingType
+   * of Findings under a given ScanRun.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.FindingTypeStats} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.FindingTypeStats) + com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingTypeStatsProto + .internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingTypeStatsProto + .internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.FindingTypeStats.class, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.FindingTypeStats.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + findingType_ = ""; + + findingCount_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingTypeStatsProto + .internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingTypeStats getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.FindingTypeStats.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingTypeStats build() { + com.google.cloud.websecurityscanner.v1.FindingTypeStats result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingTypeStats buildPartial() { + com.google.cloud.websecurityscanner.v1.FindingTypeStats result = + new com.google.cloud.websecurityscanner.v1.FindingTypeStats(this); + result.findingType_ = findingType_; + result.findingCount_ = findingCount_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.FindingTypeStats) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.FindingTypeStats) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.FindingTypeStats other) { + if (other == com.google.cloud.websecurityscanner.v1.FindingTypeStats.getDefaultInstance()) + return this; + if (!other.getFindingType().isEmpty()) { + findingType_ = other.findingType_; + onChanged(); + } + if (other.getFindingCount() != 0) { + setFindingCount(other.getFindingCount()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.FindingTypeStats parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.FindingTypeStats) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object findingType_ = ""; + /** + * + * + *
+     * Output only. The finding type associated with the stats.
+     * 
+ * + * string finding_type = 1; + * + * @return The findingType. + */ + public java.lang.String getFindingType() { + java.lang.Object ref = findingType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + findingType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The finding type associated with the stats.
+     * 
+ * + * string finding_type = 1; + * + * @return The bytes for findingType. + */ + public com.google.protobuf.ByteString getFindingTypeBytes() { + java.lang.Object ref = findingType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + findingType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The finding type associated with the stats.
+     * 
+ * + * string finding_type = 1; + * + * @param value The findingType to set. + * @return This builder for chaining. + */ + public Builder setFindingType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + findingType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The finding type associated with the stats.
+     * 
+ * + * string finding_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearFindingType() { + + findingType_ = getDefaultInstance().getFindingType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The finding type associated with the stats.
+     * 
+ * + * string finding_type = 1; + * + * @param value The bytes for findingType to set. + * @return This builder for chaining. + */ + public Builder setFindingTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + findingType_ = value; + onChanged(); + return this; + } + + private int findingCount_; + /** + * + * + *
+     * Output only. The count of findings belonging to this finding type.
+     * 
+ * + * int32 finding_count = 2; + * + * @return The findingCount. + */ + @java.lang.Override + public int getFindingCount() { + return findingCount_; + } + /** + * + * + *
+     * Output only. The count of findings belonging to this finding type.
+     * 
+ * + * int32 finding_count = 2; + * + * @param value The findingCount to set. + * @return This builder for chaining. + */ + public Builder setFindingCount(int value) { + + findingCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The count of findings belonging to this finding type.
+     * 
+ * + * int32 finding_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearFindingCount() { + + findingCount_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.FindingTypeStats) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.FindingTypeStats) + private static final com.google.cloud.websecurityscanner.v1.FindingTypeStats DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.FindingTypeStats(); + } + + public static com.google.cloud.websecurityscanner.v1.FindingTypeStats getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FindingTypeStats parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FindingTypeStats(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingTypeStats getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStatsOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStatsOrBuilder.java new file mode 100644 index 00000000..e64b9e99 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStatsOrBuilder.java @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_type_stats.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface FindingTypeStatsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.FindingTypeStats) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The finding type associated with the stats.
+   * 
+ * + * string finding_type = 1; + * + * @return The findingType. + */ + java.lang.String getFindingType(); + /** + * + * + *
+   * Output only. The finding type associated with the stats.
+   * 
+ * + * string finding_type = 1; + * + * @return The bytes for findingType. + */ + com.google.protobuf.ByteString getFindingTypeBytes(); + + /** + * + * + *
+   * Output only. The count of findings belonging to this finding type.
+   * 
+ * + * int32 finding_count = 2; + * + * @return The findingCount. + */ + int getFindingCount(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStatsProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStatsProto.java new file mode 100644 index 00000000..4ccfb479 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FindingTypeStatsProto.java @@ -0,0 +1,67 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_type_stats.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class FindingTypeStatsProto { + private FindingTypeStatsProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n;google/cloud/websecurityscanner/v1/fin" + + "ding_type_stats.proto\022\"google.cloud.webs" + + "ecurityscanner.v1\"?\n\020FindingTypeStats\022\024\n" + + "\014finding_type\030\001 \001(\t\022\025\n\rfinding_count\030\002 \001" + + "(\005B\227\001\n&com.google.cloud.websecurityscann" + + "er.v1B\025FindingTypeStatsProtoP\001ZTgoogle.g" + + "olang.org/genproto/googleapis/cloud/webs" + + "ecurityscanner/v1;websecurityscannerb\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_FindingTypeStats_descriptor, + new java.lang.String[] { + "FindingType", "FindingCount", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/Form.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/Form.java new file mode 100644 index 00000000..538c7a87 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/Form.java @@ -0,0 +1,914 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * ! Information about a vulnerability with an HTML.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.Form} + */ +public final class Form extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.Form) + FormOrBuilder { + private static final long serialVersionUID = 0L; + // Use Form.newBuilder() to construct. + private Form(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Form() { + actionUri_ = ""; + fields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Form(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Form( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + actionUri_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + fields_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + fields_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + fields_ = fields_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Form_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Form_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.Form.class, + com.google.cloud.websecurityscanner.v1.Form.Builder.class); + } + + public static final int ACTION_URI_FIELD_NUMBER = 1; + private volatile java.lang.Object actionUri_; + /** + * + * + *
+   * ! The URI where to send the form when it's submitted.
+   * 
+ * + * string action_uri = 1; + * + * @return The actionUri. + */ + @java.lang.Override + public java.lang.String getActionUri() { + java.lang.Object ref = actionUri_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionUri_ = s; + return s; + } + } + /** + * + * + *
+   * ! The URI where to send the form when it's submitted.
+   * 
+ * + * string action_uri = 1; + * + * @return The bytes for actionUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActionUriBytes() { + java.lang.Object ref = actionUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FIELDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList fields_; + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @return A list containing the fields. + */ + public com.google.protobuf.ProtocolStringList getFieldsList() { + return fields_; + } + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @return The count of fields. + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @param index The index of the element to return. + * @return The fields at the given index. + */ + public java.lang.String getFields(int index) { + return fields_.get(index); + } + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @param index The index of the value to return. + * @return The bytes of the fields at the given index. + */ + public com.google.protobuf.ByteString getFieldsBytes(int index) { + return fields_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getActionUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, actionUri_); + } + for (int i = 0; i < fields_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fields_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getActionUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, actionUri_); + } + { + int dataSize = 0; + for (int i = 0; i < fields_.size(); i++) { + dataSize += computeStringSizeNoTag(fields_.getRaw(i)); + } + size += dataSize; + size += 1 * getFieldsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.Form)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.Form other = + (com.google.cloud.websecurityscanner.v1.Form) obj; + + if (!getActionUri().equals(other.getActionUri())) return false; + if (!getFieldsList().equals(other.getFieldsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ACTION_URI_FIELD_NUMBER; + hash = (53 * hash) + getActionUri().hashCode(); + if (getFieldsCount() > 0) { + hash = (37 * hash) + FIELDS_FIELD_NUMBER; + hash = (53 * hash) + getFieldsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Form parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.websecurityscanner.v1.Form prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * ! Information about a vulnerability with an HTML.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.Form} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.Form) + com.google.cloud.websecurityscanner.v1.FormOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Form_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Form_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.Form.class, + com.google.cloud.websecurityscanner.v1.Form.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.Form.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + actionUri_ = ""; + + fields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Form_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Form getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.Form.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Form build() { + com.google.cloud.websecurityscanner.v1.Form result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Form buildPartial() { + com.google.cloud.websecurityscanner.v1.Form result = + new com.google.cloud.websecurityscanner.v1.Form(this); + int from_bitField0_ = bitField0_; + result.actionUri_ = actionUri_; + if (((bitField0_ & 0x00000001) != 0)) { + fields_ = fields_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.fields_ = fields_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.Form) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.Form) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.Form other) { + if (other == com.google.cloud.websecurityscanner.v1.Form.getDefaultInstance()) return this; + if (!other.getActionUri().isEmpty()) { + actionUri_ = other.actionUri_; + onChanged(); + } + if (!other.fields_.isEmpty()) { + if (fields_.isEmpty()) { + fields_ = other.fields_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFieldsIsMutable(); + fields_.addAll(other.fields_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.Form parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.websecurityscanner.v1.Form) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object actionUri_ = ""; + /** + * + * + *
+     * ! The URI where to send the form when it's submitted.
+     * 
+ * + * string action_uri = 1; + * + * @return The actionUri. + */ + public java.lang.String getActionUri() { + java.lang.Object ref = actionUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + actionUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * ! The URI where to send the form when it's submitted.
+     * 
+ * + * string action_uri = 1; + * + * @return The bytes for actionUri. + */ + public com.google.protobuf.ByteString getActionUriBytes() { + java.lang.Object ref = actionUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + actionUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * ! The URI where to send the form when it's submitted.
+     * 
+ * + * string action_uri = 1; + * + * @param value The actionUri to set. + * @return This builder for chaining. + */ + public Builder setActionUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + actionUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * ! The URI where to send the form when it's submitted.
+     * 
+ * + * string action_uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearActionUri() { + + actionUri_ = getDefaultInstance().getActionUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * ! The URI where to send the form when it's submitted.
+     * 
+ * + * string action_uri = 1; + * + * @param value The bytes for actionUri to set. + * @return This builder for chaining. + */ + public Builder setActionUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + actionUri_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList fields_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureFieldsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + fields_ = new com.google.protobuf.LazyStringArrayList(fields_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @return A list containing the fields. + */ + public com.google.protobuf.ProtocolStringList getFieldsList() { + return fields_.getUnmodifiableView(); + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @return The count of fields. + */ + public int getFieldsCount() { + return fields_.size(); + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @param index The index of the element to return. + * @return The fields at the given index. + */ + public java.lang.String getFields(int index) { + return fields_.get(index); + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @param index The index of the value to return. + * @return The bytes of the fields at the given index. + */ + public com.google.protobuf.ByteString getFieldsBytes(int index) { + return fields_.getByteString(index); + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @param index The index to set the value at. + * @param value The fields to set. + * @return This builder for chaining. + */ + public Builder setFields(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @param value The fields to add. + * @return This builder for chaining. + */ + public Builder addFields(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @param values The fields to add. + * @return This builder for chaining. + */ + public Builder addAllFields(java.lang.Iterable values) { + ensureFieldsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, fields_); + onChanged(); + return this; + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @return This builder for chaining. + */ + public Builder clearFields() { + fields_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * ! The names of form fields related to the vulnerability.
+     * 
+ * + * repeated string fields = 2; + * + * @param value The bytes of the fields to add. + * @return This builder for chaining. + */ + public Builder addFieldsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureFieldsIsMutable(); + fields_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.Form) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.Form) + private static final com.google.cloud.websecurityscanner.v1.Form DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.Form(); + } + + public static com.google.cloud.websecurityscanner.v1.Form getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Form parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Form(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Form getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FormOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FormOrBuilder.java new file mode 100644 index 00000000..33d3545a --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/FormOrBuilder.java @@ -0,0 +1,101 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface FormOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.Form) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * ! The URI where to send the form when it's submitted.
+   * 
+ * + * string action_uri = 1; + * + * @return The actionUri. + */ + java.lang.String getActionUri(); + /** + * + * + *
+   * ! The URI where to send the form when it's submitted.
+   * 
+ * + * string action_uri = 1; + * + * @return The bytes for actionUri. + */ + com.google.protobuf.ByteString getActionUriBytes(); + + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @return A list containing the fields. + */ + java.util.List getFieldsList(); + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @return The count of fields. + */ + int getFieldsCount(); + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @param index The index of the element to return. + * @return The fields at the given index. + */ + java.lang.String getFields(int index); + /** + * + * + *
+   * ! The names of form fields related to the vulnerability.
+   * 
+ * + * repeated string fields = 2; + * + * @param index The index of the value to return. + * @return The bytes of the fields at the given index. + */ + com.google.protobuf.ByteString getFieldsBytes(int index); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetFindingRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetFindingRequest.java new file mode 100644 index 00000000..7c913e3b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetFindingRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `GetFinding` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.GetFindingRequest} + */ +public final class GetFindingRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.GetFindingRequest) + GetFindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFindingRequest.newBuilder() to construct. + private GetFindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetFindingRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetFindingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetFindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.GetFindingRequest.class, + com.google.cloud.websecurityscanner.v1.GetFindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object 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}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Finding to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.GetFindingRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.GetFindingRequest other = + (com.google.cloud.websecurityscanner.v1.GetFindingRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.GetFindingRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `GetFinding` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.GetFindingRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.GetFindingRequest) + com.google.cloud.websecurityscanner.v1.GetFindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.GetFindingRequest.class, + com.google.cloud.websecurityscanner.v1.GetFindingRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.GetFindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetFindingRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.GetFindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetFindingRequest build() { + com.google.cloud.websecurityscanner.v1.GetFindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetFindingRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.GetFindingRequest result = + new com.google.cloud.websecurityscanner.v1.GetFindingRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.GetFindingRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.GetFindingRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.GetFindingRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.GetFindingRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.GetFindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.GetFindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object 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}'.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Finding to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Finding to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Finding to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Finding to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.GetFindingRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.GetFindingRequest) + private static final com.google.cloud.websecurityscanner.v1.GetFindingRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.GetFindingRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.GetFindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetFindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetFindingRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetFindingRequestOrBuilder.java new file mode 100644 index 00000000..cd73cc3a --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetFindingRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface GetFindingRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.GetFindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Finding to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Finding to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanConfigRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanConfigRequest.java new file mode 100644 index 00000000..1901db13 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanConfigRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `GetScanConfig` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.GetScanConfigRequest} + */ +public final class GetScanConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.GetScanConfigRequest) + GetScanConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetScanConfigRequest.newBuilder() to construct. + private GetScanConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetScanConfigRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetScanConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetScanConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be returned. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be returned. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.GetScanConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest other = + (com.google.cloud.websecurityscanner.v1.GetScanConfigRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `GetScanConfig` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.GetScanConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.GetScanConfigRequest) + com.google.cloud.websecurityscanner.v1.GetScanConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanConfigRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanConfigRequest build() { + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanConfigRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest result = + new com.google.cloud.websecurityscanner.v1.GetScanConfigRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.GetScanConfigRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.GetScanConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.GetScanConfigRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.GetScanConfigRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.GetScanConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.GetScanConfigRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be returned. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be returned. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be returned. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be returned. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be returned. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.GetScanConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.GetScanConfigRequest) + private static final com.google.cloud.websecurityscanner.v1.GetScanConfigRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.GetScanConfigRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanConfigRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetScanConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetScanConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanConfigRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanConfigRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanConfigRequestOrBuilder.java new file mode 100644 index 00000000..39bbf9c2 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanConfigRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface GetScanConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.GetScanConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be returned. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be returned. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanRunRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanRunRequest.java new file mode 100644 index 00000000..329e98d6 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanRunRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `GetScanRun` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.GetScanRunRequest} + */ +public final class GetScanRunRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.GetScanRunRequest) + GetScanRunRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetScanRunRequest.newBuilder() to construct. + private GetScanRunRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetScanRunRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetScanRunRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetScanRunRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest.class, + com.google.cloud.websecurityscanner.v1.GetScanRunRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ScanRun to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the ScanRun to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.GetScanRunRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.GetScanRunRequest other = + (com.google.cloud.websecurityscanner.v1.GetScanRunRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `GetScanRun` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.GetScanRunRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.GetScanRunRequest) + com.google.cloud.websecurityscanner.v1.GetScanRunRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.GetScanRunRequest.class, + com.google.cloud.websecurityscanner.v1.GetScanRunRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.GetScanRunRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanRunRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.GetScanRunRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanRunRequest build() { + com.google.cloud.websecurityscanner.v1.GetScanRunRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanRunRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.GetScanRunRequest result = + new com.google.cloud.websecurityscanner.v1.GetScanRunRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.GetScanRunRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.GetScanRunRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.GetScanRunRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.GetScanRunRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.GetScanRunRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.GetScanRunRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ScanRun to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be returned. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.GetScanRunRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.GetScanRunRequest) + private static final com.google.cloud.websecurityscanner.v1.GetScanRunRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.GetScanRunRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.GetScanRunRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetScanRunRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetScanRunRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.GetScanRunRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanRunRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanRunRequestOrBuilder.java new file mode 100644 index 00000000..c338f298 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/GetScanRunRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface GetScanRunRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.GetScanRunRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ScanRun to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the ScanRun to be returned. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsRequest.java new file mode 100644 index 00000000..8a0402ff --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsRequest.java @@ -0,0 +1,946 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `ListCrawledUrls` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} + */ +public final class ListCrawledUrlsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + ListCrawledUrlsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCrawledUrlsRequest.newBuilder() to construct. + private ListCrawledUrlsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCrawledUrlsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCrawledUrlsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCrawledUrlsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.class, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of CrawledUrls to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest other = + (com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListCrawledUrls` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.class, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest build() { + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest result = + new com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest other) { + if (other + == com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of CrawledUrls to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of CrawledUrls to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of CrawledUrls to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + private static final com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCrawledUrlsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCrawledUrlsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsRequestOrBuilder.java new file mode 100644 index 00000000..9b03c21d --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsRequestOrBuilder.java @@ -0,0 +1,98 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListCrawledUrlsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of CrawledUrls to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsResponse.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsResponse.java new file mode 100644 index 00000000..a20eb880 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsResponse.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Response for the `ListCrawledUrls` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} + */ +public final class ListCrawledUrlsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + ListCrawledUrlsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListCrawledUrlsResponse.newBuilder() to construct. + private ListCrawledUrlsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListCrawledUrlsResponse() { + crawledUrls_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListCrawledUrlsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListCrawledUrlsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + crawledUrls_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + crawledUrls_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.CrawledUrl.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + crawledUrls_ = java.util.Collections.unmodifiableList(crawledUrls_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.class, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.Builder.class); + } + + public static final int CRAWLED_URLS_FIELD_NUMBER = 1; + private java.util.List crawledUrls_; + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + @java.lang.Override + public java.util.List getCrawledUrlsList() { + return crawledUrls_; + } + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + @java.lang.Override + public java.util.List + getCrawledUrlsOrBuilderList() { + return crawledUrls_; + } + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + @java.lang.Override + public int getCrawledUrlsCount() { + return crawledUrls_.size(); + } + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CrawledUrl getCrawledUrls(int index) { + return crawledUrls_.get(index); + } + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder getCrawledUrlsOrBuilder( + int index) { + return crawledUrls_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < crawledUrls_.size(); i++) { + output.writeMessage(1, crawledUrls_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < crawledUrls_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, crawledUrls_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse other = + (com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) obj; + + if (!getCrawledUrlsList().equals(other.getCrawledUrlsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getCrawledUrlsCount() > 0) { + hash = (37 * hash) + CRAWLED_URLS_FIELD_NUMBER; + hash = (53 * hash) + getCrawledUrlsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListCrawledUrls` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.class, + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCrawledUrlsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (crawledUrlsBuilder_ == null) { + crawledUrls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + crawledUrlsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse build() { + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse buildPartial() { + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse result = + new com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse(this); + int from_bitField0_ = bitField0_; + if (crawledUrlsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + crawledUrls_ = java.util.Collections.unmodifiableList(crawledUrls_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.crawledUrls_ = crawledUrls_; + } else { + result.crawledUrls_ = crawledUrlsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse other) { + if (other + == com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse.getDefaultInstance()) + return this; + if (crawledUrlsBuilder_ == null) { + if (!other.crawledUrls_.isEmpty()) { + if (crawledUrls_.isEmpty()) { + crawledUrls_ = other.crawledUrls_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCrawledUrlsIsMutable(); + crawledUrls_.addAll(other.crawledUrls_); + } + onChanged(); + } + } else { + if (!other.crawledUrls_.isEmpty()) { + if (crawledUrlsBuilder_.isEmpty()) { + crawledUrlsBuilder_.dispose(); + crawledUrlsBuilder_ = null; + crawledUrls_ = other.crawledUrls_; + bitField0_ = (bitField0_ & ~0x00000001); + crawledUrlsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCrawledUrlsFieldBuilder() + : null; + } else { + crawledUrlsBuilder_.addAllMessages(other.crawledUrls_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List crawledUrls_ = + java.util.Collections.emptyList(); + + private void ensureCrawledUrlsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + crawledUrls_ = + new java.util.ArrayList( + crawledUrls_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.CrawledUrl, + com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder, + com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder> + crawledUrlsBuilder_; + + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public java.util.List getCrawledUrlsList() { + if (crawledUrlsBuilder_ == null) { + return java.util.Collections.unmodifiableList(crawledUrls_); + } else { + return crawledUrlsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public int getCrawledUrlsCount() { + if (crawledUrlsBuilder_ == null) { + return crawledUrls_.size(); + } else { + return crawledUrlsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public com.google.cloud.websecurityscanner.v1.CrawledUrl getCrawledUrls(int index) { + if (crawledUrlsBuilder_ == null) { + return crawledUrls_.get(index); + } else { + return crawledUrlsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder setCrawledUrls( + int index, com.google.cloud.websecurityscanner.v1.CrawledUrl value) { + if (crawledUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCrawledUrlsIsMutable(); + crawledUrls_.set(index, value); + onChanged(); + } else { + crawledUrlsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder setCrawledUrls( + int index, com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder builderForValue) { + if (crawledUrlsBuilder_ == null) { + ensureCrawledUrlsIsMutable(); + crawledUrls_.set(index, builderForValue.build()); + onChanged(); + } else { + crawledUrlsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder addCrawledUrls(com.google.cloud.websecurityscanner.v1.CrawledUrl value) { + if (crawledUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCrawledUrlsIsMutable(); + crawledUrls_.add(value); + onChanged(); + } else { + crawledUrlsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder addCrawledUrls( + int index, com.google.cloud.websecurityscanner.v1.CrawledUrl value) { + if (crawledUrlsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCrawledUrlsIsMutable(); + crawledUrls_.add(index, value); + onChanged(); + } else { + crawledUrlsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder addCrawledUrls( + com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder builderForValue) { + if (crawledUrlsBuilder_ == null) { + ensureCrawledUrlsIsMutable(); + crawledUrls_.add(builderForValue.build()); + onChanged(); + } else { + crawledUrlsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder addCrawledUrls( + int index, com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder builderForValue) { + if (crawledUrlsBuilder_ == null) { + ensureCrawledUrlsIsMutable(); + crawledUrls_.add(index, builderForValue.build()); + onChanged(); + } else { + crawledUrlsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder addAllCrawledUrls( + java.lang.Iterable values) { + if (crawledUrlsBuilder_ == null) { + ensureCrawledUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, crawledUrls_); + onChanged(); + } else { + crawledUrlsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder clearCrawledUrls() { + if (crawledUrlsBuilder_ == null) { + crawledUrls_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + crawledUrlsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public Builder removeCrawledUrls(int index) { + if (crawledUrlsBuilder_ == null) { + ensureCrawledUrlsIsMutable(); + crawledUrls_.remove(index); + onChanged(); + } else { + crawledUrlsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder getCrawledUrlsBuilder( + int index) { + return getCrawledUrlsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder getCrawledUrlsOrBuilder( + int index) { + if (crawledUrlsBuilder_ == null) { + return crawledUrls_.get(index); + } else { + return crawledUrlsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public java.util.List + getCrawledUrlsOrBuilderList() { + if (crawledUrlsBuilder_ != null) { + return crawledUrlsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(crawledUrls_); + } + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder addCrawledUrlsBuilder() { + return getCrawledUrlsFieldBuilder() + .addBuilder(com.google.cloud.websecurityscanner.v1.CrawledUrl.getDefaultInstance()); + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder addCrawledUrlsBuilder( + int index) { + return getCrawledUrlsFieldBuilder() + .addBuilder( + index, com.google.cloud.websecurityscanner.v1.CrawledUrl.getDefaultInstance()); + } + /** + * + * + *
+     * The list of CrawledUrls returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + public java.util.List + getCrawledUrlsBuilderList() { + return getCrawledUrlsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.CrawledUrl, + com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder, + com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder> + getCrawledUrlsFieldBuilder() { + if (crawledUrlsBuilder_ == null) { + crawledUrlsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.CrawledUrl, + com.google.cloud.websecurityscanner.v1.CrawledUrl.Builder, + com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder>( + crawledUrls_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + crawledUrls_ = null; + } + return crawledUrlsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + private static final com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse(); + } + + public static com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListCrawledUrlsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListCrawledUrlsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsResponseOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsResponseOrBuilder.java new file mode 100644 index 00000000..e59fc74d --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListCrawledUrlsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListCrawledUrlsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + java.util.List getCrawledUrlsList(); + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + com.google.cloud.websecurityscanner.v1.CrawledUrl getCrawledUrls(int index); + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + int getCrawledUrlsCount(); + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + java.util.List + getCrawledUrlsOrBuilderList(); + /** + * + * + *
+   * The list of CrawledUrls returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.CrawledUrl crawled_urls = 1; + */ + com.google.cloud.websecurityscanner.v1.CrawledUrlOrBuilder getCrawledUrlsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsRequest.java new file mode 100644 index 00000000..d0ddb81d --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsRequest.java @@ -0,0 +1,662 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `ListFindingTypeStats` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} + */ +public final class ListFindingTypeStatsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + ListFindingTypeStatsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingTypeStatsRequest.newBuilder() to construct. + private ListFindingTypeStatsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingTypeStatsRequest() { + parent_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingTypeStatsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingTypeStatsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.class, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest other = + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListFindingTypeStats` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.class, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest build() { + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest result = + new com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest(this); + result.parent_ = parent_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest other) { + if (other + == com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + .getDefaultInstance()) return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + private static final com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingTypeStatsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingTypeStatsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsRequestOrBuilder.java new file mode 100644 index 00000000..d75bddba --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListFindingTypeStatsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListFindingTypeStatsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsResponse.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsResponse.java new file mode 100644 index 00000000..a74cebb5 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsResponse.java @@ -0,0 +1,1008 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Response for the `ListFindingTypeStats` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} + */ +public final class ListFindingTypeStatsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + ListFindingTypeStatsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingTypeStatsResponse.newBuilder() to construct. + private ListFindingTypeStatsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingTypeStatsResponse() { + findingTypeStats_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingTypeStatsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingTypeStatsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + findingTypeStats_ = + new java.util.ArrayList< + com.google.cloud.websecurityscanner.v1.FindingTypeStats>(); + mutable_bitField0_ |= 0x00000001; + } + findingTypeStats_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.FindingTypeStats.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + findingTypeStats_ = java.util.Collections.unmodifiableList(findingTypeStats_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.class, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.Builder.class); + } + + public static final int FINDING_TYPE_STATS_FIELD_NUMBER = 1; + private java.util.List findingTypeStats_; + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + @java.lang.Override + public java.util.List + getFindingTypeStatsList() { + return findingTypeStats_; + } + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + @java.lang.Override + public java.util.List + getFindingTypeStatsOrBuilderList() { + return findingTypeStats_; + } + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + @java.lang.Override + public int getFindingTypeStatsCount() { + return findingTypeStats_.size(); + } + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingTypeStats getFindingTypeStats(int index) { + return findingTypeStats_.get(index); + } + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder + getFindingTypeStatsOrBuilder(int index) { + return findingTypeStats_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < findingTypeStats_.size(); i++) { + output.writeMessage(1, findingTypeStats_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < findingTypeStats_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, findingTypeStats_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse other = + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) obj; + + if (!getFindingTypeStatsList().equals(other.getFindingTypeStatsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFindingTypeStatsCount() > 0) { + hash = (37 * hash) + FINDING_TYPE_STATS_FIELD_NUMBER; + hash = (53 * hash) + getFindingTypeStatsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListFindingTypeStats` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.class, + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFindingTypeStatsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingTypeStatsBuilder_ == null) { + findingTypeStats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + findingTypeStatsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse build() { + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse buildPartial() { + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse result = + new com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse(this); + int from_bitField0_ = bitField0_; + if (findingTypeStatsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + findingTypeStats_ = java.util.Collections.unmodifiableList(findingTypeStats_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.findingTypeStats_ = findingTypeStats_; + } else { + result.findingTypeStats_ = findingTypeStatsBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse other) { + if (other + == com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + .getDefaultInstance()) return this; + if (findingTypeStatsBuilder_ == null) { + if (!other.findingTypeStats_.isEmpty()) { + if (findingTypeStats_.isEmpty()) { + findingTypeStats_ = other.findingTypeStats_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.addAll(other.findingTypeStats_); + } + onChanged(); + } + } else { + if (!other.findingTypeStats_.isEmpty()) { + if (findingTypeStatsBuilder_.isEmpty()) { + findingTypeStatsBuilder_.dispose(); + findingTypeStatsBuilder_ = null; + findingTypeStats_ = other.findingTypeStats_; + bitField0_ = (bitField0_ & ~0x00000001); + findingTypeStatsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFindingTypeStatsFieldBuilder() + : null; + } else { + findingTypeStatsBuilder_.addAllMessages(other.findingTypeStats_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + findingTypeStats_ = java.util.Collections.emptyList(); + + private void ensureFindingTypeStatsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + findingTypeStats_ = + new java.util.ArrayList( + findingTypeStats_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.FindingTypeStats, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder, + com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder> + findingTypeStatsBuilder_; + + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public java.util.List + getFindingTypeStatsList() { + if (findingTypeStatsBuilder_ == null) { + return java.util.Collections.unmodifiableList(findingTypeStats_); + } else { + return findingTypeStatsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public int getFindingTypeStatsCount() { + if (findingTypeStatsBuilder_ == null) { + return findingTypeStats_.size(); + } else { + return findingTypeStatsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.FindingTypeStats getFindingTypeStats(int index) { + if (findingTypeStatsBuilder_ == null) { + return findingTypeStats_.get(index); + } else { + return findingTypeStatsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder setFindingTypeStats( + int index, com.google.cloud.websecurityscanner.v1.FindingTypeStats value) { + if (findingTypeStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.set(index, value); + onChanged(); + } else { + findingTypeStatsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder setFindingTypeStats( + int index, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder builderForValue) { + if (findingTypeStatsBuilder_ == null) { + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.set(index, builderForValue.build()); + onChanged(); + } else { + findingTypeStatsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder addFindingTypeStats( + com.google.cloud.websecurityscanner.v1.FindingTypeStats value) { + if (findingTypeStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.add(value); + onChanged(); + } else { + findingTypeStatsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder addFindingTypeStats( + int index, com.google.cloud.websecurityscanner.v1.FindingTypeStats value) { + if (findingTypeStatsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.add(index, value); + onChanged(); + } else { + findingTypeStatsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder addFindingTypeStats( + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder builderForValue) { + if (findingTypeStatsBuilder_ == null) { + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.add(builderForValue.build()); + onChanged(); + } else { + findingTypeStatsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder addFindingTypeStats( + int index, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder builderForValue) { + if (findingTypeStatsBuilder_ == null) { + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.add(index, builderForValue.build()); + onChanged(); + } else { + findingTypeStatsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder addAllFindingTypeStats( + java.lang.Iterable + values) { + if (findingTypeStatsBuilder_ == null) { + ensureFindingTypeStatsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, findingTypeStats_); + onChanged(); + } else { + findingTypeStatsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder clearFindingTypeStats() { + if (findingTypeStatsBuilder_ == null) { + findingTypeStats_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + findingTypeStatsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public Builder removeFindingTypeStats(int index) { + if (findingTypeStatsBuilder_ == null) { + ensureFindingTypeStatsIsMutable(); + findingTypeStats_.remove(index); + onChanged(); + } else { + findingTypeStatsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder + getFindingTypeStatsBuilder(int index) { + return getFindingTypeStatsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder + getFindingTypeStatsOrBuilder(int index) { + if (findingTypeStatsBuilder_ == null) { + return findingTypeStats_.get(index); + } else { + return findingTypeStatsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder> + getFindingTypeStatsOrBuilderList() { + if (findingTypeStatsBuilder_ != null) { + return findingTypeStatsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(findingTypeStats_); + } + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder + addFindingTypeStatsBuilder() { + return getFindingTypeStatsFieldBuilder() + .addBuilder(com.google.cloud.websecurityscanner.v1.FindingTypeStats.getDefaultInstance()); + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder + addFindingTypeStatsBuilder(int index) { + return getFindingTypeStatsFieldBuilder() + .addBuilder( + index, com.google.cloud.websecurityscanner.v1.FindingTypeStats.getDefaultInstance()); + } + /** + * + * + *
+     * The list of FindingTypeStats returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + public java.util.List + getFindingTypeStatsBuilderList() { + return getFindingTypeStatsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.FindingTypeStats, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder, + com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder> + getFindingTypeStatsFieldBuilder() { + if (findingTypeStatsBuilder_ == null) { + findingTypeStatsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.FindingTypeStats, + com.google.cloud.websecurityscanner.v1.FindingTypeStats.Builder, + com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder>( + findingTypeStats_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + findingTypeStats_ = null; + } + return findingTypeStatsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + private static final com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse(); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingTypeStatsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingTypeStatsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsResponseOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsResponseOrBuilder.java new file mode 100644 index 00000000..26d4bdd6 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingTypeStatsResponseOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListFindingTypeStatsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListFindingTypeStatsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + java.util.List getFindingTypeStatsList(); + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + com.google.cloud.websecurityscanner.v1.FindingTypeStats getFindingTypeStats(int index); + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + int getFindingTypeStatsCount(); + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + java.util.List + getFindingTypeStatsOrBuilderList(); + /** + * + * + *
+   * The list of FindingTypeStats returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.FindingTypeStats finding_type_stats = 1; + * + */ + com.google.cloud.websecurityscanner.v1.FindingTypeStatsOrBuilder getFindingTypeStatsOrBuilder( + int index); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsRequest.java new file mode 100644 index 00000000..8a83df89 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsRequest.java @@ -0,0 +1,1142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `ListFindings` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingsRequest} + */ +public final class ListFindingsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListFindingsRequest) + ListFindingsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsRequest.newBuilder() to construct. + private ListFindingsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsRequest() { + parent_ = ""; + filter_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 32: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest.class, + com.google.cloud.websecurityscanner.v1.ListFindingsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 2; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * The filter expression. The expression must be in the format: <field>
+   * <operator> <value>.
+   * Supported field: 'finding_type'.
+   * Supported operator: '='.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * The filter expression. The expression must be in the format: <field>
+   * <operator> <value>.
+   * Supported field: 'finding_type'.
+   * Supported operator: '='.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 4; + private int pageSize_; + /** + * + * + *
+   * The maximum number of Findings to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, filter_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(4, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, filter_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListFindingsRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListFindingsRequest other = + (com.google.cloud.websecurityscanner.v1.ListFindingsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListFindings` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListFindingsRequest) + com.google.cloud.websecurityscanner.v1.ListFindingsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingsRequest.class, + com.google.cloud.websecurityscanner.v1.ListFindingsRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListFindingsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + filter_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListFindingsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsRequest build() { + com.google.cloud.websecurityscanner.v1.ListFindingsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.ListFindingsRequest result = + new com.google.cloud.websecurityscanner.v1.ListFindingsRequest(this); + result.parent_ = parent_; + result.filter_ = filter_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListFindingsRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListFindingsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListFindingsRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.ListFindingsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListFindingsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListFindingsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan run resource name in the
+     * format
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * The filter expression. The expression must be in the format: <field>
+     * <operator> <value>.
+     * Supported field: 'finding_type'.
+     * Supported operator: '='.
+     * 
+ * + * string filter = 2; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The filter expression. The expression must be in the format: <field>
+     * <operator> <value>.
+     * Supported field: 'finding_type'.
+     * Supported operator: '='.
+     * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The filter expression. The expression must be in the format: <field>
+     * <operator> <value>.
+     * Supported field: 'finding_type'.
+     * Supported operator: '='.
+     * 
+ * + * string filter = 2; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + filter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The filter expression. The expression must be in the format: <field>
+     * <operator> <value>.
+     * Supported field: 'finding_type'.
+     * Supported operator: '='.
+     * 
+ * + * string filter = 2; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * The filter expression. The expression must be in the format: <field>
+     * <operator> <value>.
+     * Supported field: 'finding_type'.
+     * Supported operator: '='.
+     * 
+ * + * string filter = 2; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + filter_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 3; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 3; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of Findings to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of Findings to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 4; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of Findings to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListFindingsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListFindingsRequest) + private static final com.google.cloud.websecurityscanner.v1.ListFindingsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListFindingsRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsRequestOrBuilder.java new file mode 100644 index 00000000..c15c0164 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsRequestOrBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListFindingsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListFindingsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, which should be a scan run resource name in the
+   * format
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The filter expression. The expression must be in the format: <field>
+   * <operator> <value>.
+   * Supported field: 'finding_type'.
+   * Supported operator: '='.
+   * 
+ * + * string filter = 2; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * The filter expression. The expression must be in the format: <field>
+   * <operator> <value>.
+   * Supported field: 'finding_type'.
+   * Supported operator: '='.
+   * 
+ * + * string filter = 2; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of Findings to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 4; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsResponse.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsResponse.java new file mode 100644 index 00000000..0ff0dab2 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsResponse.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Response for the `ListFindings` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingsResponse} + */ +public final class ListFindingsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListFindingsResponse) + ListFindingsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFindingsResponse.newBuilder() to construct. + private ListFindingsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListFindingsResponse() { + findings_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListFindingsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListFindingsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + findings_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + findings_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.Finding.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + findings_ = java.util.Collections.unmodifiableList(findings_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingsResponse.class, + com.google.cloud.websecurityscanner.v1.ListFindingsResponse.Builder.class); + } + + public static final int FINDINGS_FIELD_NUMBER = 1; + private java.util.List findings_; + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + @java.lang.Override + public java.util.List getFindingsList() { + return findings_; + } + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + @java.lang.Override + public java.util.List + getFindingsOrBuilderList() { + return findings_; + } + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + @java.lang.Override + public int getFindingsCount() { + return findings_.size(); + } + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Finding getFindings(int index) { + return findings_.get(index); + } + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.FindingOrBuilder getFindingsOrBuilder(int index) { + return findings_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < findings_.size(); i++) { + output.writeMessage(1, findings_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < findings_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, findings_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListFindingsResponse)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListFindingsResponse other = + (com.google.cloud.websecurityscanner.v1.ListFindingsResponse) obj; + + if (!getFindingsList().equals(other.getFindingsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFindingsCount() > 0) { + hash = (37 * hash) + FINDINGS_FIELD_NUMBER; + hash = (53 * hash) + getFindingsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListFindingsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListFindings` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListFindingsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListFindingsResponse) + com.google.cloud.websecurityscanner.v1.ListFindingsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListFindingsResponse.class, + com.google.cloud.websecurityscanner.v1.ListFindingsResponse.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListFindingsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getFindingsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (findingsBuilder_ == null) { + findings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + findingsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsResponse getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListFindingsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsResponse build() { + com.google.cloud.websecurityscanner.v1.ListFindingsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsResponse buildPartial() { + com.google.cloud.websecurityscanner.v1.ListFindingsResponse result = + new com.google.cloud.websecurityscanner.v1.ListFindingsResponse(this); + int from_bitField0_ = bitField0_; + if (findingsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + findings_ = java.util.Collections.unmodifiableList(findings_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.findings_ = findings_; + } else { + result.findings_ = findingsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListFindingsResponse) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListFindingsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListFindingsResponse other) { + if (other == com.google.cloud.websecurityscanner.v1.ListFindingsResponse.getDefaultInstance()) + return this; + if (findingsBuilder_ == null) { + if (!other.findings_.isEmpty()) { + if (findings_.isEmpty()) { + findings_ = other.findings_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFindingsIsMutable(); + findings_.addAll(other.findings_); + } + onChanged(); + } + } else { + if (!other.findings_.isEmpty()) { + if (findingsBuilder_.isEmpty()) { + findingsBuilder_.dispose(); + findingsBuilder_ = null; + findings_ = other.findings_; + bitField0_ = (bitField0_ & ~0x00000001); + findingsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getFindingsFieldBuilder() + : null; + } else { + findingsBuilder_.addAllMessages(other.findings_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListFindingsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListFindingsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List findings_ = + java.util.Collections.emptyList(); + + private void ensureFindingsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + findings_ = + new java.util.ArrayList(findings_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Finding, + com.google.cloud.websecurityscanner.v1.Finding.Builder, + com.google.cloud.websecurityscanner.v1.FindingOrBuilder> + findingsBuilder_; + + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public java.util.List getFindingsList() { + if (findingsBuilder_ == null) { + return java.util.Collections.unmodifiableList(findings_); + } else { + return findingsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public int getFindingsCount() { + if (findingsBuilder_ == null) { + return findings_.size(); + } else { + return findingsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public com.google.cloud.websecurityscanner.v1.Finding getFindings(int index) { + if (findingsBuilder_ == null) { + return findings_.get(index); + } else { + return findingsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder setFindings(int index, com.google.cloud.websecurityscanner.v1.Finding value) { + if (findingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingsIsMutable(); + findings_.set(index, value); + onChanged(); + } else { + findingsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder setFindings( + int index, com.google.cloud.websecurityscanner.v1.Finding.Builder builderForValue) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.set(index, builderForValue.build()); + onChanged(); + } else { + findingsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder addFindings(com.google.cloud.websecurityscanner.v1.Finding value) { + if (findingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingsIsMutable(); + findings_.add(value); + onChanged(); + } else { + findingsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder addFindings(int index, com.google.cloud.websecurityscanner.v1.Finding value) { + if (findingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFindingsIsMutable(); + findings_.add(index, value); + onChanged(); + } else { + findingsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder addFindings( + com.google.cloud.websecurityscanner.v1.Finding.Builder builderForValue) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.add(builderForValue.build()); + onChanged(); + } else { + findingsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder addFindings( + int index, com.google.cloud.websecurityscanner.v1.Finding.Builder builderForValue) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.add(index, builderForValue.build()); + onChanged(); + } else { + findingsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder addAllFindings( + java.lang.Iterable values) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, findings_); + onChanged(); + } else { + findingsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder clearFindings() { + if (findingsBuilder_ == null) { + findings_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + findingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public Builder removeFindings(int index) { + if (findingsBuilder_ == null) { + ensureFindingsIsMutable(); + findings_.remove(index); + onChanged(); + } else { + findingsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public com.google.cloud.websecurityscanner.v1.Finding.Builder getFindingsBuilder(int index) { + return getFindingsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public com.google.cloud.websecurityscanner.v1.FindingOrBuilder getFindingsOrBuilder(int index) { + if (findingsBuilder_ == null) { + return findings_.get(index); + } else { + return findingsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public java.util.List + getFindingsOrBuilderList() { + if (findingsBuilder_ != null) { + return findingsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(findings_); + } + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public com.google.cloud.websecurityscanner.v1.Finding.Builder addFindingsBuilder() { + return getFindingsFieldBuilder() + .addBuilder(com.google.cloud.websecurityscanner.v1.Finding.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public com.google.cloud.websecurityscanner.v1.Finding.Builder addFindingsBuilder(int index) { + return getFindingsFieldBuilder() + .addBuilder(index, com.google.cloud.websecurityscanner.v1.Finding.getDefaultInstance()); + } + /** + * + * + *
+     * The list of Findings returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + public java.util.List + getFindingsBuilderList() { + return getFindingsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Finding, + com.google.cloud.websecurityscanner.v1.Finding.Builder, + com.google.cloud.websecurityscanner.v1.FindingOrBuilder> + getFindingsFieldBuilder() { + if (findingsBuilder_ == null) { + findingsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.Finding, + com.google.cloud.websecurityscanner.v1.Finding.Builder, + com.google.cloud.websecurityscanner.v1.FindingOrBuilder>( + findings_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + findings_ = null; + } + return findingsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListFindingsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListFindingsResponse) + private static final com.google.cloud.websecurityscanner.v1.ListFindingsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListFindingsResponse(); + } + + public static com.google.cloud.websecurityscanner.v1.ListFindingsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFindingsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFindingsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListFindingsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsResponseOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsResponseOrBuilder.java new file mode 100644 index 00000000..84050db4 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListFindingsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListFindingsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListFindingsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + java.util.List getFindingsList(); + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + com.google.cloud.websecurityscanner.v1.Finding getFindings(int index); + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + int getFindingsCount(); + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + java.util.List + getFindingsOrBuilderList(); + /** + * + * + *
+   * The list of Findings returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.Finding findings = 1; + */ + com.google.cloud.websecurityscanner.v1.FindingOrBuilder getFindingsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsRequest.java new file mode 100644 index 00000000..6464317b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsRequest.java @@ -0,0 +1,939 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `ListScanConfigs` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanConfigsRequest} + */ +public final class ListScanConfigsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + ListScanConfigsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListScanConfigsRequest.newBuilder() to construct. + private ListScanConfigsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListScanConfigsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListScanConfigsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListScanConfigsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.class, + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, which should be a project resource name in the
+   * format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, which should be a project resource name in the
+   * format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of ScanConfigs to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest other = + (com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListScanConfigs` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanConfigsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.class, + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest build() { + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest result = + new com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest other) { + if (other + == com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, which should be a project resource name in the
+     * format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a project resource name in the
+     * format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a project resource name in the
+     * format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a project resource name in the
+     * format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a project resource name in the
+     * format 'projects/{projectId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of ScanConfigs to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of ScanConfigs to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of ScanConfigs to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + private static final com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScanConfigsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScanConfigsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsRequestOrBuilder.java new file mode 100644 index 00000000..5b17e58e --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListScanConfigsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListScanConfigsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, which should be a project resource name in the
+   * format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, which should be a project resource name in the
+   * format 'projects/{projectId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of ScanConfigs to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsResponse.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsResponse.java new file mode 100644 index 00000000..07a7e303 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsResponse.java @@ -0,0 +1,1154 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Response for the `ListScanConfigs` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanConfigsResponse} + */ +public final class ListScanConfigsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + ListScanConfigsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListScanConfigsResponse.newBuilder() to construct. + private ListScanConfigsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListScanConfigsResponse() { + scanConfigs_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListScanConfigsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListScanConfigsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + scanConfigs_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + scanConfigs_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.parser(), + extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + scanConfigs_ = java.util.Collections.unmodifiableList(scanConfigs_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.class, + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.Builder.class); + } + + public static final int SCAN_CONFIGS_FIELD_NUMBER = 1; + private java.util.List scanConfigs_; + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + @java.lang.Override + public java.util.List getScanConfigsList() { + return scanConfigs_; + } + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + @java.lang.Override + public java.util.List + getScanConfigsOrBuilderList() { + return scanConfigs_; + } + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + @java.lang.Override + public int getScanConfigsCount() { + return scanConfigs_.size(); + } + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfigs(int index) { + return scanConfigs_.get(index); + } + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigsOrBuilder( + int index) { + return scanConfigs_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < scanConfigs_.size(); i++) { + output.writeMessage(1, scanConfigs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < scanConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, scanConfigs_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse other = + (com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse) obj; + + if (!getScanConfigsList().equals(other.getScanConfigsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getScanConfigsCount() > 0) { + hash = (37 * hash) + SCAN_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getScanConfigsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListScanConfigs` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanConfigsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.class, + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getScanConfigsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (scanConfigsBuilder_ == null) { + scanConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + scanConfigsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse build() { + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse buildPartial() { + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse result = + new com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse(this); + int from_bitField0_ = bitField0_; + if (scanConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + scanConfigs_ = java.util.Collections.unmodifiableList(scanConfigs_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.scanConfigs_ = scanConfigs_; + } else { + result.scanConfigs_ = scanConfigsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse other) { + if (other + == com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse.getDefaultInstance()) + return this; + if (scanConfigsBuilder_ == null) { + if (!other.scanConfigs_.isEmpty()) { + if (scanConfigs_.isEmpty()) { + scanConfigs_ = other.scanConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureScanConfigsIsMutable(); + scanConfigs_.addAll(other.scanConfigs_); + } + onChanged(); + } + } else { + if (!other.scanConfigs_.isEmpty()) { + if (scanConfigsBuilder_.isEmpty()) { + scanConfigsBuilder_.dispose(); + scanConfigsBuilder_ = null; + scanConfigs_ = other.scanConfigs_; + bitField0_ = (bitField0_ & ~0x00000001); + scanConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getScanConfigsFieldBuilder() + : null; + } else { + scanConfigsBuilder_.addAllMessages(other.scanConfigs_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List scanConfigs_ = + java.util.Collections.emptyList(); + + private void ensureScanConfigsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + scanConfigs_ = + new java.util.ArrayList( + scanConfigs_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder> + scanConfigsBuilder_; + + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public java.util.List getScanConfigsList() { + if (scanConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(scanConfigs_); + } else { + return scanConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public int getScanConfigsCount() { + if (scanConfigsBuilder_ == null) { + return scanConfigs_.size(); + } else { + return scanConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfigs(int index) { + if (scanConfigsBuilder_ == null) { + return scanConfigs_.get(index); + } else { + return scanConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder setScanConfigs( + int index, com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanConfigsIsMutable(); + scanConfigs_.set(index, value); + onChanged(); + } else { + scanConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder setScanConfigs( + int index, com.google.cloud.websecurityscanner.v1.ScanConfig.Builder builderForValue) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + scanConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs(com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanConfigsIsMutable(); + scanConfigs_.add(value); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs( + int index, com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanConfigsIsMutable(); + scanConfigs_.add(index, value); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs( + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder builderForValue) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.add(builderForValue.build()); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder addScanConfigs( + int index, com.google.cloud.websecurityscanner.v1.ScanConfig.Builder builderForValue) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + scanConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder addAllScanConfigs( + java.lang.Iterable values) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scanConfigs_); + onChanged(); + } else { + scanConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder clearScanConfigs() { + if (scanConfigsBuilder_ == null) { + scanConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + scanConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public Builder removeScanConfigs(int index) { + if (scanConfigsBuilder_ == null) { + ensureScanConfigsIsMutable(); + scanConfigs_.remove(index); + onChanged(); + } else { + scanConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Builder getScanConfigsBuilder( + int index) { + return getScanConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigsOrBuilder( + int index) { + if (scanConfigsBuilder_ == null) { + return scanConfigs_.get(index); + } else { + return scanConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public java.util.List + getScanConfigsOrBuilderList() { + if (scanConfigsBuilder_ != null) { + return scanConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(scanConfigs_); + } + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Builder addScanConfigsBuilder() { + return getScanConfigsFieldBuilder() + .addBuilder(com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Builder addScanConfigsBuilder( + int index) { + return getScanConfigsFieldBuilder() + .addBuilder( + index, com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ScanConfigs returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + public java.util.List + getScanConfigsBuilderList() { + return getScanConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder> + getScanConfigsFieldBuilder() { + if (scanConfigsBuilder_ == null) { + scanConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder>( + scanConfigs_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + scanConfigs_ = null; + } + return scanConfigsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + private static final com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse(); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScanConfigsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScanConfigsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanConfigsResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsResponseOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsResponseOrBuilder.java new file mode 100644 index 00000000..37f677ab --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanConfigsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListScanConfigsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListScanConfigsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + java.util.List getScanConfigsList(); + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfigs(int index); + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + int getScanConfigsCount(); + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + java.util.List + getScanConfigsOrBuilderList(); + /** + * + * + *
+   * The list of ScanConfigs returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanConfig scan_configs = 1; + */ + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsRequest.java new file mode 100644 index 00000000..ab7c4eca --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsRequest.java @@ -0,0 +1,935 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `ListScanRuns` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanRunsRequest} + */ +public final class ListScanRunsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListScanRunsRequest) + ListScanRunsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListScanRunsRequest.newBuilder() to construct. + private ListScanRunsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListScanRunsRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListScanRunsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListScanRunsRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.class, + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name, which should be a scan resource name in the
+   * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource name, which should be a scan resource name in the
+   * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of ScanRuns to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, pageToken_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, pageToken_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListScanRunsRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest other = + (com.google.cloud.websecurityscanner.v1.ListScanRunsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `ListScanRuns` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanRunsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListScanRunsRequest) + com.google.cloud.websecurityscanner.v1.ListScanRunsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.class, + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + pageToken_ = ""; + + pageSize_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsRequest build() { + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest result = + new com.google.cloud.websecurityscanner.v1.ListScanRunsRequest(this); + result.parent_ = parent_; + result.pageToken_ = pageToken_; + result.pageSize_ = pageSize_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListScanRunsRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListScanRunsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListScanRunsRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.ListScanRunsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListScanRunsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListScanRunsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name, which should be a scan resource name in the
+     * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string parent = 1; + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan resource name in the
+     * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan resource name in the
+     * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan resource name in the
+     * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string parent = 1; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name, which should be a scan resource name in the
+     * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string parent = 1; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A token identifying a page of results to be returned. This should be a
+     * `next_page_token` value returned from a previous List request.
+     * If unspecified, the first page of results is returned.
+     * 
+ * + * string page_token = 2; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of ScanRuns to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of ScanRuns to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of ScanRuns to return, can be limited by server.
+     * If not specified or not positive, the implementation will select a
+     * reasonable value.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListScanRunsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListScanRunsRequest) + private static final com.google.cloud.websecurityscanner.v1.ListScanRunsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListScanRunsRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScanRunsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScanRunsRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsRequestOrBuilder.java new file mode 100644 index 00000000..bc5e59d7 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsRequestOrBuilder.java @@ -0,0 +1,96 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListScanRunsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListScanRunsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name, which should be a scan resource name in the
+   * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string parent = 1; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name, which should be a scan resource name in the
+   * format 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string parent = 1; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A token identifying a page of results to be returned. This should be a
+   * `next_page_token` value returned from a previous List request.
+   * If unspecified, the first page of results is returned.
+   * 
+ * + * string page_token = 2; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * The maximum number of ScanRuns to return, can be limited by server.
+   * If not specified or not positive, the implementation will select a
+   * reasonable value.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsResponse.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsResponse.java new file mode 100644 index 00000000..77745be6 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsResponse.java @@ -0,0 +1,1139 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Response for the `ListScanRuns` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanRunsResponse} + */ +public final class ListScanRunsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ListScanRunsResponse) + ListScanRunsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListScanRunsResponse.newBuilder() to construct. + private ListScanRunsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListScanRunsResponse() { + scanRuns_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListScanRunsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListScanRunsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + scanRuns_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + scanRuns_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanRun.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + scanRuns_ = java.util.Collections.unmodifiableList(scanRuns_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.class, + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.Builder.class); + } + + public static final int SCAN_RUNS_FIELD_NUMBER = 1; + private java.util.List scanRuns_; + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + @java.lang.Override + public java.util.List getScanRunsList() { + return scanRuns_; + } + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + @java.lang.Override + public java.util.List + getScanRunsOrBuilderList() { + return scanRuns_; + } + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + @java.lang.Override + public int getScanRunsCount() { + return scanRuns_.size(); + } + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun getScanRuns(int index) { + return scanRuns_.get(index); + } + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder getScanRunsOrBuilder(int index) { + return scanRuns_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < scanRuns_.size(); i++) { + output.writeMessage(1, scanRuns_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < scanRuns_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, scanRuns_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ListScanRunsResponse)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse other = + (com.google.cloud.websecurityscanner.v1.ListScanRunsResponse) obj; + + if (!getScanRunsList().equals(other.getScanRunsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getScanRunsCount() > 0) { + hash = (37 * hash) + SCAN_RUNS_FIELD_NUMBER; + hash = (53 * hash) + getScanRunsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response for the `ListScanRuns` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ListScanRunsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ListScanRunsResponse) + com.google.cloud.websecurityscanner.v1.ListScanRunsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.class, + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getScanRunsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (scanRunsBuilder_ == null) { + scanRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + scanRunsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsResponse getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsResponse build() { + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsResponse buildPartial() { + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse result = + new com.google.cloud.websecurityscanner.v1.ListScanRunsResponse(this); + int from_bitField0_ = bitField0_; + if (scanRunsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + scanRuns_ = java.util.Collections.unmodifiableList(scanRuns_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.scanRuns_ = scanRuns_; + } else { + result.scanRuns_ = scanRunsBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ListScanRunsResponse) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ListScanRunsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ListScanRunsResponse other) { + if (other == com.google.cloud.websecurityscanner.v1.ListScanRunsResponse.getDefaultInstance()) + return this; + if (scanRunsBuilder_ == null) { + if (!other.scanRuns_.isEmpty()) { + if (scanRuns_.isEmpty()) { + scanRuns_ = other.scanRuns_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureScanRunsIsMutable(); + scanRuns_.addAll(other.scanRuns_); + } + onChanged(); + } + } else { + if (!other.scanRuns_.isEmpty()) { + if (scanRunsBuilder_.isEmpty()) { + scanRunsBuilder_.dispose(); + scanRunsBuilder_ = null; + scanRuns_ = other.scanRuns_; + bitField0_ = (bitField0_ & ~0x00000001); + scanRunsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getScanRunsFieldBuilder() + : null; + } else { + scanRunsBuilder_.addAllMessages(other.scanRuns_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ListScanRunsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ListScanRunsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List scanRuns_ = + java.util.Collections.emptyList(); + + private void ensureScanRunsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + scanRuns_ = + new java.util.ArrayList(scanRuns_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRun, + com.google.cloud.websecurityscanner.v1.ScanRun.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder> + scanRunsBuilder_; + + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public java.util.List getScanRunsList() { + if (scanRunsBuilder_ == null) { + return java.util.Collections.unmodifiableList(scanRuns_); + } else { + return scanRunsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public int getScanRunsCount() { + if (scanRunsBuilder_ == null) { + return scanRuns_.size(); + } else { + return scanRunsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanRun getScanRuns(int index) { + if (scanRunsBuilder_ == null) { + return scanRuns_.get(index); + } else { + return scanRunsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder setScanRuns(int index, com.google.cloud.websecurityscanner.v1.ScanRun value) { + if (scanRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanRunsIsMutable(); + scanRuns_.set(index, value); + onChanged(); + } else { + scanRunsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder setScanRuns( + int index, com.google.cloud.websecurityscanner.v1.ScanRun.Builder builderForValue) { + if (scanRunsBuilder_ == null) { + ensureScanRunsIsMutable(); + scanRuns_.set(index, builderForValue.build()); + onChanged(); + } else { + scanRunsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder addScanRuns(com.google.cloud.websecurityscanner.v1.ScanRun value) { + if (scanRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanRunsIsMutable(); + scanRuns_.add(value); + onChanged(); + } else { + scanRunsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder addScanRuns(int index, com.google.cloud.websecurityscanner.v1.ScanRun value) { + if (scanRunsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureScanRunsIsMutable(); + scanRuns_.add(index, value); + onChanged(); + } else { + scanRunsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder addScanRuns( + com.google.cloud.websecurityscanner.v1.ScanRun.Builder builderForValue) { + if (scanRunsBuilder_ == null) { + ensureScanRunsIsMutable(); + scanRuns_.add(builderForValue.build()); + onChanged(); + } else { + scanRunsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder addScanRuns( + int index, com.google.cloud.websecurityscanner.v1.ScanRun.Builder builderForValue) { + if (scanRunsBuilder_ == null) { + ensureScanRunsIsMutable(); + scanRuns_.add(index, builderForValue.build()); + onChanged(); + } else { + scanRunsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder addAllScanRuns( + java.lang.Iterable values) { + if (scanRunsBuilder_ == null) { + ensureScanRunsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, scanRuns_); + onChanged(); + } else { + scanRunsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder clearScanRuns() { + if (scanRunsBuilder_ == null) { + scanRuns_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + scanRunsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public Builder removeScanRuns(int index) { + if (scanRunsBuilder_ == null) { + ensureScanRunsIsMutable(); + scanRuns_.remove(index); + onChanged(); + } else { + scanRunsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanRun.Builder getScanRunsBuilder(int index) { + return getScanRunsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder getScanRunsOrBuilder(int index) { + if (scanRunsBuilder_ == null) { + return scanRuns_.get(index); + } else { + return scanRunsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public java.util.List + getScanRunsOrBuilderList() { + if (scanRunsBuilder_ != null) { + return scanRunsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(scanRuns_); + } + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanRun.Builder addScanRunsBuilder() { + return getScanRunsFieldBuilder() + .addBuilder(com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public com.google.cloud.websecurityscanner.v1.ScanRun.Builder addScanRunsBuilder(int index) { + return getScanRunsFieldBuilder() + .addBuilder(index, com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance()); + } + /** + * + * + *
+     * The list of ScanRuns returned.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + public java.util.List + getScanRunsBuilderList() { + return getScanRunsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRun, + com.google.cloud.websecurityscanner.v1.ScanRun.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder> + getScanRunsFieldBuilder() { + if (scanRunsBuilder_ == null) { + scanRunsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRun, + com.google.cloud.websecurityscanner.v1.ScanRun.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder>( + scanRuns_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + scanRuns_ = null; + } + return scanRunsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no
+     * more results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ListScanRunsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ListScanRunsResponse) + private static final com.google.cloud.websecurityscanner.v1.ListScanRunsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ListScanRunsResponse(); + } + + public static com.google.cloud.websecurityscanner.v1.ListScanRunsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListScanRunsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListScanRunsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ListScanRunsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsResponseOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsResponseOrBuilder.java new file mode 100644 index 00000000..d4e4c85b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ListScanRunsResponseOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ListScanRunsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ListScanRunsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + java.util.List getScanRunsList(); + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + com.google.cloud.websecurityscanner.v1.ScanRun getScanRuns(int index); + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + int getScanRunsCount(); + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + java.util.List + getScanRunsOrBuilderList(); + /** + * + * + *
+   * The list of ScanRuns returned.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRun scan_runs = 1; + */ + com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder getScanRunsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no
+   * more results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/OutdatedLibrary.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/OutdatedLibrary.java new file mode 100644 index 00000000..9c3a338d --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/OutdatedLibrary.java @@ -0,0 +1,1096 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Information reported for an outdated library.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.OutdatedLibrary} + */ +public final class OutdatedLibrary extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.OutdatedLibrary) + OutdatedLibraryOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutdatedLibrary.newBuilder() to construct. + private OutdatedLibrary(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutdatedLibrary() { + libraryName_ = ""; + version_ = ""; + learnMoreUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutdatedLibrary(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OutdatedLibrary( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + libraryName_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + version_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + learnMoreUrls_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + learnMoreUrls_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + learnMoreUrls_ = learnMoreUrls_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.class, + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder.class); + } + + public static final int LIBRARY_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object libraryName_; + /** + * + * + *
+   * The name of the outdated library.
+   * 
+ * + * string library_name = 1; + * + * @return The libraryName. + */ + @java.lang.Override + public java.lang.String getLibraryName() { + java.lang.Object ref = libraryName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + libraryName_ = s; + return s; + } + } + /** + * + * + *
+   * The name of the outdated library.
+   * 
+ * + * string library_name = 1; + * + * @return The bytes for libraryName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLibraryNameBytes() { + java.lang.Object ref = libraryName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + libraryName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_FIELD_NUMBER = 2; + private volatile java.lang.Object version_; + /** + * + * + *
+   * The version number.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * The version number.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LEARN_MORE_URLS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList learnMoreUrls_; + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @return A list containing the learnMoreUrls. + */ + public com.google.protobuf.ProtocolStringList getLearnMoreUrlsList() { + return learnMoreUrls_; + } + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @return The count of learnMoreUrls. + */ + public int getLearnMoreUrlsCount() { + return learnMoreUrls_.size(); + } + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index of the element to return. + * @return The learnMoreUrls at the given index. + */ + public java.lang.String getLearnMoreUrls(int index) { + return learnMoreUrls_.get(index); + } + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index of the value to return. + * @return The bytes of the learnMoreUrls at the given index. + */ + public com.google.protobuf.ByteString getLearnMoreUrlsBytes(int index) { + return learnMoreUrls_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getLibraryNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, libraryName_); + } + if (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, version_); + } + for (int i = 0; i < learnMoreUrls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, learnMoreUrls_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getLibraryNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, libraryName_); + } + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, version_); + } + { + int dataSize = 0; + for (int i = 0; i < learnMoreUrls_.size(); i++) { + dataSize += computeStringSizeNoTag(learnMoreUrls_.getRaw(i)); + } + size += dataSize; + size += 1 * getLearnMoreUrlsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.OutdatedLibrary)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.OutdatedLibrary other = + (com.google.cloud.websecurityscanner.v1.OutdatedLibrary) obj; + + if (!getLibraryName().equals(other.getLibraryName())) return false; + if (!getVersion().equals(other.getVersion())) return false; + if (!getLearnMoreUrlsList().equals(other.getLearnMoreUrlsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LIBRARY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getLibraryName().hashCode(); + hash = (37 * hash) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + if (getLearnMoreUrlsCount() > 0) { + hash = (37 * hash) + LEARN_MORE_URLS_FIELD_NUMBER; + hash = (53 * hash) + getLearnMoreUrlsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information reported for an outdated library.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.OutdatedLibrary} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.OutdatedLibrary) + com.google.cloud.websecurityscanner.v1.OutdatedLibraryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.class, + com.google.cloud.websecurityscanner.v1.OutdatedLibrary.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.OutdatedLibrary.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + libraryName_ = ""; + + version_ = ""; + + learnMoreUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_OutdatedLibrary_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.OutdatedLibrary.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary build() { + com.google.cloud.websecurityscanner.v1.OutdatedLibrary result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary buildPartial() { + com.google.cloud.websecurityscanner.v1.OutdatedLibrary result = + new com.google.cloud.websecurityscanner.v1.OutdatedLibrary(this); + int from_bitField0_ = bitField0_; + result.libraryName_ = libraryName_; + result.version_ = version_; + if (((bitField0_ & 0x00000001) != 0)) { + learnMoreUrls_ = learnMoreUrls_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.learnMoreUrls_ = learnMoreUrls_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.OutdatedLibrary) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.OutdatedLibrary) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.OutdatedLibrary other) { + if (other == com.google.cloud.websecurityscanner.v1.OutdatedLibrary.getDefaultInstance()) + return this; + if (!other.getLibraryName().isEmpty()) { + libraryName_ = other.libraryName_; + onChanged(); + } + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.learnMoreUrls_.isEmpty()) { + if (learnMoreUrls_.isEmpty()) { + learnMoreUrls_ = other.learnMoreUrls_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureLearnMoreUrlsIsMutable(); + learnMoreUrls_.addAll(other.learnMoreUrls_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.OutdatedLibrary parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.OutdatedLibrary) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object libraryName_ = ""; + /** + * + * + *
+     * The name of the outdated library.
+     * 
+ * + * string library_name = 1; + * + * @return The libraryName. + */ + public java.lang.String getLibraryName() { + java.lang.Object ref = libraryName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + libraryName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The name of the outdated library.
+     * 
+ * + * string library_name = 1; + * + * @return The bytes for libraryName. + */ + public com.google.protobuf.ByteString getLibraryNameBytes() { + java.lang.Object ref = libraryName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + libraryName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The name of the outdated library.
+     * 
+ * + * string library_name = 1; + * + * @param value The libraryName to set. + * @return This builder for chaining. + */ + public Builder setLibraryName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + libraryName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the outdated library.
+     * 
+ * + * string library_name = 1; + * + * @return This builder for chaining. + */ + public Builder clearLibraryName() { + + libraryName_ = getDefaultInstance().getLibraryName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The name of the outdated library.
+     * 
+ * + * string library_name = 1; + * + * @param value The bytes for libraryName to set. + * @return This builder for chaining. + */ + public Builder setLibraryNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + libraryName_ = value; + onChanged(); + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * The version number.
+     * 
+ * + * string version = 2; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The version number.
+     * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The version number.
+     * 
+ * + * string version = 2; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The version number.
+     * 
+ * + * string version = 2; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The version number.
+     * 
+ * + * string version = 2; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList learnMoreUrls_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureLearnMoreUrlsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + learnMoreUrls_ = new com.google.protobuf.LazyStringArrayList(learnMoreUrls_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @return A list containing the learnMoreUrls. + */ + public com.google.protobuf.ProtocolStringList getLearnMoreUrlsList() { + return learnMoreUrls_.getUnmodifiableView(); + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @return The count of learnMoreUrls. + */ + public int getLearnMoreUrlsCount() { + return learnMoreUrls_.size(); + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index of the element to return. + * @return The learnMoreUrls at the given index. + */ + public java.lang.String getLearnMoreUrls(int index) { + return learnMoreUrls_.get(index); + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index of the value to return. + * @return The bytes of the learnMoreUrls at the given index. + */ + public com.google.protobuf.ByteString getLearnMoreUrlsBytes(int index) { + return learnMoreUrls_.getByteString(index); + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index to set the value at. + * @param value The learnMoreUrls to set. + * @return This builder for chaining. + */ + public Builder setLearnMoreUrls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLearnMoreUrlsIsMutable(); + learnMoreUrls_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @param value The learnMoreUrls to add. + * @return This builder for chaining. + */ + public Builder addLearnMoreUrls(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureLearnMoreUrlsIsMutable(); + learnMoreUrls_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @param values The learnMoreUrls to add. + * @return This builder for chaining. + */ + public Builder addAllLearnMoreUrls(java.lang.Iterable values) { + ensureLearnMoreUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, learnMoreUrls_); + onChanged(); + return this; + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @return This builder for chaining. + */ + public Builder clearLearnMoreUrls() { + learnMoreUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * URLs to learn more information about the vulnerabilities in the library.
+     * 
+ * + * repeated string learn_more_urls = 3; + * + * @param value The bytes of the learnMoreUrls to add. + * @return This builder for chaining. + */ + public Builder addLearnMoreUrlsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureLearnMoreUrlsIsMutable(); + learnMoreUrls_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.OutdatedLibrary) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.OutdatedLibrary) + private static final com.google.cloud.websecurityscanner.v1.OutdatedLibrary DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.OutdatedLibrary(); + } + + public static com.google.cloud.websecurityscanner.v1.OutdatedLibrary getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutdatedLibrary parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutdatedLibrary(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.OutdatedLibrary getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/OutdatedLibraryOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/OutdatedLibraryOrBuilder.java new file mode 100644 index 00000000..1cf40c09 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/OutdatedLibraryOrBuilder.java @@ -0,0 +1,126 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface OutdatedLibraryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.OutdatedLibrary) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The name of the outdated library.
+   * 
+ * + * string library_name = 1; + * + * @return The libraryName. + */ + java.lang.String getLibraryName(); + /** + * + * + *
+   * The name of the outdated library.
+   * 
+ * + * string library_name = 1; + * + * @return The bytes for libraryName. + */ + com.google.protobuf.ByteString getLibraryNameBytes(); + + /** + * + * + *
+   * The version number.
+   * 
+ * + * string version = 2; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * The version number.
+   * 
+ * + * string version = 2; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @return A list containing the learnMoreUrls. + */ + java.util.List getLearnMoreUrlsList(); + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @return The count of learnMoreUrls. + */ + int getLearnMoreUrlsCount(); + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index of the element to return. + * @return The learnMoreUrls at the given index. + */ + java.lang.String getLearnMoreUrls(int index); + /** + * + * + *
+   * URLs to learn more information about the vulnerabilities in the library.
+   * 
+ * + * repeated string learn_more_urls = 3; + * + * @param index The index of the value to return. + * @return The bytes of the learnMoreUrls at the given index. + */ + com.google.protobuf.ByteString getLearnMoreUrlsBytes(int index); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfig.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfig.java new file mode 100644 index 00000000..7d6a2c58 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfig.java @@ -0,0 +1,9777 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_config.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * A ScanConfig resource contains the configurations to launch a scan.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfig} + */ +public final class ScanConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig) + ScanConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScanConfig.newBuilder() to construct. + private ScanConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScanConfig() { + name_ = ""; + displayName_ = ""; + startingUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + userAgent_ = 0; + blacklistPatterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + exportToSecurityCommandCenter_ = 0; + riskLevel_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScanConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScanConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 24: + { + maxQps_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + startingUrls_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + startingUrls_.add(s); + break; + } + case 42: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder subBuilder = + null; + if (authentication_ != null) { + subBuilder = authentication_.toBuilder(); + } + authentication_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(authentication_); + authentication_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + int rawValue = input.readEnum(); + + userAgent_ = rawValue; + break; + } + case 58: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + blacklistPatterns_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + blacklistPatterns_.add(s); + break; + } + case 66: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder subBuilder = null; + if (schedule_ != null) { + subBuilder = schedule_.toBuilder(); + } + schedule_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(schedule_); + schedule_ = subBuilder.buildPartial(); + } + + break; + } + case 80: + { + int rawValue = input.readEnum(); + + exportToSecurityCommandCenter_ = rawValue; + break; + } + case 96: + { + int rawValue = input.readEnum(); + + riskLevel_ = rawValue; + break; + } + case 104: + { + managedScan_ = input.readBool(); + break; + } + case 112: + { + staticIpScan_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + startingUrls_ = startingUrls_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + blacklistPatterns_ = blacklistPatterns_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder.class); + } + + /** + * + * + *
+   * Type of user agents used for scanning.
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanConfig.UserAgent} + */ + public enum UserAgent implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * The user agent is unknown. Service will default to CHROME_LINUX.
+     * 
+ * + * USER_AGENT_UNSPECIFIED = 0; + */ + USER_AGENT_UNSPECIFIED(0), + /** + * + * + *
+     * Chrome on Linux. This is the service default if unspecified.
+     * 
+ * + * CHROME_LINUX = 1; + */ + CHROME_LINUX(1), + /** + * + * + *
+     * Chrome on Android.
+     * 
+ * + * CHROME_ANDROID = 2; + */ + CHROME_ANDROID(2), + /** + * + * + *
+     * Safari on IPhone.
+     * 
+ * + * SAFARI_IPHONE = 3; + */ + SAFARI_IPHONE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * The user agent is unknown. Service will default to CHROME_LINUX.
+     * 
+ * + * USER_AGENT_UNSPECIFIED = 0; + */ + public static final int USER_AGENT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Chrome on Linux. This is the service default if unspecified.
+     * 
+ * + * CHROME_LINUX = 1; + */ + public static final int CHROME_LINUX_VALUE = 1; + /** + * + * + *
+     * Chrome on Android.
+     * 
+ * + * CHROME_ANDROID = 2; + */ + public static final int CHROME_ANDROID_VALUE = 2; + /** + * + * + *
+     * Safari on IPhone.
+     * 
+ * + * SAFARI_IPHONE = 3; + */ + public static final int SAFARI_IPHONE_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static UserAgent valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static UserAgent forNumber(int value) { + switch (value) { + case 0: + return USER_AGENT_UNSPECIFIED; + case 1: + return CHROME_LINUX; + case 2: + return CHROME_ANDROID; + case 3: + return SAFARI_IPHONE; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public UserAgent findValueByNumber(int number) { + return UserAgent.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final UserAgent[] VALUES = values(); + + public static UserAgent valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private UserAgent(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanConfig.UserAgent) + } + + /** + * + * + *
+   * Scan risk levels supported by Web Security Scanner. LOW impact
+   * scanning will minimize requests with the potential to modify data. To
+   * achieve the maximum scan coverage, NORMAL risk level is recommended.
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel} + */ + public enum RiskLevel implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Use default, which is NORMAL.
+     * 
+ * + * RISK_LEVEL_UNSPECIFIED = 0; + */ + RISK_LEVEL_UNSPECIFIED(0), + /** + * + * + *
+     * Normal scanning (Recommended)
+     * 
+ * + * NORMAL = 1; + */ + NORMAL(1), + /** + * + * + *
+     * Lower impact scanning
+     * 
+ * + * LOW = 2; + */ + LOW(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Use default, which is NORMAL.
+     * 
+ * + * RISK_LEVEL_UNSPECIFIED = 0; + */ + public static final int RISK_LEVEL_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Normal scanning (Recommended)
+     * 
+ * + * NORMAL = 1; + */ + public static final int NORMAL_VALUE = 1; + /** + * + * + *
+     * Lower impact scanning
+     * 
+ * + * LOW = 2; + */ + public static final int LOW_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static RiskLevel valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static RiskLevel forNumber(int value) { + switch (value) { + case 0: + return RISK_LEVEL_UNSPECIFIED; + case 1: + return NORMAL; + case 2: + return LOW; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public RiskLevel findValueByNumber(int number) { + return RiskLevel.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final RiskLevel[] VALUES = values(); + + public static RiskLevel valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private RiskLevel(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel) + } + + /** + * + * + *
+   * Controls export of scan configurations and results to Security
+   * Command Center.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter} + */ + public enum ExportToSecurityCommandCenter implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Use default, which is ENABLED.
+     * 
+ * + * EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; + */ + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED(0), + /** + * + * + *
+     * Export results of this scan to Security Command Center.
+     * 
+ * + * ENABLED = 1; + */ + ENABLED(1), + /** + * + * + *
+     * Do not export results of this scan to Security Command Center.
+     * 
+ * + * DISABLED = 2; + */ + DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Use default, which is ENABLED.
+     * 
+ * + * EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; + */ + public static final int EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Export results of this scan to Security Command Center.
+     * 
+ * + * ENABLED = 1; + */ + public static final int ENABLED_VALUE = 1; + /** + * + * + *
+     * Do not export results of this scan to Security Command Center.
+     * 
+ * + * DISABLED = 2; + */ + public static final int DISABLED_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExportToSecurityCommandCenter valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ExportToSecurityCommandCenter forNumber(int value) { + switch (value) { + case 0: + return EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED; + case 1: + return ENABLED; + case 2: + return DISABLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExportToSecurityCommandCenter findValueByNumber(int number) { + return ExportToSecurityCommandCenter.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.getDescriptor() + .getEnumTypes() + .get(2); + } + + private static final ExportToSecurityCommandCenter[] VALUES = values(); + + public static ExportToSecurityCommandCenter valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ExportToSecurityCommandCenter(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter) + } + + public interface AuthenticationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Authentication using a Google account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + * + * @return Whether the googleAccount field is set. + */ + boolean hasGoogleAccount(); + /** + * + * + *
+     * Authentication using a Google account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + * + * @return The googleAccount. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + getGoogleAccount(); + /** + * + * + *
+     * Authentication using a Google account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccountOrBuilder + getGoogleAccountOrBuilder(); + + /** + * + * + *
+     * Authentication using a custom account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + * + * @return Whether the customAccount field is set. + */ + boolean hasCustomAccount(); + /** + * + * + *
+     * Authentication using a custom account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + * + * @return The customAccount. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + getCustomAccount(); + /** + * + * + *
+     * Authentication using a custom account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccountOrBuilder + getCustomAccountOrBuilder(); + + /** + * + * + *
+     * Authentication using Identity-Aware-Proxy (IAP).
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + * + * @return Whether the iapCredential field is set. + */ + boolean hasIapCredential(); + /** + * + * + *
+     * Authentication using Identity-Aware-Proxy (IAP).
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + * + * @return The iapCredential. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + getIapCredential(); + /** + * + * + *
+     * Authentication using Identity-Aware-Proxy (IAP).
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredentialOrBuilder + getIapCredentialOrBuilder(); + + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.AuthenticationCase + getAuthenticationCase(); + } + /** + * + * + *
+   * Scan authentication configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfig.Authentication} + */ + public static final class Authentication extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + AuthenticationOrBuilder { + private static final long serialVersionUID = 0L; + // Use Authentication.newBuilder() to construct. + private Authentication(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Authentication() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Authentication(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Authentication( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .Builder + subBuilder = null; + if (authenticationCase_ == 1) { + subBuilder = + ((com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccount) + authentication_) + .toBuilder(); + } + authentication_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccount.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccount) + authentication_); + authentication_ = subBuilder.buildPartial(); + } + authenticationCase_ = 1; + break; + } + case 18: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .Builder + subBuilder = null; + if (authenticationCase_ == 2) { + subBuilder = + ((com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccount) + authentication_) + .toBuilder(); + } + authentication_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccount.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccount) + authentication_); + authentication_ = subBuilder.buildPartial(); + } + authenticationCase_ = 2; + break; + } + case 34: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .Builder + subBuilder = null; + if (authenticationCase_ == 4) { + subBuilder = + ((com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential) + authentication_) + .toBuilder(); + } + authentication_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential) + authentication_); + authentication_ = subBuilder.buildPartial(); + } + authenticationCase_ = 4; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder.class); + } + + public interface GoogleAccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. The user name of the Google account.
+       * 
+ * + * string username = 1; + * + * @return The username. + */ + java.lang.String getUsername(); + /** + * + * + *
+       * Required. The user name of the Google account.
+       * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+       * Required. Input only. The password of the Google account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+       * Required. Input only. The password of the Google account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + } + /** + * + * + *
+     * Describes authentication configuration that uses a Google account.
+     * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} + */ + public static final class GoogleAccount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + GoogleAccountOrBuilder { + private static final long serialVersionUID = 0L; + // Use GoogleAccount.newBuilder() to construct. + private GoogleAccount(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GoogleAccount() { + username_ = ""; + password_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GoogleAccount(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GoogleAccount( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + username_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + password_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .Builder.class); + } + + public static final int USERNAME_FIELD_NUMBER = 1; + private volatile java.lang.Object username_; + /** + * + * + *
+       * Required. The user name of the Google account.
+       * 
+ * + * string username = 1; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + /** + * + * + *
+       * Required. The user name of the Google account.
+       * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private volatile java.lang.Object password_; + /** + * + * + *
+       * Required. Input only. The password of the Google account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+       * Required. Input only. The password of the Google account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUsernameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); + } + if (!getPasswordBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUsernameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); + } + if (!getPasswordBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount other = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) obj; + + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Describes authentication configuration that uses a Google account.
+       * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + username_ = ""; + + password_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + build() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount result = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount( + this); + result.username_ = username_; + result.password_ = password_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount other) { + if (other + == com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance()) return this; + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object username_ = ""; + /** + * + * + *
+         * Required. The user name of the Google account.
+         * 
+ * + * string username = 1; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. The user name of the Google account.
+         * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. The user name of the Google account.
+         * 
+ * + * string username = 1; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + username_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The user name of the Google account.
+         * 
+ * + * string username = 1; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The user name of the Google account.
+         * 
+ * + * string username = 1; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + username_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+         * Required. Input only. The password of the Google account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. Input only. The password of the Google account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. Input only. The password of the Google account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + password_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Input only. The password of the Google account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Input only. The password of the Google account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + password_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccount + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GoogleAccount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GoogleAccount(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface CustomAccountOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Required. The user name of the custom account.
+       * 
+ * + * string username = 1; + * + * @return The username. + */ + java.lang.String getUsername(); + /** + * + * + *
+       * Required. The user name of the custom account.
+       * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + + /** + * + * + *
+       * Required. Input only. The password of the custom account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The password. + */ + java.lang.String getPassword(); + /** + * + * + *
+       * Required. Input only. The password of the custom account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * + * + *
+       * Required. The login form URL of the website.
+       * 
+ * + * string login_url = 3; + * + * @return The loginUrl. + */ + java.lang.String getLoginUrl(); + /** + * + * + *
+       * Required. The login form URL of the website.
+       * 
+ * + * string login_url = 3; + * + * @return The bytes for loginUrl. + */ + com.google.protobuf.ByteString getLoginUrlBytes(); + } + /** + * + * + *
+     * Describes authentication configuration that uses a custom account.
+     * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} + */ + public static final class CustomAccount extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + CustomAccountOrBuilder { + private static final long serialVersionUID = 0L; + // Use CustomAccount.newBuilder() to construct. + private CustomAccount(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CustomAccount() { + username_ = ""; + password_ = ""; + loginUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CustomAccount(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CustomAccount( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + username_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + password_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + loginUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .Builder.class); + } + + public static final int USERNAME_FIELD_NUMBER = 1; + private volatile java.lang.Object username_; + /** + * + * + *
+       * Required. The user name of the custom account.
+       * 
+ * + * string username = 1; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } + } + /** + * + * + *
+       * Required. The user name of the custom account.
+       * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PASSWORD_FIELD_NUMBER = 2; + private volatile java.lang.Object password_; + /** + * + * + *
+       * Required. Input only. The password of the custom account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } + } + /** + * + * + *
+       * Required. Input only. The password of the custom account. The credential is stored encrypted
+       * and not returned in any response nor included in audit logs.
+       * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOGIN_URL_FIELD_NUMBER = 3; + private volatile java.lang.Object loginUrl_; + /** + * + * + *
+       * Required. The login form URL of the website.
+       * 
+ * + * string login_url = 3; + * + * @return The loginUrl. + */ + @java.lang.Override + public java.lang.String getLoginUrl() { + java.lang.Object ref = loginUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + loginUrl_ = s; + return s; + } + } + /** + * + * + *
+       * Required. The login form URL of the website.
+       * 
+ * + * string login_url = 3; + * + * @return The bytes for loginUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLoginUrlBytes() { + java.lang.Object ref = loginUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + loginUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getUsernameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, username_); + } + if (!getPasswordBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, password_); + } + if (!getLoginUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, loginUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUsernameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, username_); + } + if (!getPasswordBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, password_); + } + if (!getLoginUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, loginUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount other = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) obj; + + if (!getUsername().equals(other.getUsername())) return false; + if (!getPassword().equals(other.getPassword())) return false; + if (!getLoginUrl().equals(other.getLoginUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + LOGIN_URL_FIELD_NUMBER; + hash = (53 * hash) + getLoginUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Describes authentication configuration that uses a custom account.
+       * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccountOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + username_ = ""; + + password_ = ""; + + loginUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + build() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount result = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount( + this); + result.username_ = username_; + result.password_ = password_; + result.loginUrl_ = loginUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount other) { + if (other + == com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance()) return this; + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + onChanged(); + } + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + onChanged(); + } + if (!other.getLoginUrl().isEmpty()) { + loginUrl_ = other.loginUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object username_ = ""; + /** + * + * + *
+         * Required. The user name of the custom account.
+         * 
+ * + * string username = 1; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. The user name of the custom account.
+         * 
+ * + * string username = 1; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. The user name of the custom account.
+         * 
+ * + * string username = 1; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + username_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The user name of the custom account.
+         * 
+ * + * string username = 1; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + + username_ = getDefaultInstance().getUsername(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The user name of the custom account.
+         * 
+ * + * string username = 1; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + username_ = value; + onChanged(); + return this; + } + + private java.lang.Object password_ = ""; + /** + * + * + *
+         * Required. Input only. The password of the custom account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. Input only. The password of the custom account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. Input only. The password of the custom account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + password_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Input only. The password of the custom account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + + password_ = getDefaultInstance().getPassword(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. Input only. The password of the custom account. The credential is stored encrypted
+         * and not returned in any response nor included in audit logs.
+         * 
+ * + * string password = 2; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + password_ = value; + onChanged(); + return this; + } + + private java.lang.Object loginUrl_ = ""; + /** + * + * + *
+         * Required. The login form URL of the website.
+         * 
+ * + * string login_url = 3; + * + * @return The loginUrl. + */ + public java.lang.String getLoginUrl() { + java.lang.Object ref = loginUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + loginUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Required. The login form URL of the website.
+         * 
+ * + * string login_url = 3; + * + * @return The bytes for loginUrl. + */ + public com.google.protobuf.ByteString getLoginUrlBytes() { + java.lang.Object ref = loginUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + loginUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Required. The login form URL of the website.
+         * 
+ * + * string login_url = 3; + * + * @param value The loginUrl to set. + * @return This builder for chaining. + */ + public Builder setLoginUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + loginUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The login form URL of the website.
+         * 
+ * + * string login_url = 3; + * + * @return This builder for chaining. + */ + public Builder clearLoginUrl() { + + loginUrl_ = getDefaultInstance().getLoginUrl(); + onChanged(); + return this; + } + /** + * + * + *
+         * Required. The login form URL of the website.
+         * 
+ * + * string login_url = 3; + * + * @param value The bytes for loginUrl to set. + * @return This builder for chaining. + */ + public Builder setLoginUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + loginUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccount + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CustomAccount parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CustomAccount(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface IapCredentialOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Authentication configuration when Web-Security-Scanner service
+       * account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + * + * @return Whether the iapTestServiceAccountInfo field is set. + */ + boolean hasIapTestServiceAccountInfo(); + /** + * + * + *
+       * Authentication configuration when Web-Security-Scanner service
+       * account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + * + * @return The iapTestServiceAccountInfo. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + getIapTestServiceAccountInfo(); + /** + * + * + *
+       * Authentication configuration when Web-Security-Scanner service
+       * account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder + getIapTestServiceAccountInfoOrBuilder(); + + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapCredentialsCase + getIapCredentialsCase(); + } + /** + * + * + *
+     * Describes authentication configuration for Identity-Aware-Proxy (IAP).
+     * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} + */ + public static final class IapCredential extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + IapCredentialOrBuilder { + private static final long serialVersionUID = 0L; + // Use IapCredential.newBuilder() to construct. + private IapCredential(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IapCredential() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IapCredential(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IapCredential( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder + subBuilder = null; + if (iapCredentialsCase_ == 1) { + subBuilder = + ((com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo) + iapCredentials_) + .toBuilder(); + } + iapCredentials_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo) + iapCredentials_); + iapCredentials_ = subBuilder.buildPartial(); + } + iapCredentialsCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .Builder.class); + } + + public interface IapTestServiceAccountInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * Required. Describes OAuth2 client id of resources protected by
+         * Identity-Aware-Proxy (IAP).
+         * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetAudienceClientId. + */ + java.lang.String getTargetAudienceClientId(); + /** + * + * + *
+         * Required. Describes OAuth2 client id of resources protected by
+         * Identity-Aware-Proxy (IAP).
+         * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for targetAudienceClientId. + */ + com.google.protobuf.ByteString getTargetAudienceClientIdBytes(); + } + /** + * + * + *
+       * Describes authentication configuration when Web-Security-Scanner
+       * service account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} + */ + public static final class IapTestServiceAccountInfo + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo) + IapTestServiceAccountInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use IapTestServiceAccountInfo.newBuilder() to construct. + private IapTestServiceAccountInfo( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IapTestServiceAccountInfo() { + targetAudienceClientId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new IapTestServiceAccountInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IapTestServiceAccountInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + targetAudienceClientId_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder.class); + } + + public static final int TARGET_AUDIENCE_CLIENT_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object targetAudienceClientId_; + /** + * + * + *
+         * Required. Describes OAuth2 client id of resources protected by
+         * Identity-Aware-Proxy (IAP).
+         * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetAudienceClientId. + */ + @java.lang.Override + public java.lang.String getTargetAudienceClientId() { + java.lang.Object ref = targetAudienceClientId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetAudienceClientId_ = s; + return s; + } + } + /** + * + * + *
+         * Required. Describes OAuth2 client id of resources protected by
+         * Identity-Aware-Proxy (IAP).
+         * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for targetAudienceClientId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetAudienceClientIdBytes() { + java.lang.Object ref = targetAudienceClientId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetAudienceClientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getTargetAudienceClientIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, targetAudienceClientId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTargetAudienceClientIdBytes().isEmpty()) { + size += + com.google.protobuf.GeneratedMessageV3.computeStringSize( + 1, targetAudienceClientId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + other = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + obj; + + if (!getTargetAudienceClientId().equals(other.getTargetAudienceClientId())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TARGET_AUDIENCE_CLIENT_ID_FIELD_NUMBER; + hash = (53 * hash) + getTargetAudienceClientId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+         * Describes authentication configuration when Web-Security-Scanner
+         * service account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo) + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + targetAudienceClientId_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + build() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + result = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo(this); + result.targetAudienceClientId_ = targetAudienceClientId_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + other) { + if (other + == com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance()) return this; + if (!other.getTargetAudienceClientId().isEmpty()) { + targetAudienceClientId_ = other.targetAudienceClientId_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object targetAudienceClientId_ = ""; + /** + * + * + *
+           * Required. Describes OAuth2 client id of resources protected by
+           * Identity-Aware-Proxy (IAP).
+           * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The targetAudienceClientId. + */ + public java.lang.String getTargetAudienceClientId() { + java.lang.Object ref = targetAudienceClientId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetAudienceClientId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+           * Required. Describes OAuth2 client id of resources protected by
+           * Identity-Aware-Proxy (IAP).
+           * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The bytes for targetAudienceClientId. + */ + public com.google.protobuf.ByteString getTargetAudienceClientIdBytes() { + java.lang.Object ref = targetAudienceClientId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetAudienceClientId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+           * Required. Describes OAuth2 client id of resources protected by
+           * Identity-Aware-Proxy (IAP).
+           * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The targetAudienceClientId to set. + * @return This builder for chaining. + */ + public Builder setTargetAudienceClientId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetAudienceClientId_ = value; + onChanged(); + return this; + } + /** + * + * + *
+           * Required. Describes OAuth2 client id of resources protected by
+           * Identity-Aware-Proxy (IAP).
+           * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetAudienceClientId() { + + targetAudienceClientId_ = getDefaultInstance().getTargetAudienceClientId(); + onChanged(); + return this; + } + /** + * + * + *
+           * Required. Describes OAuth2 client id of resources protected by
+           * Identity-Aware-Proxy (IAP).
+           * 
+ * + * string target_audience_client_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @param value The bytes for targetAudienceClientId to set. + * @return This builder for chaining. + */ + public Builder setTargetAudienceClientIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetAudienceClientId_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IapTestServiceAccountInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IapTestServiceAccountInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int iapCredentialsCase_ = 0; + private java.lang.Object iapCredentials_; + + public enum IapCredentialsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + IAP_TEST_SERVICE_ACCOUNT_INFO(1), + IAPCREDENTIALS_NOT_SET(0); + private final int value; + + private IapCredentialsCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static IapCredentialsCase valueOf(int value) { + return forNumber(value); + } + + public static IapCredentialsCase forNumber(int value) { + switch (value) { + case 1: + return IAP_TEST_SERVICE_ACCOUNT_INFO; + case 0: + return IAPCREDENTIALS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public IapCredentialsCase getIapCredentialsCase() { + return IapCredentialsCase.forNumber(iapCredentialsCase_); + } + + public static final int IAP_TEST_SERVICE_ACCOUNT_INFO_FIELD_NUMBER = 1; + /** + * + * + *
+       * Authentication configuration when Web-Security-Scanner service
+       * account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + * + * @return Whether the iapTestServiceAccountInfo field is set. + */ + @java.lang.Override + public boolean hasIapTestServiceAccountInfo() { + return iapCredentialsCase_ == 1; + } + /** + * + * + *
+       * Authentication configuration when Web-Security-Scanner service
+       * account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + * + * @return The iapTestServiceAccountInfo. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + getIapTestServiceAccountInfo() { + if (iapCredentialsCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } + /** + * + * + *
+       * Authentication configuration when Web-Security-Scanner service
+       * account is added in Identity-Aware-Proxy (IAP) access policies.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder + getIapTestServiceAccountInfoOrBuilder() { + if (iapCredentialsCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (iapCredentialsCase_ == 1) { + output.writeMessage( + 1, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (iapCredentialsCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential other = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) obj; + + if (!getIapCredentialsCase().equals(other.getIapCredentialsCase())) return false; + switch (iapCredentialsCase_) { + case 1: + if (!getIapTestServiceAccountInfo().equals(other.getIapTestServiceAccountInfo())) + return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (iapCredentialsCase_) { + case 1: + hash = (37 * hash) + IAP_TEST_SERVICE_ACCOUNT_INFO_FIELD_NUMBER; + hash = (53 * hash) + getIapTestServiceAccountInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Describes authentication configuration for Identity-Aware-Proxy (IAP).
+       * 
+ * + * Protobuf type {@code + * google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredentialOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + iapCredentialsCase_ = 0; + iapCredentials_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + build() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential result = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential( + this); + if (iapCredentialsCase_ == 1) { + if (iapTestServiceAccountInfoBuilder_ == null) { + result.iapCredentials_ = iapCredentials_; + } else { + result.iapCredentials_ = iapTestServiceAccountInfoBuilder_.build(); + } + } + result.iapCredentialsCase_ = iapCredentialsCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential other) { + if (other + == com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance()) return this; + switch (other.getIapCredentialsCase()) { + case IAP_TEST_SERVICE_ACCOUNT_INFO: + { + mergeIapTestServiceAccountInfo(other.getIapTestServiceAccountInfo()); + break; + } + case IAPCREDENTIALS_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int iapCredentialsCase_ = 0; + private java.lang.Object iapCredentials_; + + public IapCredentialsCase getIapCredentialsCase() { + return IapCredentialsCase.forNumber(iapCredentialsCase_); + } + + public Builder clearIapCredentials() { + iapCredentialsCase_ = 0; + iapCredentials_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder> + iapTestServiceAccountInfoBuilder_; + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + * + * @return Whether the iapTestServiceAccountInfo field is set. + */ + @java.lang.Override + public boolean hasIapTestServiceAccountInfo() { + return iapCredentialsCase_ == 1; + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + * + * @return The iapTestServiceAccountInfo. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + getIapTestServiceAccountInfo() { + if (iapTestServiceAccountInfoBuilder_ == null) { + if (iapCredentialsCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } else { + if (iapCredentialsCase_ == 1) { + return iapTestServiceAccountInfoBuilder_.getMessage(); + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + public Builder setIapTestServiceAccountInfo( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + value) { + if (iapTestServiceAccountInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + iapCredentials_ = value; + onChanged(); + } else { + iapTestServiceAccountInfoBuilder_.setMessage(value); + } + iapCredentialsCase_ = 1; + return this; + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + public Builder setIapTestServiceAccountInfo( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder + builderForValue) { + if (iapTestServiceAccountInfoBuilder_ == null) { + iapCredentials_ = builderForValue.build(); + onChanged(); + } else { + iapTestServiceAccountInfoBuilder_.setMessage(builderForValue.build()); + } + iapCredentialsCase_ = 1; + return this; + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + public Builder mergeIapTestServiceAccountInfo( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo + value) { + if (iapTestServiceAccountInfoBuilder_ == null) { + if (iapCredentialsCase_ == 1 + && iapCredentials_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo.getDefaultInstance()) { + iapCredentials_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.newBuilder( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential.IapTestServiceAccountInfo) + iapCredentials_) + .mergeFrom(value) + .buildPartial(); + } else { + iapCredentials_ = value; + } + onChanged(); + } else { + if (iapCredentialsCase_ == 1) { + iapTestServiceAccountInfoBuilder_.mergeFrom(value); + } + iapTestServiceAccountInfoBuilder_.setMessage(value); + } + iapCredentialsCase_ = 1; + return this; + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + public Builder clearIapTestServiceAccountInfo() { + if (iapTestServiceAccountInfoBuilder_ == null) { + if (iapCredentialsCase_ == 1) { + iapCredentialsCase_ = 0; + iapCredentials_ = null; + onChanged(); + } + } else { + if (iapCredentialsCase_ == 1) { + iapCredentialsCase_ = 0; + iapCredentials_ = null; + } + iapTestServiceAccountInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder + getIapTestServiceAccountInfoBuilder() { + return getIapTestServiceAccountInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder + getIapTestServiceAccountInfoOrBuilder() { + if ((iapCredentialsCase_ == 1) && (iapTestServiceAccountInfoBuilder_ != null)) { + return iapTestServiceAccountInfoBuilder_.getMessageOrBuilder(); + } else { + if (iapCredentialsCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } + } + /** + * + * + *
+         * Authentication configuration when Web-Security-Scanner service
+         * account is added in Identity-Aware-Proxy (IAP) access policies.
+         * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo iap_test_service_account_info = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder> + getIapTestServiceAccountInfoFieldBuilder() { + if (iapTestServiceAccountInfoBuilder_ == null) { + if (!(iapCredentialsCase_ == 1)) { + iapCredentials_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.getDefaultInstance(); + } + iapTestServiceAccountInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfoOrBuilder>( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .IapTestServiceAccountInfo) + iapCredentials_, + getParentForChildren(), + isClean()); + iapCredentials_ = null; + } + iapCredentialsCase_ = 1; + onChanged(); + ; + return iapTestServiceAccountInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IapCredential parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IapCredential(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int authenticationCase_ = 0; + private java.lang.Object authentication_; + + public enum AuthenticationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GOOGLE_ACCOUNT(1), + CUSTOM_ACCOUNT(2), + IAP_CREDENTIAL(4), + AUTHENTICATION_NOT_SET(0); + private final int value; + + private AuthenticationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AuthenticationCase valueOf(int value) { + return forNumber(value); + } + + public static AuthenticationCase forNumber(int value) { + switch (value) { + case 1: + return GOOGLE_ACCOUNT; + case 2: + return CUSTOM_ACCOUNT; + case 4: + return IAP_CREDENTIAL; + case 0: + return AUTHENTICATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AuthenticationCase getAuthenticationCase() { + return AuthenticationCase.forNumber(authenticationCase_); + } + + public static final int GOOGLE_ACCOUNT_FIELD_NUMBER = 1; + /** + * + * + *
+     * Authentication using a Google account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + * + * @return Whether the googleAccount field is set. + */ + @java.lang.Override + public boolean hasGoogleAccount() { + return authenticationCase_ == 1; + } + /** + * + * + *
+     * Authentication using a Google account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + * + * @return The googleAccount. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + getGoogleAccount() { + if (authenticationCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } + /** + * + * + *
+     * Authentication using a Google account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccountOrBuilder + getGoogleAccountOrBuilder() { + if (authenticationCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } + + public static final int CUSTOM_ACCOUNT_FIELD_NUMBER = 2; + /** + * + * + *
+     * Authentication using a custom account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + * + * @return Whether the customAccount field is set. + */ + @java.lang.Override + public boolean hasCustomAccount() { + return authenticationCase_ == 2; + } + /** + * + * + *
+     * Authentication using a custom account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + * + * @return The customAccount. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + getCustomAccount() { + if (authenticationCase_ == 2) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } + /** + * + * + *
+     * Authentication using a custom account.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccountOrBuilder + getCustomAccountOrBuilder() { + if (authenticationCase_ == 2) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } + + public static final int IAP_CREDENTIAL_FIELD_NUMBER = 4; + /** + * + * + *
+     * Authentication using Identity-Aware-Proxy (IAP).
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + * + * @return Whether the iapCredential field is set. + */ + @java.lang.Override + public boolean hasIapCredential() { + return authenticationCase_ == 4; + } + /** + * + * + *
+     * Authentication using Identity-Aware-Proxy (IAP).
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + * + * @return The iapCredential. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + getIapCredential() { + if (authenticationCase_ == 4) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } + /** + * + * + *
+     * Authentication using Identity-Aware-Proxy (IAP).
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredentialOrBuilder + getIapCredentialOrBuilder() { + if (authenticationCase_ == 4) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (authenticationCase_ == 1) { + output.writeMessage( + 1, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_); + } + if (authenticationCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_); + } + if (authenticationCase_ == 4) { + output.writeMessage( + 4, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (authenticationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_); + } + if (authenticationCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_); + } + if (authenticationCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication other = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication) obj; + + if (!getAuthenticationCase().equals(other.getAuthenticationCase())) return false; + switch (authenticationCase_) { + case 1: + if (!getGoogleAccount().equals(other.getGoogleAccount())) return false; + break; + case 2: + if (!getCustomAccount().equals(other.getCustomAccount())) return false; + break; + case 4: + if (!getIapCredential().equals(other.getIapCredential())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (authenticationCase_) { + case 1: + hash = (37 * hash) + GOOGLE_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getGoogleAccount().hashCode(); + break; + case 2: + hash = (37 * hash) + CUSTOM_ACCOUNT_FIELD_NUMBER; + hash = (53 * hash) + getCustomAccount().hashCode(); + break; + case 4: + hash = (37 * hash) + IAP_CREDENTIAL_FIELD_NUMBER; + hash = (53 * hash) + getIapCredential().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Scan authentication configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfig.Authentication} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + authenticationCase_ = 0; + authentication_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication build() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication result = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication(this); + if (authenticationCase_ == 1) { + if (googleAccountBuilder_ == null) { + result.authentication_ = authentication_; + } else { + result.authentication_ = googleAccountBuilder_.build(); + } + } + if (authenticationCase_ == 2) { + if (customAccountBuilder_ == null) { + result.authentication_ = authentication_; + } else { + result.authentication_ = customAccountBuilder_.build(); + } + } + if (authenticationCase_ == 4) { + if (iapCredentialBuilder_ == null) { + result.authentication_ = authentication_; + } else { + result.authentication_ = iapCredentialBuilder_.build(); + } + } + result.authenticationCase_ = authenticationCase_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication) { + return mergeFrom( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication other) { + if (other + == com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .getDefaultInstance()) return this; + switch (other.getAuthenticationCase()) { + case GOOGLE_ACCOUNT: + { + mergeGoogleAccount(other.getGoogleAccount()); + break; + } + case CUSTOM_ACCOUNT: + { + mergeCustomAccount(other.getCustomAccount()); + break; + } + case IAP_CREDENTIAL: + { + mergeIapCredential(other.getIapCredential()); + break; + } + case AUTHENTICATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int authenticationCase_ = 0; + private java.lang.Object authentication_; + + public AuthenticationCase getAuthenticationCase() { + return AuthenticationCase.forNumber(authenticationCase_); + } + + public Builder clearAuthentication() { + authenticationCase_ = 0; + authentication_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccountOrBuilder> + googleAccountBuilder_; + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + * + * @return Whether the googleAccount field is set. + */ + @java.lang.Override + public boolean hasGoogleAccount() { + return authenticationCase_ == 1; + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + * + * @return The googleAccount. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + getGoogleAccount() { + if (googleAccountBuilder_ == null) { + if (authenticationCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } else { + if (authenticationCase_ == 1) { + return googleAccountBuilder_.getMessage(); + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + public Builder setGoogleAccount( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount value) { + if (googleAccountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authentication_ = value; + onChanged(); + } else { + googleAccountBuilder_.setMessage(value); + } + authenticationCase_ = 1; + return this; + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + public Builder setGoogleAccount( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.Builder + builderForValue) { + if (googleAccountBuilder_ == null) { + authentication_ = builderForValue.build(); + onChanged(); + } else { + googleAccountBuilder_.setMessage(builderForValue.build()); + } + authenticationCase_ = 1; + return this; + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + public Builder mergeGoogleAccount( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount value) { + if (googleAccountBuilder_ == null) { + if (authenticationCase_ == 1 + && authentication_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance()) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .newBuilder( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccount) + authentication_) + .mergeFrom(value) + .buildPartial(); + } else { + authentication_ = value; + } + onChanged(); + } else { + if (authenticationCase_ == 1) { + googleAccountBuilder_.mergeFrom(value); + } + googleAccountBuilder_.setMessage(value); + } + authenticationCase_ = 1; + return this; + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + public Builder clearGoogleAccount() { + if (googleAccountBuilder_ == null) { + if (authenticationCase_ == 1) { + authenticationCase_ = 0; + authentication_ = null; + onChanged(); + } + } else { + if (authenticationCase_ == 1) { + authenticationCase_ = 0; + authentication_ = null; + } + googleAccountBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount.Builder + getGoogleAccountBuilder() { + return getGoogleAccountFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccountOrBuilder + getGoogleAccountOrBuilder() { + if ((authenticationCase_ == 1) && (googleAccountBuilder_ != null)) { + return googleAccountBuilder_.getMessageOrBuilder(); + } else { + if (authenticationCase_ == 1) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Authentication using a Google account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount google_account = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccountOrBuilder> + getGoogleAccountFieldBuilder() { + if (googleAccountBuilder_ == null) { + if (!(authenticationCase_ == 1)) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .getDefaultInstance(); + } + googleAccountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .GoogleAccountOrBuilder>( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount) + authentication_, + getParentForChildren(), + isClean()); + authentication_ = null; + } + authenticationCase_ = 1; + onChanged(); + ; + return googleAccountBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccountOrBuilder> + customAccountBuilder_; + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + * + * @return Whether the customAccount field is set. + */ + @java.lang.Override + public boolean hasCustomAccount() { + return authenticationCase_ == 2; + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + * + * @return The customAccount. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + getCustomAccount() { + if (customAccountBuilder_ == null) { + if (authenticationCase_ == 2) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } else { + if (authenticationCase_ == 2) { + return customAccountBuilder_.getMessage(); + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + public Builder setCustomAccount( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount value) { + if (customAccountBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authentication_ = value; + onChanged(); + } else { + customAccountBuilder_.setMessage(value); + } + authenticationCase_ = 2; + return this; + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + public Builder setCustomAccount( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.Builder + builderForValue) { + if (customAccountBuilder_ == null) { + authentication_ = builderForValue.build(); + onChanged(); + } else { + customAccountBuilder_.setMessage(builderForValue.build()); + } + authenticationCase_ = 2; + return this; + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + public Builder mergeCustomAccount( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount value) { + if (customAccountBuilder_ == null) { + if (authenticationCase_ == 2 + && authentication_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance()) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .newBuilder( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccount) + authentication_) + .mergeFrom(value) + .buildPartial(); + } else { + authentication_ = value; + } + onChanged(); + } else { + if (authenticationCase_ == 2) { + customAccountBuilder_.mergeFrom(value); + } + customAccountBuilder_.setMessage(value); + } + authenticationCase_ = 2; + return this; + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + public Builder clearCustomAccount() { + if (customAccountBuilder_ == null) { + if (authenticationCase_ == 2) { + authenticationCase_ = 0; + authentication_ = null; + onChanged(); + } + } else { + if (authenticationCase_ == 2) { + authenticationCase_ = 0; + authentication_ = null; + } + customAccountBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount.Builder + getCustomAccountBuilder() { + return getCustomAccountFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccountOrBuilder + getCustomAccountOrBuilder() { + if ((authenticationCase_ == 2) && (customAccountBuilder_ != null)) { + return customAccountBuilder_.getMessageOrBuilder(); + } else { + if (authenticationCase_ == 2) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Authentication using a custom account.
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount custom_account = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccountOrBuilder> + getCustomAccountFieldBuilder() { + if (customAccountBuilder_ == null) { + if (!(authenticationCase_ == 2)) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .getDefaultInstance(); + } + customAccountBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .CustomAccountOrBuilder>( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount) + authentication_, + getParentForChildren(), + isClean()); + authentication_ = null; + } + authenticationCase_ = 2; + onChanged(); + ; + return customAccountBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredentialOrBuilder> + iapCredentialBuilder_; + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + * + * @return Whether the iapCredential field is set. + */ + @java.lang.Override + public boolean hasIapCredential() { + return authenticationCase_ == 4; + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + * + * @return The iapCredential. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + getIapCredential() { + if (iapCredentialBuilder_ == null) { + if (authenticationCase_ == 4) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } else { + if (authenticationCase_ == 4) { + return iapCredentialBuilder_.getMessage(); + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + public Builder setIapCredential( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential value) { + if (iapCredentialBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authentication_ = value; + onChanged(); + } else { + iapCredentialBuilder_.setMessage(value); + } + authenticationCase_ = 4; + return this; + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + public Builder setIapCredential( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.Builder + builderForValue) { + if (iapCredentialBuilder_ == null) { + authentication_ = builderForValue.build(); + onChanged(); + } else { + iapCredentialBuilder_.setMessage(builderForValue.build()); + } + authenticationCase_ = 4; + return this; + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + public Builder mergeIapCredential( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential value) { + if (iapCredentialBuilder_ == null) { + if (authenticationCase_ == 4 + && authentication_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance()) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .newBuilder( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredential) + authentication_) + .mergeFrom(value) + .buildPartial(); + } else { + authentication_ = value; + } + onChanged(); + } else { + if (authenticationCase_ == 4) { + iapCredentialBuilder_.mergeFrom(value); + } + iapCredentialBuilder_.setMessage(value); + } + authenticationCase_ = 4; + return this; + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + public Builder clearIapCredential() { + if (iapCredentialBuilder_ == null) { + if (authenticationCase_ == 4) { + authenticationCase_ = 0; + authentication_ = null; + onChanged(); + } + } else { + if (authenticationCase_ == 4) { + authenticationCase_ = 0; + authentication_ = null; + } + iapCredentialBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.Builder + getIapCredentialBuilder() { + return getIapCredentialFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredentialOrBuilder + getIapCredentialOrBuilder() { + if ((authenticationCase_ == 4) && (iapCredentialBuilder_ != null)) { + return iapCredentialBuilder_.getMessageOrBuilder(); + } else { + if (authenticationCase_ == 4) { + return (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_; + } + return com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Authentication using Identity-Aware-Proxy (IAP).
+       * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential iap_credential = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredentialOrBuilder> + getIapCredentialFieldBuilder() { + if (iapCredentialBuilder_ == null) { + if (!(authenticationCase_ == 4)) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .getDefaultInstance(); + } + iapCredentialBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential + .Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + .IapCredentialOrBuilder>( + (com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential) + authentication_, + getParentForChildren(), + isClean()); + authentication_ = null; + } + authenticationCase_ = 4; + onChanged(); + ; + return iapCredentialBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig.Authentication) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Authentication parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Authentication(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ScheduleOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig.Schedule) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * A timestamp indicates when the next run will be scheduled. The value is
+     * refreshed by the server after each run. If unspecified, it will default
+     * to current server time, which means the scan will be scheduled to start
+     * immediately.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + * + * @return Whether the scheduleTime field is set. + */ + boolean hasScheduleTime(); + /** + * + * + *
+     * A timestamp indicates when the next run will be scheduled. The value is
+     * refreshed by the server after each run. If unspecified, it will default
+     * to current server time, which means the scan will be scheduled to start
+     * immediately.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + * + * @return The scheduleTime. + */ + com.google.protobuf.Timestamp getScheduleTime(); + /** + * + * + *
+     * A timestamp indicates when the next run will be scheduled. The value is
+     * refreshed by the server after each run. If unspecified, it will default
+     * to current server time, which means the scan will be scheduled to start
+     * immediately.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder(); + + /** + * + * + *
+     * Required. The duration of time between executions in days.
+     * 
+ * + * int32 interval_duration_days = 2; + * + * @return The intervalDurationDays. + */ + int getIntervalDurationDays(); + } + /** + * + * + *
+   * Scan schedule configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfig.Schedule} + */ + public static final class Schedule extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfig.Schedule) + ScheduleOrBuilder { + private static final long serialVersionUID = 0L; + // Use Schedule.newBuilder() to construct. + private Schedule(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Schedule() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Schedule(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Schedule( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (scheduleTime_ != null) { + subBuilder = scheduleTime_.toBuilder(); + } + scheduleTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scheduleTime_); + scheduleTime_ = subBuilder.buildPartial(); + } + + break; + } + case 16: + { + intervalDurationDays_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder.class); + } + + public static final int SCHEDULE_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp scheduleTime_; + /** + * + * + *
+     * A timestamp indicates when the next run will be scheduled. The value is
+     * refreshed by the server after each run. If unspecified, it will default
+     * to current server time, which means the scan will be scheduled to start
+     * immediately.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + * + * @return Whether the scheduleTime field is set. + */ + @java.lang.Override + public boolean hasScheduleTime() { + return scheduleTime_ != null; + } + /** + * + * + *
+     * A timestamp indicates when the next run will be scheduled. The value is
+     * refreshed by the server after each run. If unspecified, it will default
+     * to current server time, which means the scan will be scheduled to start
+     * immediately.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + * + * @return The scheduleTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getScheduleTime() { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + /** + * + * + *
+     * A timestamp indicates when the next run will be scheduled. The value is
+     * refreshed by the server after each run. If unspecified, it will default
+     * to current server time, which means the scan will be scheduled to start
+     * immediately.
+     * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + return getScheduleTime(); + } + + public static final int INTERVAL_DURATION_DAYS_FIELD_NUMBER = 2; + private int intervalDurationDays_; + /** + * + * + *
+     * Required. The duration of time between executions in days.
+     * 
+ * + * int32 interval_duration_days = 2; + * + * @return The intervalDurationDays. + */ + @java.lang.Override + public int getIntervalDurationDays() { + return intervalDurationDays_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (scheduleTime_ != null) { + output.writeMessage(1, getScheduleTime()); + } + if (intervalDurationDays_ != 0) { + output.writeInt32(2, intervalDurationDays_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (scheduleTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getScheduleTime()); + } + if (intervalDurationDays_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, intervalDurationDays_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule other = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule) obj; + + if (hasScheduleTime() != other.hasScheduleTime()) return false; + if (hasScheduleTime()) { + if (!getScheduleTime().equals(other.getScheduleTime())) return false; + } + if (getIntervalDurationDays() != other.getIntervalDurationDays()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasScheduleTime()) { + hash = (37 * hash) + SCHEDULE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getScheduleTime().hashCode(); + } + hash = (37 * hash) + INTERVAL_DURATION_DAYS_FIELD_NUMBER; + hash = (53 * hash) + getIntervalDurationDays(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Scan schedule configuration.
+     * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfig.Schedule} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig.Schedule) + com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = null; + } else { + scheduleTime_ = null; + scheduleTimeBuilder_ = null; + } + intervalDurationDays_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule build() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule result = + new com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule(this); + if (scheduleTimeBuilder_ == null) { + result.scheduleTime_ = scheduleTime_; + } else { + result.scheduleTime_ = scheduleTimeBuilder_.build(); + } + result.intervalDurationDays_ = intervalDurationDays_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule other) { + if (other + == com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.getDefaultInstance()) + return this; + if (other.hasScheduleTime()) { + mergeScheduleTime(other.getScheduleTime()); + } + if (other.getIntervalDurationDays() != 0) { + setIntervalDurationDays(other.getIntervalDurationDays()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp scheduleTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + scheduleTimeBuilder_; + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + * + * @return Whether the scheduleTime field is set. + */ + public boolean hasScheduleTime() { + return scheduleTimeBuilder_ != null || scheduleTime_ != null; + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + * + * @return The scheduleTime. + */ + public com.google.protobuf.Timestamp getScheduleTime() { + if (scheduleTimeBuilder_ == null) { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } else { + return scheduleTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scheduleTime_ = value; + onChanged(); + } else { + scheduleTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + public Builder setScheduleTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = builderForValue.build(); + onChanged(); + } else { + scheduleTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + public Builder mergeScheduleTime(com.google.protobuf.Timestamp value) { + if (scheduleTimeBuilder_ == null) { + if (scheduleTime_ != null) { + scheduleTime_ = + com.google.protobuf.Timestamp.newBuilder(scheduleTime_) + .mergeFrom(value) + .buildPartial(); + } else { + scheduleTime_ = value; + } + onChanged(); + } else { + scheduleTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + public Builder clearScheduleTime() { + if (scheduleTimeBuilder_ == null) { + scheduleTime_ = null; + onChanged(); + } else { + scheduleTime_ = null; + scheduleTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getScheduleTimeBuilder() { + + onChanged(); + return getScheduleTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getScheduleTimeOrBuilder() { + if (scheduleTimeBuilder_ != null) { + return scheduleTimeBuilder_.getMessageOrBuilder(); + } else { + return scheduleTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : scheduleTime_; + } + } + /** + * + * + *
+       * A timestamp indicates when the next run will be scheduled. The value is
+       * refreshed by the server after each run. If unspecified, it will default
+       * to current server time, which means the scan will be scheduled to start
+       * immediately.
+       * 
+ * + * .google.protobuf.Timestamp schedule_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getScheduleTimeFieldBuilder() { + if (scheduleTimeBuilder_ == null) { + scheduleTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getScheduleTime(), getParentForChildren(), isClean()); + scheduleTime_ = null; + } + return scheduleTimeBuilder_; + } + + private int intervalDurationDays_; + /** + * + * + *
+       * Required. The duration of time between executions in days.
+       * 
+ * + * int32 interval_duration_days = 2; + * + * @return The intervalDurationDays. + */ + @java.lang.Override + public int getIntervalDurationDays() { + return intervalDurationDays_; + } + /** + * + * + *
+       * Required. The duration of time between executions in days.
+       * 
+ * + * int32 interval_duration_days = 2; + * + * @param value The intervalDurationDays to set. + * @return This builder for chaining. + */ + public Builder setIntervalDurationDays(int value) { + + intervalDurationDays_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Required. The duration of time between executions in days.
+       * 
+ * + * int32 interval_duration_days = 2; + * + * @return This builder for chaining. + */ + public Builder clearIntervalDurationDays() { + + intervalDurationDays_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig.Schedule) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig.Schedule) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Schedule parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Schedule(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name of the ScanConfig. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+   * generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The resource name of the ScanConfig. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+   * generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Required. The user provided display name of the ScanConfig.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + @java.lang.Override + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The user provided display name of the ScanConfig.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MAX_QPS_FIELD_NUMBER = 3; + private int maxQps_; + /** + * + * + *
+   * The maximum QPS during scanning. A valid value ranges from 5 to 20
+   * inclusively. If the field is unspecified or its value is set 0, server will
+   * default to 15. Other values outside of [5, 20] range will be rejected with
+   * INVALID_ARGUMENT error.
+   * 
+ * + * int32 max_qps = 3; + * + * @return The maxQps. + */ + @java.lang.Override + public int getMaxQps() { + return maxQps_; + } + + public static final int STARTING_URLS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList startingUrls_; + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @return A list containing the startingUrls. + */ + public com.google.protobuf.ProtocolStringList getStartingUrlsList() { + return startingUrls_; + } + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @return The count of startingUrls. + */ + public int getStartingUrlsCount() { + return startingUrls_.size(); + } + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index of the element to return. + * @return The startingUrls at the given index. + */ + public java.lang.String getStartingUrls(int index) { + return startingUrls_.get(index); + } + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the startingUrls at the given index. + */ + public com.google.protobuf.ByteString getStartingUrlsBytes(int index) { + return startingUrls_.getByteString(index); + } + + public static final int AUTHENTICATION_FIELD_NUMBER = 5; + private com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication_; + /** + * + * + *
+   * The authentication configuration. If specified, service will use the
+   * authentication configuration during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + * @return Whether the authentication field is set. + */ + @java.lang.Override + public boolean hasAuthentication() { + return authentication_ != null; + } + /** + * + * + *
+   * The authentication configuration. If specified, service will use the
+   * authentication configuration during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + * @return The authentication. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication getAuthentication() { + return authentication_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.getDefaultInstance() + : authentication_; + } + /** + * + * + *
+   * The authentication configuration. If specified, service will use the
+   * authentication configuration during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder + getAuthenticationOrBuilder() { + return getAuthentication(); + } + + public static final int USER_AGENT_FIELD_NUMBER = 6; + private int userAgent_; + /** + * + * + *
+   * The user agent used during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return The enum numeric value on the wire for userAgent. + */ + @java.lang.Override + public int getUserAgentValue() { + return userAgent_; + } + /** + * + * + *
+   * The user agent used during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return The userAgent. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent getUserAgent() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent result = + com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent.valueOf(userAgent_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent.UNRECOGNIZED + : result; + } + + public static final int BLACKLIST_PATTERNS_FIELD_NUMBER = 7; + private com.google.protobuf.LazyStringList blacklistPatterns_; + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return A list containing the blacklistPatterns. + */ + public com.google.protobuf.ProtocolStringList getBlacklistPatternsList() { + return blacklistPatterns_; + } + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return The count of blacklistPatterns. + */ + public int getBlacklistPatternsCount() { + return blacklistPatterns_.size(); + } + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index of the element to return. + * @return The blacklistPatterns at the given index. + */ + public java.lang.String getBlacklistPatterns(int index) { + return blacklistPatterns_.get(index); + } + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index of the value to return. + * @return The bytes of the blacklistPatterns at the given index. + */ + public com.google.protobuf.ByteString getBlacklistPatternsBytes(int index) { + return blacklistPatterns_.getByteString(index); + } + + public static final int SCHEDULE_FIELD_NUMBER = 8; + private com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule_; + /** + * + * + *
+   * The schedule of the ScanConfig.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + * + * @return Whether the schedule field is set. + */ + @java.lang.Override + public boolean hasSchedule() { + return schedule_ != null; + } + /** + * + * + *
+   * The schedule of the ScanConfig.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + * + * @return The schedule. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule getSchedule() { + return schedule_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.getDefaultInstance() + : schedule_; + } + /** + * + * + *
+   * The schedule of the ScanConfig.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder + getScheduleOrBuilder() { + return getSchedule(); + } + + public static final int EXPORT_TO_SECURITY_COMMAND_CENTER_FIELD_NUMBER = 10; + private int exportToSecurityCommandCenter_; + /** + * + * + *
+   * Controls export of scan configurations and results to Security
+   * Command Center.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return The enum numeric value on the wire for exportToSecurityCommandCenter. + */ + @java.lang.Override + public int getExportToSecurityCommandCenterValue() { + return exportToSecurityCommandCenter_; + } + /** + * + * + *
+   * Controls export of scan configurations and results to Security
+   * Command Center.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return The exportToSecurityCommandCenter. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + getExportToSecurityCommandCenter() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter result = + com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter.valueOf( + exportToSecurityCommandCenter_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + .UNRECOGNIZED + : result; + } + + public static final int RISK_LEVEL_FIELD_NUMBER = 12; + private int riskLevel_; + /** + * + * + *
+   * The risk level selected for the scan
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return The enum numeric value on the wire for riskLevel. + */ + @java.lang.Override + public int getRiskLevelValue() { + return riskLevel_; + } + /** + * + * + *
+   * The risk level selected for the scan
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return The riskLevel. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel getRiskLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel result = + com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel.valueOf(riskLevel_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel.UNRECOGNIZED + : result; + } + + public static final int MANAGED_SCAN_FIELD_NUMBER = 13; + private boolean managedScan_; + /** + * + * + *
+   * Whether the scan config is managed by Web Security Scanner, output
+   * only.
+   * 
+ * + * bool managed_scan = 13; + * + * @return The managedScan. + */ + @java.lang.Override + public boolean getManagedScan() { + return managedScan_; + } + + public static final int STATIC_IP_SCAN_FIELD_NUMBER = 14; + private boolean staticIpScan_; + /** + * + * + *
+   * Whether the scan configuration has enabled static IP address scan feature.
+   * If enabled, the scanner will access applications from static IP addresses.
+   * 
+ * + * bool static_ip_scan = 14; + * + * @return The staticIpScan. + */ + @java.lang.Override + public boolean getStaticIpScan() { + return staticIpScan_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (maxQps_ != 0) { + output.writeInt32(3, maxQps_); + } + for (int i = 0; i < startingUrls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, startingUrls_.getRaw(i)); + } + if (authentication_ != null) { + output.writeMessage(5, getAuthentication()); + } + if (userAgent_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent.USER_AGENT_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, userAgent_); + } + for (int i = 0; i < blacklistPatterns_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, blacklistPatterns_.getRaw(i)); + } + if (schedule_ != null) { + output.writeMessage(8, getSchedule()); + } + if (exportToSecurityCommandCenter_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + .EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, exportToSecurityCommandCenter_); + } + if (riskLevel_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel.RISK_LEVEL_UNSPECIFIED + .getNumber()) { + output.writeEnum(12, riskLevel_); + } + if (managedScan_ != false) { + output.writeBool(13, managedScan_); + } + if (staticIpScan_ != false) { + output.writeBool(14, staticIpScan_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (maxQps_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, maxQps_); + } + { + int dataSize = 0; + for (int i = 0; i < startingUrls_.size(); i++) { + dataSize += computeStringSizeNoTag(startingUrls_.getRaw(i)); + } + size += dataSize; + size += 1 * getStartingUrlsList().size(); + } + if (authentication_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getAuthentication()); + } + if (userAgent_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent.USER_AGENT_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, userAgent_); + } + { + int dataSize = 0; + for (int i = 0; i < blacklistPatterns_.size(); i++) { + dataSize += computeStringSizeNoTag(blacklistPatterns_.getRaw(i)); + } + size += dataSize; + size += 1 * getBlacklistPatternsList().size(); + } + if (schedule_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(8, getSchedule()); + } + if (exportToSecurityCommandCenter_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + .EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED + .getNumber()) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(10, exportToSecurityCommandCenter_); + } + if (riskLevel_ + != com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel.RISK_LEVEL_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, riskLevel_); + } + if (managedScan_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, managedScan_); + } + if (staticIpScan_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(14, staticIpScan_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanConfig)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfig other = + (com.google.cloud.websecurityscanner.v1.ScanConfig) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (getMaxQps() != other.getMaxQps()) return false; + if (!getStartingUrlsList().equals(other.getStartingUrlsList())) return false; + if (hasAuthentication() != other.hasAuthentication()) return false; + if (hasAuthentication()) { + if (!getAuthentication().equals(other.getAuthentication())) return false; + } + if (userAgent_ != other.userAgent_) return false; + if (!getBlacklistPatternsList().equals(other.getBlacklistPatternsList())) return false; + if (hasSchedule() != other.hasSchedule()) return false; + if (hasSchedule()) { + if (!getSchedule().equals(other.getSchedule())) return false; + } + if (exportToSecurityCommandCenter_ != other.exportToSecurityCommandCenter_) return false; + if (riskLevel_ != other.riskLevel_) return false; + if (getManagedScan() != other.getManagedScan()) return false; + if (getStaticIpScan() != other.getStaticIpScan()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + hash = (37 * hash) + MAX_QPS_FIELD_NUMBER; + hash = (53 * hash) + getMaxQps(); + if (getStartingUrlsCount() > 0) { + hash = (37 * hash) + STARTING_URLS_FIELD_NUMBER; + hash = (53 * hash) + getStartingUrlsList().hashCode(); + } + if (hasAuthentication()) { + hash = (37 * hash) + AUTHENTICATION_FIELD_NUMBER; + hash = (53 * hash) + getAuthentication().hashCode(); + } + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + userAgent_; + if (getBlacklistPatternsCount() > 0) { + hash = (37 * hash) + BLACKLIST_PATTERNS_FIELD_NUMBER; + hash = (53 * hash) + getBlacklistPatternsList().hashCode(); + } + if (hasSchedule()) { + hash = (37 * hash) + SCHEDULE_FIELD_NUMBER; + hash = (53 * hash) + getSchedule().hashCode(); + } + hash = (37 * hash) + EXPORT_TO_SECURITY_COMMAND_CENTER_FIELD_NUMBER; + hash = (53 * hash) + exportToSecurityCommandCenter_; + hash = (37 * hash) + RISK_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + riskLevel_; + hash = (37 * hash) + MANAGED_SCAN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getManagedScan()); + hash = (37 * hash) + STATIC_IP_SCAN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getStaticIpScan()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.websecurityscanner.v1.ScanConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A ScanConfig resource contains the configurations to launch a scan.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfig) + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfig.class, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ScanConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + displayName_ = ""; + + maxQps_ = 0; + + startingUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + if (authenticationBuilder_ == null) { + authentication_ = null; + } else { + authentication_ = null; + authenticationBuilder_ = null; + } + userAgent_ = 0; + + blacklistPatterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (scheduleBuilder_ == null) { + schedule_ = null; + } else { + schedule_ = null; + scheduleBuilder_ = null; + } + exportToSecurityCommandCenter_ = 0; + + riskLevel_ = 0; + + managedScan_ = false; + + staticIpScan_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig build() { + com.google.cloud.websecurityscanner.v1.ScanConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfig result = + new com.google.cloud.websecurityscanner.v1.ScanConfig(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.displayName_ = displayName_; + result.maxQps_ = maxQps_; + if (((bitField0_ & 0x00000001) != 0)) { + startingUrls_ = startingUrls_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.startingUrls_ = startingUrls_; + if (authenticationBuilder_ == null) { + result.authentication_ = authentication_; + } else { + result.authentication_ = authenticationBuilder_.build(); + } + result.userAgent_ = userAgent_; + if (((bitField0_ & 0x00000002) != 0)) { + blacklistPatterns_ = blacklistPatterns_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.blacklistPatterns_ = blacklistPatterns_; + if (scheduleBuilder_ == null) { + result.schedule_ = schedule_; + } else { + result.schedule_ = scheduleBuilder_.build(); + } + result.exportToSecurityCommandCenter_ = exportToSecurityCommandCenter_; + result.riskLevel_ = riskLevel_; + result.managedScan_ = managedScan_; + result.staticIpScan_ = staticIpScan_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanConfig) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ScanConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ScanConfig other) { + if (other == com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + if (other.getMaxQps() != 0) { + setMaxQps(other.getMaxQps()); + } + if (!other.startingUrls_.isEmpty()) { + if (startingUrls_.isEmpty()) { + startingUrls_ = other.startingUrls_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStartingUrlsIsMutable(); + startingUrls_.addAll(other.startingUrls_); + } + onChanged(); + } + if (other.hasAuthentication()) { + mergeAuthentication(other.getAuthentication()); + } + if (other.userAgent_ != 0) { + setUserAgentValue(other.getUserAgentValue()); + } + if (!other.blacklistPatterns_.isEmpty()) { + if (blacklistPatterns_.isEmpty()) { + blacklistPatterns_ = other.blacklistPatterns_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureBlacklistPatternsIsMutable(); + blacklistPatterns_.addAll(other.blacklistPatterns_); + } + onChanged(); + } + if (other.hasSchedule()) { + mergeSchedule(other.getSchedule()); + } + if (other.exportToSecurityCommandCenter_ != 0) { + setExportToSecurityCommandCenterValue(other.getExportToSecurityCommandCenterValue()); + } + if (other.riskLevel_ != 0) { + setRiskLevelValue(other.getRiskLevelValue()); + } + if (other.getManagedScan() != false) { + setManagedScan(other.getManagedScan()); + } + if (other.getStaticIpScan() != false) { + setStaticIpScan(other.getStaticIpScan()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name of the ScanConfig. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+     * generated by the system.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The resource name of the ScanConfig. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+     * generated by the system.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The resource name of the ScanConfig. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+     * generated by the system.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the ScanConfig. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+     * generated by the system.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name of the ScanConfig. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+     * generated by the system.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Required. The user provided display name of the ScanConfig.
+     * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The user provided display name of the ScanConfig.
+     * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The user provided display name of the ScanConfig.
+     * 
+ * + * string display_name = 2; + * + * @param value The displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The user provided display name of the ScanConfig.
+     * 
+ * + * string display_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The user provided display name of the ScanConfig.
+     * 
+ * + * string display_name = 2; + * + * @param value The bytes for displayName to set. + * @return This builder for chaining. + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private int maxQps_; + /** + * + * + *
+     * The maximum QPS during scanning. A valid value ranges from 5 to 20
+     * inclusively. If the field is unspecified or its value is set 0, server will
+     * default to 15. Other values outside of [5, 20] range will be rejected with
+     * INVALID_ARGUMENT error.
+     * 
+ * + * int32 max_qps = 3; + * + * @return The maxQps. + */ + @java.lang.Override + public int getMaxQps() { + return maxQps_; + } + /** + * + * + *
+     * The maximum QPS during scanning. A valid value ranges from 5 to 20
+     * inclusively. If the field is unspecified or its value is set 0, server will
+     * default to 15. Other values outside of [5, 20] range will be rejected with
+     * INVALID_ARGUMENT error.
+     * 
+ * + * int32 max_qps = 3; + * + * @param value The maxQps to set. + * @return This builder for chaining. + */ + public Builder setMaxQps(int value) { + + maxQps_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum QPS during scanning. A valid value ranges from 5 to 20
+     * inclusively. If the field is unspecified or its value is set 0, server will
+     * default to 15. Other values outside of [5, 20] range will be rejected with
+     * INVALID_ARGUMENT error.
+     * 
+ * + * int32 max_qps = 3; + * + * @return This builder for chaining. + */ + public Builder clearMaxQps() { + + maxQps_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList startingUrls_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureStartingUrlsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + startingUrls_ = new com.google.protobuf.LazyStringArrayList(startingUrls_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @return A list containing the startingUrls. + */ + public com.google.protobuf.ProtocolStringList getStartingUrlsList() { + return startingUrls_.getUnmodifiableView(); + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @return The count of startingUrls. + */ + public int getStartingUrlsCount() { + return startingUrls_.size(); + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index of the element to return. + * @return The startingUrls at the given index. + */ + public java.lang.String getStartingUrls(int index) { + return startingUrls_.get(index); + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the startingUrls at the given index. + */ + public com.google.protobuf.ByteString getStartingUrlsBytes(int index) { + return startingUrls_.getByteString(index); + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index to set the value at. + * @param value The startingUrls to set. + * @return This builder for chaining. + */ + public Builder setStartingUrls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartingUrlsIsMutable(); + startingUrls_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @param value The startingUrls to add. + * @return This builder for chaining. + */ + public Builder addStartingUrls(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStartingUrlsIsMutable(); + startingUrls_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @param values The startingUrls to add. + * @return This builder for chaining. + */ + public Builder addAllStartingUrls(java.lang.Iterable values) { + ensureStartingUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, startingUrls_); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @return This builder for chaining. + */ + public Builder clearStartingUrls() { + startingUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The starting URLs from which the scanner finds site pages.
+     * 
+ * + * repeated string starting_urls = 4; + * + * @param value The bytes of the startingUrls to add. + * @return This builder for chaining. + */ + public Builder addStartingUrlsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStartingUrlsIsMutable(); + startingUrls_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder> + authenticationBuilder_; + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + * + * @return Whether the authentication field is set. + */ + public boolean hasAuthentication() { + return authenticationBuilder_ != null || authentication_ != null; + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + * + * @return The authentication. + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication getAuthentication() { + if (authenticationBuilder_ == null) { + return authentication_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.getDefaultInstance() + : authentication_; + } else { + return authenticationBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + public Builder setAuthentication( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication value) { + if (authenticationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authentication_ = value; + onChanged(); + } else { + authenticationBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + public Builder setAuthentication( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder builderForValue) { + if (authenticationBuilder_ == null) { + authentication_ = builderForValue.build(); + onChanged(); + } else { + authenticationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + public Builder mergeAuthentication( + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication value) { + if (authenticationBuilder_ == null) { + if (authentication_ != null) { + authentication_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.newBuilder( + authentication_) + .mergeFrom(value) + .buildPartial(); + } else { + authentication_ = value; + } + onChanged(); + } else { + authenticationBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + public Builder clearAuthentication() { + if (authenticationBuilder_ == null) { + authentication_ = null; + onChanged(); + } else { + authentication_ = null; + authenticationBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder + getAuthenticationBuilder() { + + onChanged(); + return getAuthenticationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder + getAuthenticationOrBuilder() { + if (authenticationBuilder_ != null) { + return authenticationBuilder_.getMessageOrBuilder(); + } else { + return authentication_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.getDefaultInstance() + : authentication_; + } + } + /** + * + * + *
+     * The authentication configuration. If specified, service will use the
+     * authentication configuration during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder> + getAuthenticationFieldBuilder() { + if (authenticationBuilder_ == null) { + authenticationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication, + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder>( + getAuthentication(), getParentForChildren(), isClean()); + authentication_ = null; + } + return authenticationBuilder_; + } + + private int userAgent_ = 0; + /** + * + * + *
+     * The user agent used during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return The enum numeric value on the wire for userAgent. + */ + @java.lang.Override + public int getUserAgentValue() { + return userAgent_; + } + /** + * + * + *
+     * The user agent used during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @param value The enum numeric value on the wire for userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgentValue(int value) { + + userAgent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user agent used during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return The userAgent. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent getUserAgent() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent result = + com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent.valueOf(userAgent_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The user agent used during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @param value The userAgent to set. + * @return This builder for chaining. + */ + public Builder setUserAgent(com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user agent used during scanning.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return This builder for chaining. + */ + public Builder clearUserAgent() { + + userAgent_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList blacklistPatterns_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureBlacklistPatternsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + blacklistPatterns_ = new com.google.protobuf.LazyStringArrayList(blacklistPatterns_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return A list containing the blacklistPatterns. + */ + public com.google.protobuf.ProtocolStringList getBlacklistPatternsList() { + return blacklistPatterns_.getUnmodifiableView(); + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return The count of blacklistPatterns. + */ + public int getBlacklistPatternsCount() { + return blacklistPatterns_.size(); + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index of the element to return. + * @return The blacklistPatterns at the given index. + */ + public java.lang.String getBlacklistPatterns(int index) { + return blacklistPatterns_.get(index); + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index of the value to return. + * @return The bytes of the blacklistPatterns at the given index. + */ + public com.google.protobuf.ByteString getBlacklistPatternsBytes(int index) { + return blacklistPatterns_.getByteString(index); + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index to set the value at. + * @param value The blacklistPatterns to set. + * @return This builder for chaining. + */ + public Builder setBlacklistPatterns(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlacklistPatternsIsMutable(); + blacklistPatterns_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param value The blacklistPatterns to add. + * @return This builder for chaining. + */ + public Builder addBlacklistPatterns(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureBlacklistPatternsIsMutable(); + blacklistPatterns_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param values The blacklistPatterns to add. + * @return This builder for chaining. + */ + public Builder addAllBlacklistPatterns(java.lang.Iterable values) { + ensureBlacklistPatternsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, blacklistPatterns_); + onChanged(); + return this; + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return This builder for chaining. + */ + public Builder clearBlacklistPatterns() { + blacklistPatterns_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The excluded URL patterns as described in
+     * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+     * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param value The bytes of the blacklistPatterns to add. + * @return This builder for chaining. + */ + public Builder addBlacklistPatternsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureBlacklistPatternsIsMutable(); + blacklistPatterns_.add(value); + onChanged(); + return this; + } + + private com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule, + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder> + scheduleBuilder_; + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + * + * @return Whether the schedule field is set. + */ + public boolean hasSchedule() { + return scheduleBuilder_ != null || schedule_ != null; + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + * + * @return The schedule. + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule getSchedule() { + if (scheduleBuilder_ == null) { + return schedule_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.getDefaultInstance() + : schedule_; + } else { + return scheduleBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + public Builder setSchedule(com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule value) { + if (scheduleBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + schedule_ = value; + onChanged(); + } else { + scheduleBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + public Builder setSchedule( + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder builderForValue) { + if (scheduleBuilder_ == null) { + schedule_ = builderForValue.build(); + onChanged(); + } else { + scheduleBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + public Builder mergeSchedule(com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule value) { + if (scheduleBuilder_ == null) { + if (schedule_ != null) { + schedule_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.newBuilder(schedule_) + .mergeFrom(value) + .buildPartial(); + } else { + schedule_ = value; + } + onChanged(); + } else { + scheduleBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + public Builder clearSchedule() { + if (scheduleBuilder_ == null) { + schedule_ = null; + onChanged(); + } else { + schedule_ = null; + scheduleBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder getScheduleBuilder() { + + onChanged(); + return getScheduleFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder + getScheduleOrBuilder() { + if (scheduleBuilder_ != null) { + return scheduleBuilder_.getMessageOrBuilder(); + } else { + return schedule_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.getDefaultInstance() + : schedule_; + } + } + /** + * + * + *
+     * The schedule of the ScanConfig.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule, + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder> + getScheduleFieldBuilder() { + if (scheduleBuilder_ == null) { + scheduleBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule, + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder>( + getSchedule(), getParentForChildren(), isClean()); + schedule_ = null; + } + return scheduleBuilder_; + } + + private int exportToSecurityCommandCenter_ = 0; + /** + * + * + *
+     * Controls export of scan configurations and results to Security
+     * Command Center.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return The enum numeric value on the wire for exportToSecurityCommandCenter. + */ + @java.lang.Override + public int getExportToSecurityCommandCenterValue() { + return exportToSecurityCommandCenter_; + } + /** + * + * + *
+     * Controls export of scan configurations and results to Security
+     * Command Center.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @param value The enum numeric value on the wire for exportToSecurityCommandCenter to set. + * @return This builder for chaining. + */ + public Builder setExportToSecurityCommandCenterValue(int value) { + + exportToSecurityCommandCenter_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Controls export of scan configurations and results to Security
+     * Command Center.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return The exportToSecurityCommandCenter. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + getExportToSecurityCommandCenter() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter result = + com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter.valueOf( + exportToSecurityCommandCenter_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Controls export of scan configurations and results to Security
+     * Command Center.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @param value The exportToSecurityCommandCenter to set. + * @return This builder for chaining. + */ + public Builder setExportToSecurityCommandCenter( + com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter value) { + if (value == null) { + throw new NullPointerException(); + } + + exportToSecurityCommandCenter_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Controls export of scan configurations and results to Security
+     * Command Center.
+     * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return This builder for chaining. + */ + public Builder clearExportToSecurityCommandCenter() { + + exportToSecurityCommandCenter_ = 0; + onChanged(); + return this; + } + + private int riskLevel_ = 0; + /** + * + * + *
+     * The risk level selected for the scan
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return The enum numeric value on the wire for riskLevel. + */ + @java.lang.Override + public int getRiskLevelValue() { + return riskLevel_; + } + /** + * + * + *
+     * The risk level selected for the scan
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @param value The enum numeric value on the wire for riskLevel to set. + * @return This builder for chaining. + */ + public Builder setRiskLevelValue(int value) { + + riskLevel_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The risk level selected for the scan
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return The riskLevel. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel getRiskLevel() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel result = + com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel.valueOf(riskLevel_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The risk level selected for the scan
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @param value The riskLevel to set. + * @return This builder for chaining. + */ + public Builder setRiskLevel(com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel value) { + if (value == null) { + throw new NullPointerException(); + } + + riskLevel_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The risk level selected for the scan
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return This builder for chaining. + */ + public Builder clearRiskLevel() { + + riskLevel_ = 0; + onChanged(); + return this; + } + + private boolean managedScan_; + /** + * + * + *
+     * Whether the scan config is managed by Web Security Scanner, output
+     * only.
+     * 
+ * + * bool managed_scan = 13; + * + * @return The managedScan. + */ + @java.lang.Override + public boolean getManagedScan() { + return managedScan_; + } + /** + * + * + *
+     * Whether the scan config is managed by Web Security Scanner, output
+     * only.
+     * 
+ * + * bool managed_scan = 13; + * + * @param value The managedScan to set. + * @return This builder for chaining. + */ + public Builder setManagedScan(boolean value) { + + managedScan_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the scan config is managed by Web Security Scanner, output
+     * only.
+     * 
+ * + * bool managed_scan = 13; + * + * @return This builder for chaining. + */ + public Builder clearManagedScan() { + + managedScan_ = false; + onChanged(); + return this; + } + + private boolean staticIpScan_; + /** + * + * + *
+     * Whether the scan configuration has enabled static IP address scan feature.
+     * If enabled, the scanner will access applications from static IP addresses.
+     * 
+ * + * bool static_ip_scan = 14; + * + * @return The staticIpScan. + */ + @java.lang.Override + public boolean getStaticIpScan() { + return staticIpScan_; + } + /** + * + * + *
+     * Whether the scan configuration has enabled static IP address scan feature.
+     * If enabled, the scanner will access applications from static IP addresses.
+     * 
+ * + * bool static_ip_scan = 14; + * + * @param value The staticIpScan to set. + * @return This builder for chaining. + */ + public Builder setStaticIpScan(boolean value) { + + staticIpScan_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether the scan configuration has enabled static IP address scan feature.
+     * If enabled, the scanner will access applications from static IP addresses.
+     * 
+ * + * bool static_ip_scan = 14; + * + * @return This builder for chaining. + */ + public Builder clearStaticIpScan() { + + staticIpScan_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfig) + private static final com.google.cloud.websecurityscanner.v1.ScanConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanConfig(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScanConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScanConfig(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigError.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigError.java new file mode 100644 index 00000000..e4217c7e --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigError.java @@ -0,0 +1,1920 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_config_error.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Defines a custom error message used by CreateScanConfig and UpdateScanConfig
+ * APIs when scan configuration validation fails. It is also reported as part of
+ * a ScanRunErrorTrace message if scan validation fails due to a scan
+ * configuration error.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfigError} + */ +public final class ScanConfigError extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanConfigError) + ScanConfigErrorOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScanConfigError.newBuilder() to construct. + private ScanConfigError(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScanConfigError() { + code_ = 0; + fieldName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScanConfigError(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScanConfigError( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + code_ = rawValue; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + fieldName_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfigError.class, + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder.class); + } + + /** + * + * + *
+   * Output only.
+   * Defines an error reason code.
+   * Next id: 44
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanConfigError.Code} + */ + public enum Code implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * There is no error.
+     * 
+ * + * CODE_UNSPECIFIED = 0; + */ + CODE_UNSPECIFIED(0, 0), + /** + * + * + *
+     * Indicates an internal server error.
+     * Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown.
+     * 
+ * + * INTERNAL_ERROR = 1; + */ + INTERNAL_ERROR(2, 1), + /** + * + * + *
+     * One of the seed URLs is an App Engine URL but we cannot validate the scan
+     * settings due to an App Engine API backend error.
+     * 
+ * + * APPENGINE_API_BACKEND_ERROR = 2; + */ + APPENGINE_API_BACKEND_ERROR(3, 2), + /** + * + * + *
+     * One of the seed URLs is an App Engine URL but we cannot access the
+     * App Engine API to validate scan settings.
+     * 
+ * + * APPENGINE_API_NOT_ACCESSIBLE = 3; + */ + APPENGINE_API_NOT_ACCESSIBLE(4, 3), + /** + * + * + *
+     * One of the seed URLs is an App Engine URL but the Default Host of the
+     * App Engine is not set.
+     * 
+ * + * APPENGINE_DEFAULT_HOST_MISSING = 4; + */ + APPENGINE_DEFAULT_HOST_MISSING(5, 4), + /** + * + * + *
+     * Google corporate accounts can not be used for scanning.
+     * 
+ * + * CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; + */ + CANNOT_USE_GOOGLE_COM_ACCOUNT(6, 6), + /** + * + * + *
+     * The account of the scan creator can not be used for scanning.
+     * 
+ * + * CANNOT_USE_OWNER_ACCOUNT = 7; + */ + CANNOT_USE_OWNER_ACCOUNT(7, 7), + /** + * + * + *
+     * This scan targets Compute Engine, but we cannot validate scan settings
+     * due to a Compute Engine API backend error.
+     * 
+ * + * COMPUTE_API_BACKEND_ERROR = 8; + */ + COMPUTE_API_BACKEND_ERROR(8, 8), + /** + * + * + *
+     * This scan targets Compute Engine, but we cannot access the Compute Engine
+     * API to validate the scan settings.
+     * 
+ * + * COMPUTE_API_NOT_ACCESSIBLE = 9; + */ + COMPUTE_API_NOT_ACCESSIBLE(9, 9), + /** + * + * + *
+     * The Custom Login URL does not belong to the current project.
+     * 
+ * + * CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; + */ + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT(10, 10), + /** + * + * + *
+     * The Custom Login URL is malformed (can not be parsed).
+     * 
+ * + * CUSTOM_LOGIN_URL_MALFORMED = 11; + */ + CUSTOM_LOGIN_URL_MALFORMED(11, 11), + /** + * + * + *
+     * The Custom Login URL is mapped to a non-routable IP address in DNS.
+     * 
+ * + * CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; + */ + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS(12, 12), + /** + * + * + *
+     * The Custom Login URL is mapped to an IP address which is not reserved for
+     * the current project.
+     * 
+ * + * CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; + */ + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS(13, 13), + /** + * + * + *
+     * The Custom Login URL has a non-routable IP address.
+     * 
+ * + * CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; + */ + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS(14, 14), + /** + * + * + *
+     * The Custom Login URL has an IP address which is not reserved for the
+     * current project.
+     * 
+ * + * CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; + */ + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS(15, 15), + /** + * + * + *
+     * Another scan with the same name (case-sensitive) already exists.
+     * 
+ * + * DUPLICATE_SCAN_NAME = 16; + */ + DUPLICATE_SCAN_NAME(16, 16), + /** + * + * + *
+     * A field is set to an invalid value.
+     * 
+ * + * INVALID_FIELD_VALUE = 18; + */ + INVALID_FIELD_VALUE(17, 18), + /** + * + * + *
+     * There was an error trying to authenticate to the scan target.
+     * 
+ * + * FAILED_TO_AUTHENTICATE_TO_TARGET = 19; + */ + FAILED_TO_AUTHENTICATE_TO_TARGET(18, 19), + /** + * + * + *
+     * Finding type value is not specified in the list findings request.
+     * 
+ * + * FINDING_TYPE_UNSPECIFIED = 20; + */ + FINDING_TYPE_UNSPECIFIED(19, 20), + /** + * + * + *
+     * Scan targets Compute Engine, yet current project was not whitelisted for
+     * Google Compute Engine Scanning Alpha access.
+     * 
+ * + * FORBIDDEN_TO_SCAN_COMPUTE = 21; + */ + FORBIDDEN_TO_SCAN_COMPUTE(20, 21), + /** + * + * + *
+     * User tries to update managed scan
+     * 
+ * + * FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; + */ + FORBIDDEN_UPDATE_TO_MANAGED_SCAN(21, 43), + /** + * + * + *
+     * The supplied filter is malformed. For example, it can not be parsed, does
+     * not have a filter type in expression, or the same filter type appears
+     * more than once.
+     * 
+ * + * MALFORMED_FILTER = 22; + */ + MALFORMED_FILTER(22, 22), + /** + * + * + *
+     * The supplied resource name is malformed (can not be parsed).
+     * 
+ * + * MALFORMED_RESOURCE_NAME = 23; + */ + MALFORMED_RESOURCE_NAME(23, 23), + /** + * + * + *
+     * The current project is not in an active state.
+     * 
+ * + * PROJECT_INACTIVE = 24; + */ + PROJECT_INACTIVE(24, 24), + /** + * + * + *
+     * A required field is not set.
+     * 
+ * + * REQUIRED_FIELD = 25; + */ + REQUIRED_FIELD(25, 25), + /** + * + * + *
+     * Project id, scanconfig id, scanrun id, or finding id are not consistent
+     * with each other in resource name.
+     * 
+ * + * RESOURCE_NAME_INCONSISTENT = 26; + */ + RESOURCE_NAME_INCONSISTENT(26, 26), + /** + * + * + *
+     * The scan being requested to start is already running.
+     * 
+ * + * SCAN_ALREADY_RUNNING = 27; + */ + SCAN_ALREADY_RUNNING(27, 27), + /** + * + * + *
+     * The scan that was requested to be stopped is not running.
+     * 
+ * + * SCAN_NOT_RUNNING = 28; + */ + SCAN_NOT_RUNNING(28, 28), + /** + * + * + *
+     * One of the seed URLs does not belong to the current project.
+     * 
+ * + * SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; + */ + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT(29, 29), + /** + * + * + *
+     * One of the seed URLs is malformed (can not be parsed).
+     * 
+ * + * SEED_URL_MALFORMED = 30; + */ + SEED_URL_MALFORMED(30, 30), + /** + * + * + *
+     * One of the seed URLs is mapped to a non-routable IP address in DNS.
+     * 
+ * + * SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; + */ + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS(31, 31), + /** + * + * + *
+     * One of the seed URLs is mapped to an IP address which is not reserved
+     * for the current project.
+     * 
+ * + * SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; + */ + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS(32, 32), + /** + * + * + *
+     * One of the seed URLs has on-routable IP address.
+     * 
+ * + * SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; + */ + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS(33, 33), + /** + * + * + *
+     * One of the seed URLs has an IP address that is not reserved
+     * for the current project.
+     * 
+ * + * SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; + */ + SEED_URL_HAS_UNRESERVED_IP_ADDRESS(34, 35), + /** + * + * + *
+     * The Web Security Scanner service account is not configured under the
+     * project.
+     * 
+ * + * SERVICE_ACCOUNT_NOT_CONFIGURED = 36; + */ + SERVICE_ACCOUNT_NOT_CONFIGURED(35, 36), + /** + * + * + *
+     * A project has reached the maximum number of scans.
+     * 
+ * + * TOO_MANY_SCANS = 37; + */ + TOO_MANY_SCANS(36, 37), + /** + * + * + *
+     * Resolving the details of the current project fails.
+     * 
+ * + * UNABLE_TO_RESOLVE_PROJECT_INFO = 38; + */ + UNABLE_TO_RESOLVE_PROJECT_INFO(37, 38), + /** + * + * + *
+     * One or more blacklist patterns were in the wrong format.
+     * 
+ * + * UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; + */ + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT(38, 39), + /** + * + * + *
+     * The supplied filter is not supported.
+     * 
+ * + * UNSUPPORTED_FILTER = 40; + */ + UNSUPPORTED_FILTER(39, 40), + /** + * + * + *
+     * The supplied finding type is not supported. For example, we do not
+     * provide findings of the given finding type.
+     * 
+ * + * UNSUPPORTED_FINDING_TYPE = 41; + */ + UNSUPPORTED_FINDING_TYPE(40, 41), + /** + * + * + *
+     * The URL scheme of one or more of the supplied URLs is not supported.
+     * 
+ * + * UNSUPPORTED_URL_SCHEME = 42; + */ + UNSUPPORTED_URL_SCHEME(41, 42), + UNRECOGNIZED(-1, -1), + ; + + /** + * + * + *
+     * There is no error.
+     * 
+ * + * OK = 0; + */ + public static final Code OK = CODE_UNSPECIFIED; + /** + * + * + *
+     * There is no error.
+     * 
+ * + * CODE_UNSPECIFIED = 0; + */ + public static final int CODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * There is no error.
+     * 
+ * + * OK = 0; + */ + public static final int OK_VALUE = 0; + /** + * + * + *
+     * Indicates an internal server error.
+     * Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown.
+     * 
+ * + * INTERNAL_ERROR = 1; + */ + public static final int INTERNAL_ERROR_VALUE = 1; + /** + * + * + *
+     * One of the seed URLs is an App Engine URL but we cannot validate the scan
+     * settings due to an App Engine API backend error.
+     * 
+ * + * APPENGINE_API_BACKEND_ERROR = 2; + */ + public static final int APPENGINE_API_BACKEND_ERROR_VALUE = 2; + /** + * + * + *
+     * One of the seed URLs is an App Engine URL but we cannot access the
+     * App Engine API to validate scan settings.
+     * 
+ * + * APPENGINE_API_NOT_ACCESSIBLE = 3; + */ + public static final int APPENGINE_API_NOT_ACCESSIBLE_VALUE = 3; + /** + * + * + *
+     * One of the seed URLs is an App Engine URL but the Default Host of the
+     * App Engine is not set.
+     * 
+ * + * APPENGINE_DEFAULT_HOST_MISSING = 4; + */ + public static final int APPENGINE_DEFAULT_HOST_MISSING_VALUE = 4; + /** + * + * + *
+     * Google corporate accounts can not be used for scanning.
+     * 
+ * + * CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; + */ + public static final int CANNOT_USE_GOOGLE_COM_ACCOUNT_VALUE = 6; + /** + * + * + *
+     * The account of the scan creator can not be used for scanning.
+     * 
+ * + * CANNOT_USE_OWNER_ACCOUNT = 7; + */ + public static final int CANNOT_USE_OWNER_ACCOUNT_VALUE = 7; + /** + * + * + *
+     * This scan targets Compute Engine, but we cannot validate scan settings
+     * due to a Compute Engine API backend error.
+     * 
+ * + * COMPUTE_API_BACKEND_ERROR = 8; + */ + public static final int COMPUTE_API_BACKEND_ERROR_VALUE = 8; + /** + * + * + *
+     * This scan targets Compute Engine, but we cannot access the Compute Engine
+     * API to validate the scan settings.
+     * 
+ * + * COMPUTE_API_NOT_ACCESSIBLE = 9; + */ + public static final int COMPUTE_API_NOT_ACCESSIBLE_VALUE = 9; + /** + * + * + *
+     * The Custom Login URL does not belong to the current project.
+     * 
+ * + * CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; + */ + public static final int CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT_VALUE = 10; + /** + * + * + *
+     * The Custom Login URL is malformed (can not be parsed).
+     * 
+ * + * CUSTOM_LOGIN_URL_MALFORMED = 11; + */ + public static final int CUSTOM_LOGIN_URL_MALFORMED_VALUE = 11; + /** + * + * + *
+     * The Custom Login URL is mapped to a non-routable IP address in DNS.
+     * 
+ * + * CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; + */ + public static final int CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS_VALUE = 12; + /** + * + * + *
+     * The Custom Login URL is mapped to an IP address which is not reserved for
+     * the current project.
+     * 
+ * + * CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; + */ + public static final int CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS_VALUE = 13; + /** + * + * + *
+     * The Custom Login URL has a non-routable IP address.
+     * 
+ * + * CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; + */ + public static final int CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS_VALUE = 14; + /** + * + * + *
+     * The Custom Login URL has an IP address which is not reserved for the
+     * current project.
+     * 
+ * + * CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; + */ + public static final int CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS_VALUE = 15; + /** + * + * + *
+     * Another scan with the same name (case-sensitive) already exists.
+     * 
+ * + * DUPLICATE_SCAN_NAME = 16; + */ + public static final int DUPLICATE_SCAN_NAME_VALUE = 16; + /** + * + * + *
+     * A field is set to an invalid value.
+     * 
+ * + * INVALID_FIELD_VALUE = 18; + */ + public static final int INVALID_FIELD_VALUE_VALUE = 18; + /** + * + * + *
+     * There was an error trying to authenticate to the scan target.
+     * 
+ * + * FAILED_TO_AUTHENTICATE_TO_TARGET = 19; + */ + public static final int FAILED_TO_AUTHENTICATE_TO_TARGET_VALUE = 19; + /** + * + * + *
+     * Finding type value is not specified in the list findings request.
+     * 
+ * + * FINDING_TYPE_UNSPECIFIED = 20; + */ + public static final int FINDING_TYPE_UNSPECIFIED_VALUE = 20; + /** + * + * + *
+     * Scan targets Compute Engine, yet current project was not whitelisted for
+     * Google Compute Engine Scanning Alpha access.
+     * 
+ * + * FORBIDDEN_TO_SCAN_COMPUTE = 21; + */ + public static final int FORBIDDEN_TO_SCAN_COMPUTE_VALUE = 21; + /** + * + * + *
+     * User tries to update managed scan
+     * 
+ * + * FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; + */ + public static final int FORBIDDEN_UPDATE_TO_MANAGED_SCAN_VALUE = 43; + /** + * + * + *
+     * The supplied filter is malformed. For example, it can not be parsed, does
+     * not have a filter type in expression, or the same filter type appears
+     * more than once.
+     * 
+ * + * MALFORMED_FILTER = 22; + */ + public static final int MALFORMED_FILTER_VALUE = 22; + /** + * + * + *
+     * The supplied resource name is malformed (can not be parsed).
+     * 
+ * + * MALFORMED_RESOURCE_NAME = 23; + */ + public static final int MALFORMED_RESOURCE_NAME_VALUE = 23; + /** + * + * + *
+     * The current project is not in an active state.
+     * 
+ * + * PROJECT_INACTIVE = 24; + */ + public static final int PROJECT_INACTIVE_VALUE = 24; + /** + * + * + *
+     * A required field is not set.
+     * 
+ * + * REQUIRED_FIELD = 25; + */ + public static final int REQUIRED_FIELD_VALUE = 25; + /** + * + * + *
+     * Project id, scanconfig id, scanrun id, or finding id are not consistent
+     * with each other in resource name.
+     * 
+ * + * RESOURCE_NAME_INCONSISTENT = 26; + */ + public static final int RESOURCE_NAME_INCONSISTENT_VALUE = 26; + /** + * + * + *
+     * The scan being requested to start is already running.
+     * 
+ * + * SCAN_ALREADY_RUNNING = 27; + */ + public static final int SCAN_ALREADY_RUNNING_VALUE = 27; + /** + * + * + *
+     * The scan that was requested to be stopped is not running.
+     * 
+ * + * SCAN_NOT_RUNNING = 28; + */ + public static final int SCAN_NOT_RUNNING_VALUE = 28; + /** + * + * + *
+     * One of the seed URLs does not belong to the current project.
+     * 
+ * + * SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; + */ + public static final int SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT_VALUE = 29; + /** + * + * + *
+     * One of the seed URLs is malformed (can not be parsed).
+     * 
+ * + * SEED_URL_MALFORMED = 30; + */ + public static final int SEED_URL_MALFORMED_VALUE = 30; + /** + * + * + *
+     * One of the seed URLs is mapped to a non-routable IP address in DNS.
+     * 
+ * + * SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; + */ + public static final int SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS_VALUE = 31; + /** + * + * + *
+     * One of the seed URLs is mapped to an IP address which is not reserved
+     * for the current project.
+     * 
+ * + * SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; + */ + public static final int SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS_VALUE = 32; + /** + * + * + *
+     * One of the seed URLs has on-routable IP address.
+     * 
+ * + * SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; + */ + public static final int SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS_VALUE = 33; + /** + * + * + *
+     * One of the seed URLs has an IP address that is not reserved
+     * for the current project.
+     * 
+ * + * SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; + */ + public static final int SEED_URL_HAS_UNRESERVED_IP_ADDRESS_VALUE = 35; + /** + * + * + *
+     * The Web Security Scanner service account is not configured under the
+     * project.
+     * 
+ * + * SERVICE_ACCOUNT_NOT_CONFIGURED = 36; + */ + public static final int SERVICE_ACCOUNT_NOT_CONFIGURED_VALUE = 36; + /** + * + * + *
+     * A project has reached the maximum number of scans.
+     * 
+ * + * TOO_MANY_SCANS = 37; + */ + public static final int TOO_MANY_SCANS_VALUE = 37; + /** + * + * + *
+     * Resolving the details of the current project fails.
+     * 
+ * + * UNABLE_TO_RESOLVE_PROJECT_INFO = 38; + */ + public static final int UNABLE_TO_RESOLVE_PROJECT_INFO_VALUE = 38; + /** + * + * + *
+     * One or more blacklist patterns were in the wrong format.
+     * 
+ * + * UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; + */ + public static final int UNSUPPORTED_BLACKLIST_PATTERN_FORMAT_VALUE = 39; + /** + * + * + *
+     * The supplied filter is not supported.
+     * 
+ * + * UNSUPPORTED_FILTER = 40; + */ + public static final int UNSUPPORTED_FILTER_VALUE = 40; + /** + * + * + *
+     * The supplied finding type is not supported. For example, we do not
+     * provide findings of the given finding type.
+     * 
+ * + * UNSUPPORTED_FINDING_TYPE = 41; + */ + public static final int UNSUPPORTED_FINDING_TYPE_VALUE = 41; + /** + * + * + *
+     * The URL scheme of one or more of the supplied URLs is not supported.
+     * 
+ * + * UNSUPPORTED_URL_SCHEME = 42; + */ + public static final int UNSUPPORTED_URL_SCHEME_VALUE = 42; + + public final int getNumber() { + if (index == -1) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Code forNumber(int value) { + switch (value) { + case 0: + return CODE_UNSPECIFIED; + case 1: + return INTERNAL_ERROR; + case 2: + return APPENGINE_API_BACKEND_ERROR; + case 3: + return APPENGINE_API_NOT_ACCESSIBLE; + case 4: + return APPENGINE_DEFAULT_HOST_MISSING; + case 6: + return CANNOT_USE_GOOGLE_COM_ACCOUNT; + case 7: + return CANNOT_USE_OWNER_ACCOUNT; + case 8: + return COMPUTE_API_BACKEND_ERROR; + case 9: + return COMPUTE_API_NOT_ACCESSIBLE; + case 10: + return CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT; + case 11: + return CUSTOM_LOGIN_URL_MALFORMED; + case 12: + return CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS; + case 13: + return CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS; + case 14: + return CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS; + case 15: + return CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS; + case 16: + return DUPLICATE_SCAN_NAME; + case 18: + return INVALID_FIELD_VALUE; + case 19: + return FAILED_TO_AUTHENTICATE_TO_TARGET; + case 20: + return FINDING_TYPE_UNSPECIFIED; + case 21: + return FORBIDDEN_TO_SCAN_COMPUTE; + case 43: + return FORBIDDEN_UPDATE_TO_MANAGED_SCAN; + case 22: + return MALFORMED_FILTER; + case 23: + return MALFORMED_RESOURCE_NAME; + case 24: + return PROJECT_INACTIVE; + case 25: + return REQUIRED_FIELD; + case 26: + return RESOURCE_NAME_INCONSISTENT; + case 27: + return SCAN_ALREADY_RUNNING; + case 28: + return SCAN_NOT_RUNNING; + case 29: + return SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT; + case 30: + return SEED_URL_MALFORMED; + case 31: + return SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS; + case 32: + return SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS; + case 33: + return SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS; + case 35: + return SEED_URL_HAS_UNRESERVED_IP_ADDRESS; + case 36: + return SERVICE_ACCOUNT_NOT_CONFIGURED; + case 37: + return TOO_MANY_SCANS; + case 38: + return UNABLE_TO_RESOLVE_PROJECT_INFO; + case 39: + return UNSUPPORTED_BLACKLIST_PATTERN_FORMAT; + case 40: + return UNSUPPORTED_FILTER; + case 41: + return UNSUPPORTED_FINDING_TYPE; + case 42: + return UNSUPPORTED_URL_SCHEME; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (index == -1) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(index); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigError.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Code[] VALUES = getStaticValuesArray(); + + private static Code[] getStaticValuesArray() { + return new Code[] { + CODE_UNSPECIFIED, + OK, + INTERNAL_ERROR, + APPENGINE_API_BACKEND_ERROR, + APPENGINE_API_NOT_ACCESSIBLE, + APPENGINE_DEFAULT_HOST_MISSING, + CANNOT_USE_GOOGLE_COM_ACCOUNT, + CANNOT_USE_OWNER_ACCOUNT, + COMPUTE_API_BACKEND_ERROR, + COMPUTE_API_NOT_ACCESSIBLE, + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT, + CUSTOM_LOGIN_URL_MALFORMED, + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS, + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS, + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS, + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS, + DUPLICATE_SCAN_NAME, + INVALID_FIELD_VALUE, + FAILED_TO_AUTHENTICATE_TO_TARGET, + FINDING_TYPE_UNSPECIFIED, + FORBIDDEN_TO_SCAN_COMPUTE, + FORBIDDEN_UPDATE_TO_MANAGED_SCAN, + MALFORMED_FILTER, + MALFORMED_RESOURCE_NAME, + PROJECT_INACTIVE, + REQUIRED_FIELD, + RESOURCE_NAME_INCONSISTENT, + SCAN_ALREADY_RUNNING, + SCAN_NOT_RUNNING, + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT, + SEED_URL_MALFORMED, + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS, + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS, + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS, + SEED_URL_HAS_UNRESERVED_IP_ADDRESS, + SERVICE_ACCOUNT_NOT_CONFIGURED, + TOO_MANY_SCANS, + UNABLE_TO_RESOLVE_PROJECT_INFO, + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT, + UNSUPPORTED_FILTER, + UNSUPPORTED_FINDING_TYPE, + UNSUPPORTED_URL_SCHEME, + }; + } + + public static Code valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int index; + private final int value; + + private Code(int index, int value) { + this.index = index; + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanConfigError.Code) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * Output only. Indicates the reason code for a configuration failure.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * Output only. Indicates the reason code for a configuration failure.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError.Code getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfigError.Code result = + com.google.cloud.websecurityscanner.v1.ScanConfigError.Code.valueOf(code_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfigError.Code.UNRECOGNIZED + : result; + } + + public static final int FIELD_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object fieldName_; + /** + * + * + *
+   * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+   * for example "scan_config.max_qps". This field is provided for
+   * troubleshooting purposes only and its actual value can change in the
+   * future.
+   * 
+ * + * string field_name = 2; + * + * @return The fieldName. + */ + @java.lang.Override + public java.lang.String getFieldName() { + java.lang.Object ref = fieldName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldName_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+   * for example "scan_config.max_qps". This field is provided for
+   * troubleshooting purposes only and its actual value can change in the
+   * future.
+   * 
+ * + * string field_name = 2; + * + * @return The bytes for fieldName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFieldNameBytes() { + java.lang.Object ref = fieldName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ + != com.google.cloud.websecurityscanner.v1.ScanConfigError.Code.CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + if (!getFieldNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, fieldName_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.cloud.websecurityscanner.v1.ScanConfigError.Code.CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (!getFieldNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, fieldName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanConfigError)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanConfigError other = + (com.google.cloud.websecurityscanner.v1.ScanConfigError) obj; + + if (code_ != other.code_) return false; + if (!getFieldName().equals(other.getFieldName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (37 * hash) + FIELD_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFieldName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanConfigError prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Defines a custom error message used by CreateScanConfig and UpdateScanConfig
+   * APIs when scan configuration validation fails. It is also reported as part of
+   * a ScanRunErrorTrace message if scan validation fails due to a scan
+   * configuration error.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanConfigError} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanConfigError) + com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanConfigError.class, + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ScanConfigError.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + fieldName_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto + .internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanConfigError.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError build() { + com.google.cloud.websecurityscanner.v1.ScanConfigError result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanConfigError result = + new com.google.cloud.websecurityscanner.v1.ScanConfigError(this); + result.code_ = code_; + result.fieldName_ = fieldName_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanConfigError) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ScanConfigError) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ScanConfigError other) { + if (other == com.google.cloud.websecurityscanner.v1.ScanConfigError.getDefaultInstance()) + return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (!other.getFieldName().isEmpty()) { + fieldName_ = other.fieldName_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanConfigError parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanConfigError) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int code_ = 0; + /** + * + * + *
+     * Output only. Indicates the reason code for a configuration failure.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * Output only. Indicates the reason code for a configuration failure.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the reason code for a configuration failure.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError.Code getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanConfigError.Code result = + com.google.cloud.websecurityscanner.v1.ScanConfigError.Code.valueOf(code_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanConfigError.Code.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Indicates the reason code for a configuration failure.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.cloud.websecurityscanner.v1.ScanConfigError.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the reason code for a configuration failure.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private java.lang.Object fieldName_ = ""; + /** + * + * + *
+     * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+     * for example "scan_config.max_qps". This field is provided for
+     * troubleshooting purposes only and its actual value can change in the
+     * future.
+     * 
+ * + * string field_name = 2; + * + * @return The fieldName. + */ + public java.lang.String getFieldName() { + java.lang.Object ref = fieldName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fieldName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+     * for example "scan_config.max_qps". This field is provided for
+     * troubleshooting purposes only and its actual value can change in the
+     * future.
+     * 
+ * + * string field_name = 2; + * + * @return The bytes for fieldName. + */ + public com.google.protobuf.ByteString getFieldNameBytes() { + java.lang.Object ref = fieldName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + fieldName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+     * for example "scan_config.max_qps". This field is provided for
+     * troubleshooting purposes only and its actual value can change in the
+     * future.
+     * 
+ * + * string field_name = 2; + * + * @param value The fieldName to set. + * @return This builder for chaining. + */ + public Builder setFieldName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fieldName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+     * for example "scan_config.max_qps". This field is provided for
+     * troubleshooting purposes only and its actual value can change in the
+     * future.
+     * 
+ * + * string field_name = 2; + * + * @return This builder for chaining. + */ + public Builder clearFieldName() { + + fieldName_ = getDefaultInstance().getFieldName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+     * for example "scan_config.max_qps". This field is provided for
+     * troubleshooting purposes only and its actual value can change in the
+     * future.
+     * 
+ * + * string field_name = 2; + * + * @param value The bytes for fieldName to set. + * @return This builder for chaining. + */ + public Builder setFieldNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fieldName_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanConfigError) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanConfigError) + private static final com.google.cloud.websecurityscanner.v1.ScanConfigError DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanConfigError(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanConfigError getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScanConfigError parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScanConfigError(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigErrorOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigErrorOrBuilder.java new file mode 100644 index 00000000..68b82547 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigErrorOrBuilder.java @@ -0,0 +1,81 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_config_error.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ScanConfigErrorOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfigError) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Indicates the reason code for a configuration failure.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * Output only. Indicates the reason code for a configuration failure.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError.Code code = 1; + * + * @return The code. + */ + com.google.cloud.websecurityscanner.v1.ScanConfigError.Code getCode(); + + /** + * + * + *
+   * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+   * for example "scan_config.max_qps". This field is provided for
+   * troubleshooting purposes only and its actual value can change in the
+   * future.
+   * 
+ * + * string field_name = 2; + * + * @return The fieldName. + */ + java.lang.String getFieldName(); + /** + * + * + *
+   * Output only. Indicates the full name of the ScanConfig field that triggers this error,
+   * for example "scan_config.max_qps". This field is provided for
+   * troubleshooting purposes only and its actual value can change in the
+   * future.
+   * 
+ * + * string field_name = 2; + * + * @return The bytes for fieldName. + */ + com.google.protobuf.ByteString getFieldNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigErrorProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigErrorProto.java new file mode 100644 index 00000000..f417204b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigErrorProto.java @@ -0,0 +1,103 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_config_error.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class ScanConfigErrorProto { + private ScanConfigErrorProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n:google/cloud/websecurityscanner/v1/sca" + + "n_config_error.proto\022\"google.cloud.webse" + + "curityscanner.v1\"\351\013\n\017ScanConfigError\022F\n\004" + + "code\030\001 \001(\01628.google.cloud.websecuritysca" + + "nner.v1.ScanConfigError.Code\022\022\n\nfield_na" + + "me\030\002 \001(\t\"\371\n\n\004Code\022\024\n\020CODE_UNSPECIFIED\020\000\022" + + "\006\n\002OK\020\000\022\022\n\016INTERNAL_ERROR\020\001\022\037\n\033APPENGINE" + + "_API_BACKEND_ERROR\020\002\022 \n\034APPENGINE_API_NO" + + "T_ACCESSIBLE\020\003\022\"\n\036APPENGINE_DEFAULT_HOST" + + "_MISSING\020\004\022!\n\035CANNOT_USE_GOOGLE_COM_ACCO" + + "UNT\020\006\022\034\n\030CANNOT_USE_OWNER_ACCOUNT\020\007\022\035\n\031C" + + "OMPUTE_API_BACKEND_ERROR\020\010\022\036\n\032COMPUTE_AP" + + "I_NOT_ACCESSIBLE\020\t\0227\n3CUSTOM_LOGIN_URL_D" + + "OES_NOT_BELONG_TO_CURRENT_PROJECT\020\n\022\036\n\032C" + + "USTOM_LOGIN_URL_MALFORMED\020\013\0223\n/CUSTOM_LO" + + "GIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\020\014" + + "\0221\n-CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVE" + + "D_ADDRESS\020\r\0220\n,CUSTOM_LOGIN_URL_HAS_NON_" + + "ROUTABLE_IP_ADDRESS\020\016\022.\n*CUSTOM_LOGIN_UR" + + "L_HAS_UNRESERVED_IP_ADDRESS\020\017\022\027\n\023DUPLICA" + + "TE_SCAN_NAME\020\020\022\027\n\023INVALID_FIELD_VALUE\020\022\022" + + "$\n FAILED_TO_AUTHENTICATE_TO_TARGET\020\023\022\034\n" + + "\030FINDING_TYPE_UNSPECIFIED\020\024\022\035\n\031FORBIDDEN" + + "_TO_SCAN_COMPUTE\020\025\022$\n FORBIDDEN_UPDATE_T" + + "O_MANAGED_SCAN\020+\022\024\n\020MALFORMED_FILTER\020\026\022\033" + + "\n\027MALFORMED_RESOURCE_NAME\020\027\022\024\n\020PROJECT_I" + + "NACTIVE\020\030\022\022\n\016REQUIRED_FIELD\020\031\022\036\n\032RESOURC" + + "E_NAME_INCONSISTENT\020\032\022\030\n\024SCAN_ALREADY_RU" + + "NNING\020\033\022\024\n\020SCAN_NOT_RUNNING\020\034\022/\n+SEED_UR" + + "L_DOES_NOT_BELONG_TO_CURRENT_PROJECT\020\035\022\026" + + "\n\022SEED_URL_MALFORMED\020\036\022+\n\'SEED_URL_MAPPE" + + "D_TO_NON_ROUTABLE_ADDRESS\020\037\022)\n%SEED_URL_" + + "MAPPED_TO_UNRESERVED_ADDRESS\020 \022(\n$SEED_U" + + "RL_HAS_NON_ROUTABLE_IP_ADDRESS\020!\022&\n\"SEED" + + "_URL_HAS_UNRESERVED_IP_ADDRESS\020#\022\"\n\036SERV" + + "ICE_ACCOUNT_NOT_CONFIGURED\020$\022\022\n\016TOO_MANY" + + "_SCANS\020%\022\"\n\036UNABLE_TO_RESOLVE_PROJECT_IN" + + "FO\020&\022(\n$UNSUPPORTED_BLACKLIST_PATTERN_FO" + + "RMAT\020\'\022\026\n\022UNSUPPORTED_FILTER\020(\022\034\n\030UNSUPP" + + "ORTED_FINDING_TYPE\020)\022\032\n\026UNSUPPORTED_URL_" + + "SCHEME\020*\032\002\020\001B\226\001\n&com.google.cloud.websec" + + "urityscanner.v1B\024ScanConfigErrorProtoP\001Z" + + "Tgoogle.golang.org/genproto/googleapis/c" + + "loud/websecurityscanner/v1;websecuritysc" + + "annerb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfigError_descriptor, + new java.lang.String[] { + "Code", "FieldName", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigOrBuilder.java new file mode 100644 index 00000000..32718b4f --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigOrBuilder.java @@ -0,0 +1,385 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_config.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ScanConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name of the ScanConfig. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+   * generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name of the ScanConfig. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are
+   * generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Required. The user provided display name of the ScanConfig.
+   * 
+ * + * string display_name = 2; + * + * @return The displayName. + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Required. The user provided display name of the ScanConfig.
+   * 
+ * + * string display_name = 2; + * + * @return The bytes for displayName. + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * The maximum QPS during scanning. A valid value ranges from 5 to 20
+   * inclusively. If the field is unspecified or its value is set 0, server will
+   * default to 15. Other values outside of [5, 20] range will be rejected with
+   * INVALID_ARGUMENT error.
+   * 
+ * + * int32 max_qps = 3; + * + * @return The maxQps. + */ + int getMaxQps(); + + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @return A list containing the startingUrls. + */ + java.util.List getStartingUrlsList(); + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @return The count of startingUrls. + */ + int getStartingUrlsCount(); + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index of the element to return. + * @return The startingUrls at the given index. + */ + java.lang.String getStartingUrls(int index); + /** + * + * + *
+   * Required. The starting URLs from which the scanner finds site pages.
+   * 
+ * + * repeated string starting_urls = 4; + * + * @param index The index of the value to return. + * @return The bytes of the startingUrls at the given index. + */ + com.google.protobuf.ByteString getStartingUrlsBytes(int index); + + /** + * + * + *
+   * The authentication configuration. If specified, service will use the
+   * authentication configuration during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + * @return Whether the authentication field is set. + */ + boolean hasAuthentication(); + /** + * + * + *
+   * The authentication configuration. If specified, service will use the
+   * authentication configuration during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + * + * @return The authentication. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Authentication getAuthentication(); + /** + * + * + *
+   * The authentication configuration. If specified, service will use the
+   * authentication configuration during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Authentication authentication = 5; + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.AuthenticationOrBuilder + getAuthenticationOrBuilder(); + + /** + * + * + *
+   * The user agent used during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return The enum numeric value on the wire for userAgent. + */ + int getUserAgentValue(); + /** + * + * + *
+   * The user agent used during scanning.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.UserAgent user_agent = 6; + * + * @return The userAgent. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent getUserAgent(); + + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return A list containing the blacklistPatterns. + */ + java.util.List getBlacklistPatternsList(); + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @return The count of blacklistPatterns. + */ + int getBlacklistPatternsCount(); + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index of the element to return. + * @return The blacklistPatterns at the given index. + */ + java.lang.String getBlacklistPatterns(int index); + /** + * + * + *
+   * The excluded URL patterns as described in
+   * https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls
+   * 
+ * + * repeated string blacklist_patterns = 7; + * + * @param index The index of the value to return. + * @return The bytes of the blacklistPatterns at the given index. + */ + com.google.protobuf.ByteString getBlacklistPatternsBytes(int index); + + /** + * + * + *
+   * The schedule of the ScanConfig.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + * + * @return Whether the schedule field is set. + */ + boolean hasSchedule(); + /** + * + * + *
+   * The schedule of the ScanConfig.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + * + * @return The schedule. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.Schedule getSchedule(); + /** + * + * + *
+   * The schedule of the ScanConfig.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.Schedule schedule = 8; + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.ScheduleOrBuilder getScheduleOrBuilder(); + + /** + * + * + *
+   * Controls export of scan configurations and results to Security
+   * Command Center.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return The enum numeric value on the wire for exportToSecurityCommandCenter. + */ + int getExportToSecurityCommandCenterValue(); + /** + * + * + *
+   * Controls export of scan configurations and results to Security
+   * Command Center.
+   * 
+ * + * + * .google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter export_to_security_command_center = 10; + * + * + * @return The exportToSecurityCommandCenter. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter + getExportToSecurityCommandCenter(); + + /** + * + * + *
+   * The risk level selected for the scan
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return The enum numeric value on the wire for riskLevel. + */ + int getRiskLevelValue(); + /** + * + * + *
+   * The risk level selected for the scan
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel risk_level = 12; + * + * @return The riskLevel. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel getRiskLevel(); + + /** + * + * + *
+   * Whether the scan config is managed by Web Security Scanner, output
+   * only.
+   * 
+ * + * bool managed_scan = 13; + * + * @return The managedScan. + */ + boolean getManagedScan(); + + /** + * + * + *
+   * Whether the scan configuration has enabled static IP address scan feature.
+   * If enabled, the scanner will access applications from static IP addresses.
+   * 
+ * + * bool static_ip_scan = 14; + * + * @return The staticIpScan. + */ + boolean getStaticIpScan(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigProto.java new file mode 100644 index 00000000..43d02866 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanConfigProto.java @@ -0,0 +1,215 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_config.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class ScanConfigProto { + private ScanConfigProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n4google/cloud/websecurityscanner/v1/sca" + + "n_config.proto\022\"google.cloud.websecurity" + + "scanner.v1\032\037google/api/field_behavior.pr" + + "oto\032\037google/protobuf/timestamp.proto\"\231\r\n" + + "\nScanConfig\022\014\n\004name\030\001 \001(\t\022\024\n\014display_nam" + + "e\030\002 \001(\t\022\017\n\007max_qps\030\003 \001(\005\022\025\n\rstarting_url" + + "s\030\004 \003(\t\022U\n\016authentication\030\005 \001(\0132=.google" + + ".cloud.websecurityscanner.v1.ScanConfig." + + "Authentication\022L\n\nuser_agent\030\006 \001(\01628.goo" + + "gle.cloud.websecurityscanner.v1.ScanConf" + + "ig.UserAgent\022\032\n\022blacklist_patterns\030\007 \003(\t" + + "\022I\n\010schedule\030\010 \001(\01327.google.cloud.websec" + + "urityscanner.v1.ScanConfig.Schedule\022w\n!e" + + "xport_to_security_command_center\030\n \001(\0162L" + + ".google.cloud.websecurityscanner.v1.Scan" + + "Config.ExportToSecurityCommandCenter\022L\n\n" + + "risk_level\030\014 \001(\01628.google.cloud.websecur" + + "ityscanner.v1.ScanConfig.RiskLevel\022\024\n\014ma" + + "naged_scan\030\r \001(\010\022\026\n\016static_ip_scan\030\016 \001(\010" + + "\032\317\005\n\016Authentication\022e\n\016google_account\030\001 " + + "\001(\0132K.google.cloud.websecurityscanner.v1" + + ".ScanConfig.Authentication.GoogleAccount" + + "H\000\022e\n\016custom_account\030\002 \001(\0132K.google.clou" + + "d.websecurityscanner.v1.ScanConfig.Authe" + + "ntication.CustomAccountH\000\022e\n\016iap_credent" + + "ial\030\004 \001(\0132K.google.cloud.websecurityscan" + + "ner.v1.ScanConfig.Authentication.IapCred" + + "entialH\000\0323\n\rGoogleAccount\022\020\n\010username\030\001 " + + "\001(\t\022\020\n\010password\030\002 \001(\t\032F\n\rCustomAccount\022\020" + + "\n\010username\030\001 \001(\t\022\020\n\010password\030\002 \001(\t\022\021\n\tlo" + + "gin_url\030\003 \001(\t\032\370\001\n\rIapCredential\022\216\001\n\035iap_" + + "test_service_account_info\030\001 \001(\0132e.google" + + ".cloud.websecurityscanner.v1.ScanConfig." + + "Authentication.IapCredential.IapTestServ" + + "iceAccountInfoH\000\032C\n\031IapTestServiceAccoun" + + "tInfo\022&\n\031target_audience_client_id\030\001 \001(\t" + + "B\003\340A\002B\021\n\017iap_credentialsB\020\n\016authenticati" + + "on\032]\n\010Schedule\0221\n\rschedule_time\030\001 \001(\0132\032." + + "google.protobuf.Timestamp\022\036\n\026interval_du" + + "ration_days\030\002 \001(\005\"`\n\tUserAgent\022\032\n\026USER_A" + + "GENT_UNSPECIFIED\020\000\022\020\n\014CHROME_LINUX\020\001\022\022\n\016" + + "CHROME_ANDROID\020\002\022\021\n\rSAFARI_IPHONE\020\003\"<\n\tR" + + "iskLevel\022\032\n\026RISK_LEVEL_UNSPECIFIED\020\000\022\n\n\006" + + "NORMAL\020\001\022\007\n\003LOW\020\002\"m\n\035ExportToSecurityCom" + + "mandCenter\0221\n-EXPORT_TO_SECURITY_COMMAND" + + "_CENTER_UNSPECIFIED\020\000\022\013\n\007ENABLED\020\001\022\014\n\010DI" + + "SABLED\020\002B\221\001\n&com.google.cloud.websecurit" + + "yscanner.v1B\017ScanConfigProtoP\001ZTgoogle.g" + + "olang.org/genproto/googleapis/cloud/webs" + + "ecurityscanner/v1;websecurityscannerb\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "MaxQps", + "StartingUrls", + "Authentication", + "UserAgent", + "BlacklistPatterns", + "Schedule", + "ExportToSecurityCommandCenter", + "RiskLevel", + "ManagedScan", + "StaticIpScan", + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor = + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor, + new java.lang.String[] { + "GoogleAccount", "CustomAccount", "IapCredential", "Authentication", + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_descriptor = + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_GoogleAccount_descriptor, + new java.lang.String[] { + "Username", "Password", + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_descriptor = + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_CustomAccount_descriptor, + new java.lang.String[] { + "Username", "Password", "LoginUrl", + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor = + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_descriptor + .getNestedTypes() + .get(2); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor, + new java.lang.String[] { + "IapTestServiceAccountInfo", "IapCredentials", + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_descriptor = + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Authentication_IapCredential_IapTestServiceAccountInfo_descriptor, + new java.lang.String[] { + "TargetAudienceClientId", + }); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_descriptor = + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanConfig_Schedule_descriptor, + new java.lang.String[] { + "ScheduleTime", "IntervalDurationDays", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRun.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRun.java new file mode 100644 index 00000000..d0bf9d30 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRun.java @@ -0,0 +1,3108 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * A ScanRun is a output-only resource representing an actual run of the scan.
+ * Next id: 12
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanRun} + */ +public final class ScanRun extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanRun) + ScanRunOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScanRun.newBuilder() to construct. + private ScanRun(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScanRun() { + name_ = ""; + executionState_ = 0; + resultState_ = 0; + warningTraces_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScanRun(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScanRun( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + executionState_ = rawValue; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + resultState_ = rawValue; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 48: + { + urlsCrawledCount_ = input.readInt64(); + break; + } + case 56: + { + urlsTestedCount_ = input.readInt64(); + break; + } + case 64: + { + hasVulnerabilities_ = input.readBool(); + break; + } + case 72: + { + progressPercent_ = input.readInt32(); + break; + } + case 82: + { + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder subBuilder = null; + if (errorTrace_ != null) { + subBuilder = errorTrace_.toBuilder(); + } + errorTrace_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(errorTrace_); + errorTrace_ = subBuilder.buildPartial(); + } + + break; + } + case 90: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + warningTraces_ = + new java.util.ArrayList< + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace>(); + mutable_bitField0_ |= 0x00000001; + } + warningTraces_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + warningTraces_ = java.util.Collections.unmodifiableList(warningTraces_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanRunProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanRun.class, + com.google.cloud.websecurityscanner.v1.ScanRun.Builder.class); + } + + /** + * + * + *
+   * Types of ScanRun execution state.
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanRun.ExecutionState} + */ + public enum ExecutionState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Represents an invalid state caused by internal server error. This value
+     * should never be returned.
+     * 
+ * + * EXECUTION_STATE_UNSPECIFIED = 0; + */ + EXECUTION_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The scan is waiting in the queue.
+     * 
+ * + * QUEUED = 1; + */ + QUEUED(1), + /** + * + * + *
+     * The scan is in progress.
+     * 
+ * + * SCANNING = 2; + */ + SCANNING(2), + /** + * + * + *
+     * The scan is either finished or stopped by user.
+     * 
+ * + * FINISHED = 3; + */ + FINISHED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Represents an invalid state caused by internal server error. This value
+     * should never be returned.
+     * 
+ * + * EXECUTION_STATE_UNSPECIFIED = 0; + */ + public static final int EXECUTION_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The scan is waiting in the queue.
+     * 
+ * + * QUEUED = 1; + */ + public static final int QUEUED_VALUE = 1; + /** + * + * + *
+     * The scan is in progress.
+     * 
+ * + * SCANNING = 2; + */ + public static final int SCANNING_VALUE = 2; + /** + * + * + *
+     * The scan is either finished or stopped by user.
+     * 
+ * + * FINISHED = 3; + */ + public static final int FINISHED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ExecutionState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ExecutionState forNumber(int value) { + switch (value) { + case 0: + return EXECUTION_STATE_UNSPECIFIED; + case 1: + return QUEUED; + case 2: + return SCANNING; + case 3: + return FINISHED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ExecutionState findValueByNumber(int number) { + return ExecutionState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRun.getDescriptor().getEnumTypes().get(0); + } + + private static final ExecutionState[] VALUES = values(); + + public static ExecutionState valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ExecutionState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanRun.ExecutionState) + } + + /** + * + * + *
+   * Types of ScanRun result state.
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanRun.ResultState} + */ + public enum ResultState implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value. This value is returned when the ScanRun is not yet
+     * finished.
+     * 
+ * + * RESULT_STATE_UNSPECIFIED = 0; + */ + RESULT_STATE_UNSPECIFIED(0), + /** + * + * + *
+     * The scan finished without errors.
+     * 
+ * + * SUCCESS = 1; + */ + SUCCESS(1), + /** + * + * + *
+     * The scan finished with errors.
+     * 
+ * + * ERROR = 2; + */ + ERROR(2), + /** + * + * + *
+     * The scan was terminated by user.
+     * 
+ * + * KILLED = 3; + */ + KILLED(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value. This value is returned when the ScanRun is not yet
+     * finished.
+     * 
+ * + * RESULT_STATE_UNSPECIFIED = 0; + */ + public static final int RESULT_STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The scan finished without errors.
+     * 
+ * + * SUCCESS = 1; + */ + public static final int SUCCESS_VALUE = 1; + /** + * + * + *
+     * The scan finished with errors.
+     * 
+ * + * ERROR = 2; + */ + public static final int ERROR_VALUE = 2; + /** + * + * + *
+     * The scan was terminated by user.
+     * 
+ * + * KILLED = 3; + */ + public static final int KILLED_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResultState valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ResultState forNumber(int value) { + switch (value) { + case 0: + return RESULT_STATE_UNSPECIFIED; + case 1: + return SUCCESS; + case 2: + return ERROR; + case 3: + return KILLED; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ResultState findValueByNumber(int number) { + return ResultState.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRun.getDescriptor().getEnumTypes().get(1); + } + + private static final ResultState[] VALUES = values(); + + public static ResultState valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ResultState(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanRun.ResultState) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name of the ScanRun. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * The ScanRun IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name of the ScanRun. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * The ScanRun IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXECUTION_STATE_FIELD_NUMBER = 2; + private int executionState_; + /** + * + * + *
+   * Output only. The execution state of the ScanRun.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return The enum numeric value on the wire for executionState. + */ + @java.lang.Override + public int getExecutionStateValue() { + return executionState_; + } + /** + * + * + *
+   * Output only. The execution state of the ScanRun.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return The executionState. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState getExecutionState() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState result = + com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState.valueOf(executionState_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState.UNRECOGNIZED + : result; + } + + public static final int RESULT_STATE_FIELD_NUMBER = 3; + private int resultState_; + /** + * + * + *
+   * Output only. The result state of the ScanRun. This field is only available after the
+   * execution state reaches "FINISHED".
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return The enum numeric value on the wire for resultState. + */ + @java.lang.Override + public int getResultStateValue() { + return resultState_; + } + /** + * + * + *
+   * Output only. The result state of the ScanRun. This field is only available after the
+   * execution state reaches "FINISHED".
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return The resultState. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun.ResultState getResultState() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRun.ResultState result = + com.google.cloud.websecurityscanner.v1.ScanRun.ResultState.valueOf(resultState_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRun.ResultState.UNRECOGNIZED + : result; + } + + public static final int START_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp startTime_; + /** + * + * + *
+   * Output only. The time at which the ScanRun started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + @java.lang.Override + public boolean hasStartTime() { + return startTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which the ScanRun started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + * + * + *
+   * Output only. The time at which the ScanRun started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp endTime_; + /** + * + * + *
+   * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+   * is either finished or stopped by user.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + @java.lang.Override + public boolean hasEndTime() { + return endTime_ != null; + } + /** + * + * + *
+   * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+   * is either finished or stopped by user.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + * + * + *
+   * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+   * is either finished or stopped by user.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int URLS_CRAWLED_COUNT_FIELD_NUMBER = 6; + private long urlsCrawledCount_; + /** + * + * + *
+   * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress,
+   * the value represents the number of URLs crawled up to now.
+   * 
+ * + * int64 urls_crawled_count = 6; + * + * @return The urlsCrawledCount. + */ + @java.lang.Override + public long getUrlsCrawledCount() { + return urlsCrawledCount_; + } + + public static final int URLS_TESTED_COUNT_FIELD_NUMBER = 7; + private long urlsTestedCount_; + /** + * + * + *
+   * Output only. The number of URLs tested during this ScanRun. If the scan is in progress,
+   * the value represents the number of URLs tested up to now. The number of
+   * URLs tested is usually larger than the number URLS crawled because
+   * typically a crawled URL is tested with multiple test payloads.
+   * 
+ * + * int64 urls_tested_count = 7; + * + * @return The urlsTestedCount. + */ + @java.lang.Override + public long getUrlsTestedCount() { + return urlsTestedCount_; + } + + public static final int HAS_VULNERABILITIES_FIELD_NUMBER = 8; + private boolean hasVulnerabilities_; + /** + * + * + *
+   * Output only. Whether the scan run has found any vulnerabilities.
+   * 
+ * + * bool has_vulnerabilities = 8; + * + * @return The hasVulnerabilities. + */ + @java.lang.Override + public boolean getHasVulnerabilities() { + return hasVulnerabilities_; + } + + public static final int PROGRESS_PERCENT_FIELD_NUMBER = 9; + private int progressPercent_; + /** + * + * + *
+   * Output only. The percentage of total completion ranging from 0 to 100.
+   * If the scan is in queue, the value is 0.
+   * If the scan is running, the value ranges from 0 to 100.
+   * If the scan is finished, the value is 100.
+   * 
+ * + * int32 progress_percent = 9; + * + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + + public static final int ERROR_TRACE_FIELD_NUMBER = 10; + private com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace errorTrace_; + /** + * + * + *
+   * Output only. If result_state is an ERROR, this field provides the primary reason for
+   * scan's termination and more details, if such are available.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + * + * @return Whether the errorTrace field is set. + */ + @java.lang.Override + public boolean hasErrorTrace() { + return errorTrace_ != null; + } + /** + * + * + *
+   * Output only. If result_state is an ERROR, this field provides the primary reason for
+   * scan's termination and more details, if such are available.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + * + * @return The errorTrace. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace getErrorTrace() { + return errorTrace_ == null + ? com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.getDefaultInstance() + : errorTrace_; + } + /** + * + * + *
+   * Output only. If result_state is an ERROR, this field provides the primary reason for
+   * scan's termination and more details, if such are available.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder + getErrorTraceOrBuilder() { + return getErrorTrace(); + } + + public static final int WARNING_TRACES_FIELD_NUMBER = 11; + private java.util.List warningTraces_; + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + @java.lang.Override + public java.util.List + getWarningTracesList() { + return warningTraces_; + } + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder> + getWarningTracesOrBuilderList() { + return warningTraces_; + } + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + @java.lang.Override + public int getWarningTracesCount() { + return warningTraces_.size(); + } + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace getWarningTraces(int index) { + return warningTraces_.get(index); + } + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder + getWarningTracesOrBuilder(int index) { + return warningTraces_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (executionState_ + != com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState.EXECUTION_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, executionState_); + } + if (resultState_ + != com.google.cloud.websecurityscanner.v1.ScanRun.ResultState.RESULT_STATE_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, resultState_); + } + if (startTime_ != null) { + output.writeMessage(4, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(5, getEndTime()); + } + if (urlsCrawledCount_ != 0L) { + output.writeInt64(6, urlsCrawledCount_); + } + if (urlsTestedCount_ != 0L) { + output.writeInt64(7, urlsTestedCount_); + } + if (hasVulnerabilities_ != false) { + output.writeBool(8, hasVulnerabilities_); + } + if (progressPercent_ != 0) { + output.writeInt32(9, progressPercent_); + } + if (errorTrace_ != null) { + output.writeMessage(10, getErrorTrace()); + } + for (int i = 0; i < warningTraces_.size(); i++) { + output.writeMessage(11, warningTraces_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (executionState_ + != com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState.EXECUTION_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, executionState_); + } + if (resultState_ + != com.google.cloud.websecurityscanner.v1.ScanRun.ResultState.RESULT_STATE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, resultState_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getEndTime()); + } + if (urlsCrawledCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(6, urlsCrawledCount_); + } + if (urlsTestedCount_ != 0L) { + size += com.google.protobuf.CodedOutputStream.computeInt64Size(7, urlsTestedCount_); + } + if (hasVulnerabilities_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(8, hasVulnerabilities_); + } + if (progressPercent_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(9, progressPercent_); + } + if (errorTrace_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(10, getErrorTrace()); + } + for (int i = 0; i < warningTraces_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, warningTraces_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanRun)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanRun other = + (com.google.cloud.websecurityscanner.v1.ScanRun) obj; + + if (!getName().equals(other.getName())) return false; + if (executionState_ != other.executionState_) return false; + if (resultState_ != other.resultState_) return false; + if (hasStartTime() != other.hasStartTime()) return false; + if (hasStartTime()) { + if (!getStartTime().equals(other.getStartTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (getUrlsCrawledCount() != other.getUrlsCrawledCount()) return false; + if (getUrlsTestedCount() != other.getUrlsTestedCount()) return false; + if (getHasVulnerabilities() != other.getHasVulnerabilities()) return false; + if (getProgressPercent() != other.getProgressPercent()) return false; + if (hasErrorTrace() != other.hasErrorTrace()) return false; + if (hasErrorTrace()) { + if (!getErrorTrace().equals(other.getErrorTrace())) return false; + } + if (!getWarningTracesList().equals(other.getWarningTracesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + EXECUTION_STATE_FIELD_NUMBER; + hash = (53 * hash) + executionState_; + hash = (37 * hash) + RESULT_STATE_FIELD_NUMBER; + hash = (53 * hash) + resultState_; + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + hash = (37 * hash) + URLS_CRAWLED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUrlsCrawledCount()); + hash = (37 * hash) + URLS_TESTED_COUNT_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getUrlsTestedCount()); + hash = (37 * hash) + HAS_VULNERABILITIES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getHasVulnerabilities()); + hash = (37 * hash) + PROGRESS_PERCENT_FIELD_NUMBER; + hash = (53 * hash) + getProgressPercent(); + if (hasErrorTrace()) { + hash = (37 * hash) + ERROR_TRACE_FIELD_NUMBER; + hash = (53 * hash) + getErrorTrace().hashCode(); + } + if (getWarningTracesCount() > 0) { + hash = (37 * hash) + WARNING_TRACES_FIELD_NUMBER; + hash = (53 * hash) + getWarningTracesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.websecurityscanner.v1.ScanRun prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A ScanRun is a output-only resource representing an actual run of the scan.
+   * Next id: 12
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanRun} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanRun) + com.google.cloud.websecurityscanner.v1.ScanRunOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRun_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanRunProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRun_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanRun.class, + com.google.cloud.websecurityscanner.v1.ScanRun.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ScanRun.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getWarningTracesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + executionState_ = 0; + + resultState_ = 0; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + urlsCrawledCount_ = 0L; + + urlsTestedCount_ = 0L; + + hasVulnerabilities_ = false; + + progressPercent_ = 0; + + if (errorTraceBuilder_ == null) { + errorTrace_ = null; + } else { + errorTrace_ = null; + errorTraceBuilder_ = null; + } + if (warningTracesBuilder_ == null) { + warningTraces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + warningTracesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanRunProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRun_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun build() { + com.google.cloud.websecurityscanner.v1.ScanRun result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanRun result = + new com.google.cloud.websecurityscanner.v1.ScanRun(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.executionState_ = executionState_; + result.resultState_ = resultState_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + result.urlsCrawledCount_ = urlsCrawledCount_; + result.urlsTestedCount_ = urlsTestedCount_; + result.hasVulnerabilities_ = hasVulnerabilities_; + result.progressPercent_ = progressPercent_; + if (errorTraceBuilder_ == null) { + result.errorTrace_ = errorTrace_; + } else { + result.errorTrace_ = errorTraceBuilder_.build(); + } + if (warningTracesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + warningTraces_ = java.util.Collections.unmodifiableList(warningTraces_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.warningTraces_ = warningTraces_; + } else { + result.warningTraces_ = warningTracesBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanRun) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ScanRun) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ScanRun other) { + if (other == com.google.cloud.websecurityscanner.v1.ScanRun.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.executionState_ != 0) { + setExecutionStateValue(other.getExecutionStateValue()); + } + if (other.resultState_ != 0) { + setResultStateValue(other.getResultStateValue()); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.getUrlsCrawledCount() != 0L) { + setUrlsCrawledCount(other.getUrlsCrawledCount()); + } + if (other.getUrlsTestedCount() != 0L) { + setUrlsTestedCount(other.getUrlsTestedCount()); + } + if (other.getHasVulnerabilities() != false) { + setHasVulnerabilities(other.getHasVulnerabilities()); + } + if (other.getProgressPercent() != 0) { + setProgressPercent(other.getProgressPercent()); + } + if (other.hasErrorTrace()) { + mergeErrorTrace(other.getErrorTrace()); + } + if (warningTracesBuilder_ == null) { + if (!other.warningTraces_.isEmpty()) { + if (warningTraces_.isEmpty()) { + warningTraces_ = other.warningTraces_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureWarningTracesIsMutable(); + warningTraces_.addAll(other.warningTraces_); + } + onChanged(); + } + } else { + if (!other.warningTraces_.isEmpty()) { + if (warningTracesBuilder_.isEmpty()) { + warningTracesBuilder_.dispose(); + warningTracesBuilder_ = null; + warningTraces_ = other.warningTraces_; + bitField0_ = (bitField0_ & ~0x00000001); + warningTracesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getWarningTracesFieldBuilder() + : null; + } else { + warningTracesBuilder_.addAllMessages(other.warningTraces_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanRun parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.websecurityscanner.v1.ScanRun) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name of the ScanRun. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * The ScanRun IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the ScanRun. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * The ScanRun IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name of the ScanRun. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * The ScanRun IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the ScanRun. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * The ScanRun IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name of the ScanRun. The name follows the format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * The ScanRun IDs are generated by the system.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int executionState_ = 0; + /** + * + * + *
+     * Output only. The execution state of the ScanRun.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return The enum numeric value on the wire for executionState. + */ + @java.lang.Override + public int getExecutionStateValue() { + return executionState_; + } + /** + * + * + *
+     * Output only. The execution state of the ScanRun.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @param value The enum numeric value on the wire for executionState to set. + * @return This builder for chaining. + */ + public Builder setExecutionStateValue(int value) { + + executionState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The execution state of the ScanRun.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return The executionState. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState getExecutionState() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState result = + com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState.valueOf(executionState_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The execution state of the ScanRun.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @param value The executionState to set. + * @return This builder for chaining. + */ + public Builder setExecutionState( + com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState value) { + if (value == null) { + throw new NullPointerException(); + } + + executionState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The execution state of the ScanRun.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return This builder for chaining. + */ + public Builder clearExecutionState() { + + executionState_ = 0; + onChanged(); + return this; + } + + private int resultState_ = 0; + /** + * + * + *
+     * Output only. The result state of the ScanRun. This field is only available after the
+     * execution state reaches "FINISHED".
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return The enum numeric value on the wire for resultState. + */ + @java.lang.Override + public int getResultStateValue() { + return resultState_; + } + /** + * + * + *
+     * Output only. The result state of the ScanRun. This field is only available after the
+     * execution state reaches "FINISHED".
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @param value The enum numeric value on the wire for resultState to set. + * @return This builder for chaining. + */ + public Builder setResultStateValue(int value) { + + resultState_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The result state of the ScanRun. This field is only available after the
+     * execution state reaches "FINISHED".
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return The resultState. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun.ResultState getResultState() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRun.ResultState result = + com.google.cloud.websecurityscanner.v1.ScanRun.ResultState.valueOf(resultState_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRun.ResultState.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The result state of the ScanRun. This field is only available after the
+     * execution state reaches "FINISHED".
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @param value The resultState to set. + * @return This builder for chaining. + */ + public Builder setResultState( + com.google.cloud.websecurityscanner.v1.ScanRun.ResultState value) { + if (value == null) { + throw new NullPointerException(); + } + + resultState_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The result state of the ScanRun. This field is only available after the
+     * execution state reaches "FINISHED".
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return This builder for chaining. + */ + public Builder clearResultState() { + + resultState_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + startTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder setStartTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + * + * + *
+     * Output only. The time at which the ScanRun started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getStartTime(), getParentForChildren(), isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + endTimeBuilder_; + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder setEndTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + * + * + *
+     * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+     * is either finished or stopped by user.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getEndTime(), getParentForChildren(), isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private long urlsCrawledCount_; + /** + * + * + *
+     * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress,
+     * the value represents the number of URLs crawled up to now.
+     * 
+ * + * int64 urls_crawled_count = 6; + * + * @return The urlsCrawledCount. + */ + @java.lang.Override + public long getUrlsCrawledCount() { + return urlsCrawledCount_; + } + /** + * + * + *
+     * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress,
+     * the value represents the number of URLs crawled up to now.
+     * 
+ * + * int64 urls_crawled_count = 6; + * + * @param value The urlsCrawledCount to set. + * @return This builder for chaining. + */ + public Builder setUrlsCrawledCount(long value) { + + urlsCrawledCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress,
+     * the value represents the number of URLs crawled up to now.
+     * 
+ * + * int64 urls_crawled_count = 6; + * + * @return This builder for chaining. + */ + public Builder clearUrlsCrawledCount() { + + urlsCrawledCount_ = 0L; + onChanged(); + return this; + } + + private long urlsTestedCount_; + /** + * + * + *
+     * Output only. The number of URLs tested during this ScanRun. If the scan is in progress,
+     * the value represents the number of URLs tested up to now. The number of
+     * URLs tested is usually larger than the number URLS crawled because
+     * typically a crawled URL is tested with multiple test payloads.
+     * 
+ * + * int64 urls_tested_count = 7; + * + * @return The urlsTestedCount. + */ + @java.lang.Override + public long getUrlsTestedCount() { + return urlsTestedCount_; + } + /** + * + * + *
+     * Output only. The number of URLs tested during this ScanRun. If the scan is in progress,
+     * the value represents the number of URLs tested up to now. The number of
+     * URLs tested is usually larger than the number URLS crawled because
+     * typically a crawled URL is tested with multiple test payloads.
+     * 
+ * + * int64 urls_tested_count = 7; + * + * @param value The urlsTestedCount to set. + * @return This builder for chaining. + */ + public Builder setUrlsTestedCount(long value) { + + urlsTestedCount_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The number of URLs tested during this ScanRun. If the scan is in progress,
+     * the value represents the number of URLs tested up to now. The number of
+     * URLs tested is usually larger than the number URLS crawled because
+     * typically a crawled URL is tested with multiple test payloads.
+     * 
+ * + * int64 urls_tested_count = 7; + * + * @return This builder for chaining. + */ + public Builder clearUrlsTestedCount() { + + urlsTestedCount_ = 0L; + onChanged(); + return this; + } + + private boolean hasVulnerabilities_; + /** + * + * + *
+     * Output only. Whether the scan run has found any vulnerabilities.
+     * 
+ * + * bool has_vulnerabilities = 8; + * + * @return The hasVulnerabilities. + */ + @java.lang.Override + public boolean getHasVulnerabilities() { + return hasVulnerabilities_; + } + /** + * + * + *
+     * Output only. Whether the scan run has found any vulnerabilities.
+     * 
+ * + * bool has_vulnerabilities = 8; + * + * @param value The hasVulnerabilities to set. + * @return This builder for chaining. + */ + public Builder setHasVulnerabilities(boolean value) { + + hasVulnerabilities_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Whether the scan run has found any vulnerabilities.
+     * 
+ * + * bool has_vulnerabilities = 8; + * + * @return This builder for chaining. + */ + public Builder clearHasVulnerabilities() { + + hasVulnerabilities_ = false; + onChanged(); + return this; + } + + private int progressPercent_; + /** + * + * + *
+     * Output only. The percentage of total completion ranging from 0 to 100.
+     * If the scan is in queue, the value is 0.
+     * If the scan is running, the value ranges from 0 to 100.
+     * If the scan is finished, the value is 100.
+     * 
+ * + * int32 progress_percent = 9; + * + * @return The progressPercent. + */ + @java.lang.Override + public int getProgressPercent() { + return progressPercent_; + } + /** + * + * + *
+     * Output only. The percentage of total completion ranging from 0 to 100.
+     * If the scan is in queue, the value is 0.
+     * If the scan is running, the value ranges from 0 to 100.
+     * If the scan is finished, the value is 100.
+     * 
+ * + * int32 progress_percent = 9; + * + * @param value The progressPercent to set. + * @return This builder for chaining. + */ + public Builder setProgressPercent(int value) { + + progressPercent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The percentage of total completion ranging from 0 to 100.
+     * If the scan is in queue, the value is 0.
+     * If the scan is running, the value ranges from 0 to 100.
+     * If the scan is finished, the value is 100.
+     * 
+ * + * int32 progress_percent = 9; + * + * @return This builder for chaining. + */ + public Builder clearProgressPercent() { + + progressPercent_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace errorTrace_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder> + errorTraceBuilder_; + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + * + * @return Whether the errorTrace field is set. + */ + public boolean hasErrorTrace() { + return errorTraceBuilder_ != null || errorTrace_ != null; + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + * + * @return The errorTrace. + */ + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace getErrorTrace() { + if (errorTraceBuilder_ == null) { + return errorTrace_ == null + ? com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.getDefaultInstance() + : errorTrace_; + } else { + return errorTraceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + public Builder setErrorTrace(com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace value) { + if (errorTraceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + errorTrace_ = value; + onChanged(); + } else { + errorTraceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + public Builder setErrorTrace( + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder builderForValue) { + if (errorTraceBuilder_ == null) { + errorTrace_ = builderForValue.build(); + onChanged(); + } else { + errorTraceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + public Builder mergeErrorTrace(com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace value) { + if (errorTraceBuilder_ == null) { + if (errorTrace_ != null) { + errorTrace_ = + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.newBuilder(errorTrace_) + .mergeFrom(value) + .buildPartial(); + } else { + errorTrace_ = value; + } + onChanged(); + } else { + errorTraceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + public Builder clearErrorTrace() { + if (errorTraceBuilder_ == null) { + errorTrace_ = null; + onChanged(); + } else { + errorTrace_ = null; + errorTraceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder getErrorTraceBuilder() { + + onChanged(); + return getErrorTraceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder + getErrorTraceOrBuilder() { + if (errorTraceBuilder_ != null) { + return errorTraceBuilder_.getMessageOrBuilder(); + } else { + return errorTrace_ == null + ? com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.getDefaultInstance() + : errorTrace_; + } + } + /** + * + * + *
+     * Output only. If result_state is an ERROR, this field provides the primary reason for
+     * scan's termination and more details, if such are available.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder> + getErrorTraceFieldBuilder() { + if (errorTraceBuilder_ == null) { + errorTraceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder>( + getErrorTrace(), getParentForChildren(), isClean()); + errorTrace_ = null; + } + return errorTraceBuilder_; + } + + private java.util.List + warningTraces_ = java.util.Collections.emptyList(); + + private void ensureWarningTracesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + warningTraces_ = + new java.util.ArrayList( + warningTraces_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder> + warningTracesBuilder_; + + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public java.util.List + getWarningTracesList() { + if (warningTracesBuilder_ == null) { + return java.util.Collections.unmodifiableList(warningTraces_); + } else { + return warningTracesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public int getWarningTracesCount() { + if (warningTracesBuilder_ == null) { + return warningTraces_.size(); + } else { + return warningTracesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace getWarningTraces(int index) { + if (warningTracesBuilder_ == null) { + return warningTraces_.get(index); + } else { + return warningTracesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder setWarningTraces( + int index, com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace value) { + if (warningTracesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningTracesIsMutable(); + warningTraces_.set(index, value); + onChanged(); + } else { + warningTracesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder setWarningTraces( + int index, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder builderForValue) { + if (warningTracesBuilder_ == null) { + ensureWarningTracesIsMutable(); + warningTraces_.set(index, builderForValue.build()); + onChanged(); + } else { + warningTracesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder addWarningTraces( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace value) { + if (warningTracesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningTracesIsMutable(); + warningTraces_.add(value); + onChanged(); + } else { + warningTracesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder addWarningTraces( + int index, com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace value) { + if (warningTracesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureWarningTracesIsMutable(); + warningTraces_.add(index, value); + onChanged(); + } else { + warningTracesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder addWarningTraces( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder builderForValue) { + if (warningTracesBuilder_ == null) { + ensureWarningTracesIsMutable(); + warningTraces_.add(builderForValue.build()); + onChanged(); + } else { + warningTracesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder addWarningTraces( + int index, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder builderForValue) { + if (warningTracesBuilder_ == null) { + ensureWarningTracesIsMutable(); + warningTraces_.add(index, builderForValue.build()); + onChanged(); + } else { + warningTracesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder addAllWarningTraces( + java.lang.Iterable + values) { + if (warningTracesBuilder_ == null) { + ensureWarningTracesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, warningTraces_); + onChanged(); + } else { + warningTracesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder clearWarningTraces() { + if (warningTracesBuilder_ == null) { + warningTraces_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + warningTracesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public Builder removeWarningTraces(int index) { + if (warningTracesBuilder_ == null) { + ensureWarningTracesIsMutable(); + warningTraces_.remove(index); + onChanged(); + } else { + warningTracesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder + getWarningTracesBuilder(int index) { + return getWarningTracesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder + getWarningTracesOrBuilder(int index) { + if (warningTracesBuilder_ == null) { + return warningTraces_.get(index); + } else { + return warningTracesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder> + getWarningTracesOrBuilderList() { + if (warningTracesBuilder_ != null) { + return warningTracesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(warningTraces_); + } + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder + addWarningTracesBuilder() { + return getWarningTracesFieldBuilder() + .addBuilder( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder + addWarningTracesBuilder(int index) { + return getWarningTracesFieldBuilder() + .addBuilder( + index, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. A list of warnings, if such are encountered during this scan run.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + public java.util.List + getWarningTracesBuilderList() { + return getWarningTracesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder> + getWarningTracesFieldBuilder() { + if (warningTracesBuilder_ == null) { + warningTracesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder>( + warningTraces_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + warningTraces_ = null; + } + return warningTracesBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanRun) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanRun) + private static final com.google.cloud.websecurityscanner.v1.ScanRun DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanRun(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRun getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScanRun parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScanRun(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRun getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTrace.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTrace.java new file mode 100644 index 00000000..2ce58675 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTrace.java @@ -0,0 +1,1283 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run_error_trace.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Output only.
+ * Defines an error trace message for a ScanRun.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanRunErrorTrace} + */ +public final class ScanRunErrorTrace extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanRunErrorTrace) + ScanRunErrorTraceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScanRunErrorTrace.newBuilder() to construct. + private ScanRunErrorTrace(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScanRunErrorTrace() { + code_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScanRunErrorTrace(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScanRunErrorTrace( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + code_ = rawValue; + break; + } + case 18: + { + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder subBuilder = null; + if (scanConfigError_ != null) { + subBuilder = scanConfigError_.toBuilder(); + } + scanConfigError_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfigError.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scanConfigError_); + scanConfigError_ = subBuilder.buildPartial(); + } + + break; + } + case 24: + { + mostCommonHttpErrorCode_ = input.readInt32(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.class, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder.class); + } + + /** + * + * + *
+   * Output only.
+   * Defines an error reason code.
+   * Next id: 7
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code} + */ + public enum Code implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value is never used.
+     * 
+ * + * CODE_UNSPECIFIED = 0; + */ + CODE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates that the scan run failed due to an internal server error.
+     * 
+ * + * INTERNAL_ERROR = 1; + */ + INTERNAL_ERROR(1), + /** + * + * + *
+     * Indicates a scan configuration error, usually due to outdated ScanConfig
+     * settings, such as starting_urls or the DNS configuration.
+     * 
+ * + * SCAN_CONFIG_ISSUE = 2; + */ + SCAN_CONFIG_ISSUE(2), + /** + * + * + *
+     * Indicates an authentication error, usually due to outdated ScanConfig
+     * authentication settings.
+     * 
+ * + * AUTHENTICATION_CONFIG_ISSUE = 3; + */ + AUTHENTICATION_CONFIG_ISSUE(3), + /** + * + * + *
+     * Indicates a scan operation timeout, usually caused by a very large site.
+     * 
+ * + * TIMED_OUT_WHILE_SCANNING = 4; + */ + TIMED_OUT_WHILE_SCANNING(4), + /** + * + * + *
+     * Indicates that a scan encountered excessive redirects, either to
+     * authentication or some other page outside of the scan scope.
+     * 
+ * + * TOO_MANY_REDIRECTS = 5; + */ + TOO_MANY_REDIRECTS(5), + /** + * + * + *
+     * Indicates that a scan encountered numerous errors from the web site
+     * pages. When available, most_common_http_error_code field indicates the
+     * most common HTTP error code encountered during the scan.
+     * 
+ * + * TOO_MANY_HTTP_ERRORS = 6; + */ + TOO_MANY_HTTP_ERRORS(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value is never used.
+     * 
+ * + * CODE_UNSPECIFIED = 0; + */ + public static final int CODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates that the scan run failed due to an internal server error.
+     * 
+ * + * INTERNAL_ERROR = 1; + */ + public static final int INTERNAL_ERROR_VALUE = 1; + /** + * + * + *
+     * Indicates a scan configuration error, usually due to outdated ScanConfig
+     * settings, such as starting_urls or the DNS configuration.
+     * 
+ * + * SCAN_CONFIG_ISSUE = 2; + */ + public static final int SCAN_CONFIG_ISSUE_VALUE = 2; + /** + * + * + *
+     * Indicates an authentication error, usually due to outdated ScanConfig
+     * authentication settings.
+     * 
+ * + * AUTHENTICATION_CONFIG_ISSUE = 3; + */ + public static final int AUTHENTICATION_CONFIG_ISSUE_VALUE = 3; + /** + * + * + *
+     * Indicates a scan operation timeout, usually caused by a very large site.
+     * 
+ * + * TIMED_OUT_WHILE_SCANNING = 4; + */ + public static final int TIMED_OUT_WHILE_SCANNING_VALUE = 4; + /** + * + * + *
+     * Indicates that a scan encountered excessive redirects, either to
+     * authentication or some other page outside of the scan scope.
+     * 
+ * + * TOO_MANY_REDIRECTS = 5; + */ + public static final int TOO_MANY_REDIRECTS_VALUE = 5; + /** + * + * + *
+     * Indicates that a scan encountered numerous errors from the web site
+     * pages. When available, most_common_http_error_code field indicates the
+     * most common HTTP error code encountered during the scan.
+     * 
+ * + * TOO_MANY_HTTP_ERRORS = 6; + */ + public static final int TOO_MANY_HTTP_ERRORS_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Code forNumber(int value) { + switch (value) { + case 0: + return CODE_UNSPECIFIED; + case 1: + return INTERNAL_ERROR; + case 2: + return SCAN_CONFIG_ISSUE; + case 3: + return AUTHENTICATION_CONFIG_ISSUE; + case 4: + return TIMED_OUT_WHILE_SCANNING; + case 5: + return TOO_MANY_REDIRECTS; + case 6: + return TOO_MANY_HTTP_ERRORS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Code[] VALUES = values(); + + public static Code valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * Output only. Indicates the error reason code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * Output only. Indicates the error reason code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code result = + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code.valueOf(code_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code.UNRECOGNIZED + : result; + } + + public static final int SCAN_CONFIG_ERROR_FIELD_NUMBER = 2; + private com.google.cloud.websecurityscanner.v1.ScanConfigError scanConfigError_; + /** + * + * + *
+   * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+   * message encountered during scan configuration validation that is performed
+   * before each scan run.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + * + * @return Whether the scanConfigError field is set. + */ + @java.lang.Override + public boolean hasScanConfigError() { + return scanConfigError_ != null; + } + /** + * + * + *
+   * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+   * message encountered during scan configuration validation that is performed
+   * before each scan run.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + * + * @return The scanConfigError. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigError getScanConfigError() { + return scanConfigError_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfigError.getDefaultInstance() + : scanConfigError_; + } + /** + * + * + *
+   * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+   * message encountered during scan configuration validation that is performed
+   * before each scan run.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder + getScanConfigErrorOrBuilder() { + return getScanConfigError(); + } + + public static final int MOST_COMMON_HTTP_ERROR_CODE_FIELD_NUMBER = 3; + private int mostCommonHttpErrorCode_; + /** + * + * + *
+   * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
+   * common HTTP error code, if such is available. For example, if this code is
+   * 404, the scan has encountered too many NOT_FOUND responses.
+   * 
+ * + * int32 most_common_http_error_code = 3; + * + * @return The mostCommonHttpErrorCode. + */ + @java.lang.Override + public int getMostCommonHttpErrorCode() { + return mostCommonHttpErrorCode_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ + != com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code.CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + if (scanConfigError_ != null) { + output.writeMessage(2, getScanConfigError()); + } + if (mostCommonHttpErrorCode_ != 0) { + output.writeInt32(3, mostCommonHttpErrorCode_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code.CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + if (scanConfigError_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getScanConfigError()); + } + if (mostCommonHttpErrorCode_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, mostCommonHttpErrorCode_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace other = + (com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace) obj; + + if (code_ != other.code_) return false; + if (hasScanConfigError() != other.hasScanConfigError()) return false; + if (hasScanConfigError()) { + if (!getScanConfigError().equals(other.getScanConfigError())) return false; + } + if (getMostCommonHttpErrorCode() != other.getMostCommonHttpErrorCode()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + if (hasScanConfigError()) { + hash = (37 * hash) + SCAN_CONFIG_ERROR_FIELD_NUMBER; + hash = (53 * hash) + getScanConfigError().hashCode(); + } + hash = (37 * hash) + MOST_COMMON_HTTP_ERROR_CODE_FIELD_NUMBER; + hash = (53 * hash) + getMostCommonHttpErrorCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Output only.
+   * Defines an error trace message for a ScanRun.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanRunErrorTrace} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanRunErrorTrace) + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.class, + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + if (scanConfigErrorBuilder_ == null) { + scanConfigError_ = null; + } else { + scanConfigError_ = null; + scanConfigErrorBuilder_ = null; + } + mostCommonHttpErrorCode_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace build() { + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace result = + new com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace(this); + result.code_ = code_; + if (scanConfigErrorBuilder_ == null) { + result.scanConfigError_ = scanConfigError_; + } else { + result.scanConfigError_ = scanConfigErrorBuilder_.build(); + } + result.mostCommonHttpErrorCode_ = mostCommonHttpErrorCode_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace other) { + if (other == com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.getDefaultInstance()) + return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + if (other.hasScanConfigError()) { + mergeScanConfigError(other.getScanConfigError()); + } + if (other.getMostCommonHttpErrorCode() != 0) { + setMostCommonHttpErrorCode(other.getMostCommonHttpErrorCode()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int code_ = 0; + /** + * + * + *
+     * Output only. Indicates the error reason code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * Output only. Indicates the error reason code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the error reason code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code result = + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code.valueOf(code_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Indicates the error reason code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the error reason code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.websecurityscanner.v1.ScanConfigError scanConfigError_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfigError, + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder> + scanConfigErrorBuilder_; + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + * + * @return Whether the scanConfigError field is set. + */ + public boolean hasScanConfigError() { + return scanConfigErrorBuilder_ != null || scanConfigError_ != null; + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + * + * @return The scanConfigError. + */ + public com.google.cloud.websecurityscanner.v1.ScanConfigError getScanConfigError() { + if (scanConfigErrorBuilder_ == null) { + return scanConfigError_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfigError.getDefaultInstance() + : scanConfigError_; + } else { + return scanConfigErrorBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + public Builder setScanConfigError( + com.google.cloud.websecurityscanner.v1.ScanConfigError value) { + if (scanConfigErrorBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scanConfigError_ = value; + onChanged(); + } else { + scanConfigErrorBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + public Builder setScanConfigError( + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder builderForValue) { + if (scanConfigErrorBuilder_ == null) { + scanConfigError_ = builderForValue.build(); + onChanged(); + } else { + scanConfigErrorBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + public Builder mergeScanConfigError( + com.google.cloud.websecurityscanner.v1.ScanConfigError value) { + if (scanConfigErrorBuilder_ == null) { + if (scanConfigError_ != null) { + scanConfigError_ = + com.google.cloud.websecurityscanner.v1.ScanConfigError.newBuilder(scanConfigError_) + .mergeFrom(value) + .buildPartial(); + } else { + scanConfigError_ = value; + } + onChanged(); + } else { + scanConfigErrorBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + public Builder clearScanConfigError() { + if (scanConfigErrorBuilder_ == null) { + scanConfigError_ = null; + onChanged(); + } else { + scanConfigError_ = null; + scanConfigErrorBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder + getScanConfigErrorBuilder() { + + onChanged(); + return getScanConfigErrorFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder + getScanConfigErrorOrBuilder() { + if (scanConfigErrorBuilder_ != null) { + return scanConfigErrorBuilder_.getMessageOrBuilder(); + } else { + return scanConfigError_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfigError.getDefaultInstance() + : scanConfigError_; + } + } + /** + * + * + *
+     * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+     * message encountered during scan configuration validation that is performed
+     * before each scan run.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfigError, + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder> + getScanConfigErrorFieldBuilder() { + if (scanConfigErrorBuilder_ == null) { + scanConfigErrorBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfigError, + com.google.cloud.websecurityscanner.v1.ScanConfigError.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder>( + getScanConfigError(), getParentForChildren(), isClean()); + scanConfigError_ = null; + } + return scanConfigErrorBuilder_; + } + + private int mostCommonHttpErrorCode_; + /** + * + * + *
+     * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
+     * common HTTP error code, if such is available. For example, if this code is
+     * 404, the scan has encountered too many NOT_FOUND responses.
+     * 
+ * + * int32 most_common_http_error_code = 3; + * + * @return The mostCommonHttpErrorCode. + */ + @java.lang.Override + public int getMostCommonHttpErrorCode() { + return mostCommonHttpErrorCode_; + } + /** + * + * + *
+     * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
+     * common HTTP error code, if such is available. For example, if this code is
+     * 404, the scan has encountered too many NOT_FOUND responses.
+     * 
+ * + * int32 most_common_http_error_code = 3; + * + * @param value The mostCommonHttpErrorCode to set. + * @return This builder for chaining. + */ + public Builder setMostCommonHttpErrorCode(int value) { + + mostCommonHttpErrorCode_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
+     * common HTTP error code, if such is available. For example, if this code is
+     * 404, the scan has encountered too many NOT_FOUND responses.
+     * 
+ * + * int32 most_common_http_error_code = 3; + * + * @return This builder for chaining. + */ + public Builder clearMostCommonHttpErrorCode() { + + mostCommonHttpErrorCode_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanRunErrorTrace) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanRunErrorTrace) + private static final com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScanRunErrorTrace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScanRunErrorTrace(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTraceOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTraceOrBuilder.java new file mode 100644 index 00000000..fb974bf8 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTraceOrBuilder.java @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run_error_trace.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ScanRunErrorTraceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanRunErrorTrace) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Indicates the error reason code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * Output only. Indicates the error reason code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code code = 1; + * + * @return The code. + */ + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code getCode(); + + /** + * + * + *
+   * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+   * message encountered during scan configuration validation that is performed
+   * before each scan run.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + * + * @return Whether the scanConfigError field is set. + */ + boolean hasScanConfigError(); + /** + * + * + *
+   * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+   * message encountered during scan configuration validation that is performed
+   * before each scan run.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + * + * @return The scanConfigError. + */ + com.google.cloud.websecurityscanner.v1.ScanConfigError getScanConfigError(); + /** + * + * + *
+   * Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error
+   * message encountered during scan configuration validation that is performed
+   * before each scan run.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfigError scan_config_error = 2; + */ + com.google.cloud.websecurityscanner.v1.ScanConfigErrorOrBuilder getScanConfigErrorOrBuilder(); + + /** + * + * + *
+   * Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most
+   * common HTTP error code, if such is available. For example, if this code is
+   * 404, the scan has encountered too many NOT_FOUND responses.
+   * 
+ * + * int32 most_common_http_error_code = 3; + * + * @return The mostCommonHttpErrorCode. + */ + int getMostCommonHttpErrorCode(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTraceProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTraceProto.java new file mode 100644 index 00000000..b1846fa9 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunErrorTraceProto.java @@ -0,0 +1,81 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run_error_trace.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class ScanRunErrorTraceProto { + private ScanRunErrorTraceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n=google/cloud/websecurityscanner/v1/sca" + + "n_run_error_trace.proto\022\"google.cloud.we" + + "bsecurityscanner.v1\032:google/cloud/websec" + + "urityscanner/v1/scan_config_error.proto\"" + + "\215\003\n\021ScanRunErrorTrace\022H\n\004code\030\001 \001(\0162:.go" + + "ogle.cloud.websecurityscanner.v1.ScanRun" + + "ErrorTrace.Code\022N\n\021scan_config_error\030\002 \001" + + "(\01323.google.cloud.websecurityscanner.v1." + + "ScanConfigError\022#\n\033most_common_http_erro" + + "r_code\030\003 \001(\005\"\270\001\n\004Code\022\024\n\020CODE_UNSPECIFIE" + + "D\020\000\022\022\n\016INTERNAL_ERROR\020\001\022\025\n\021SCAN_CONFIG_I" + + "SSUE\020\002\022\037\n\033AUTHENTICATION_CONFIG_ISSUE\020\003\022" + + "\034\n\030TIMED_OUT_WHILE_SCANNING\020\004\022\026\n\022TOO_MAN" + + "Y_REDIRECTS\020\005\022\030\n\024TOO_MANY_HTTP_ERRORS\020\006B" + + "\230\001\n&com.google.cloud.websecurityscanner." + + "v1B\026ScanRunErrorTraceProtoP\001ZTgoogle.gol" + + "ang.org/genproto/googleapis/cloud/websec" + + "urityscanner/v1;websecurityscannerb\006prot" + + "o3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto.getDescriptor(), + }); + internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanRunErrorTrace_descriptor, + new java.lang.String[] { + "Code", "ScanConfigError", "MostCommonHttpErrorCode", + }); + com.google.cloud.websecurityscanner.v1.ScanConfigErrorProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunOrBuilder.java new file mode 100644 index 00000000..1a42828e --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunOrBuilder.java @@ -0,0 +1,334 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ScanRunOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanRun) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name of the ScanRun. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * The ScanRun IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name of the ScanRun. The name follows the format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * The ScanRun IDs are generated by the system.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The execution state of the ScanRun.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return The enum numeric value on the wire for executionState. + */ + int getExecutionStateValue(); + /** + * + * + *
+   * Output only. The execution state of the ScanRun.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ExecutionState execution_state = 2; + * + * @return The executionState. + */ + com.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState getExecutionState(); + + /** + * + * + *
+   * Output only. The result state of the ScanRun. This field is only available after the
+   * execution state reaches "FINISHED".
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return The enum numeric value on the wire for resultState. + */ + int getResultStateValue(); + /** + * + * + *
+   * Output only. The result state of the ScanRun. This field is only available after the
+   * execution state reaches "FINISHED".
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRun.ResultState result_state = 3; + * + * @return The resultState. + */ + com.google.cloud.websecurityscanner.v1.ScanRun.ResultState getResultState(); + + /** + * + * + *
+   * Output only. The time at which the ScanRun started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return Whether the startTime field is set. + */ + boolean hasStartTime(); + /** + * + * + *
+   * Output only. The time at which the ScanRun started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + * + * @return The startTime. + */ + com.google.protobuf.Timestamp getStartTime(); + /** + * + * + *
+   * Output only. The time at which the ScanRun started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+   * is either finished or stopped by user.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return Whether the endTime field is set. + */ + boolean hasEndTime(); + /** + * + * + *
+   * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+   * is either finished or stopped by user.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + * + * @return The endTime. + */ + com.google.protobuf.Timestamp getEndTime(); + /** + * + * + *
+   * Output only. The time at which the ScanRun reached termination state - that the ScanRun
+   * is either finished or stopped by user.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The number of URLs crawled during this ScanRun. If the scan is in progress,
+   * the value represents the number of URLs crawled up to now.
+   * 
+ * + * int64 urls_crawled_count = 6; + * + * @return The urlsCrawledCount. + */ + long getUrlsCrawledCount(); + + /** + * + * + *
+   * Output only. The number of URLs tested during this ScanRun. If the scan is in progress,
+   * the value represents the number of URLs tested up to now. The number of
+   * URLs tested is usually larger than the number URLS crawled because
+   * typically a crawled URL is tested with multiple test payloads.
+   * 
+ * + * int64 urls_tested_count = 7; + * + * @return The urlsTestedCount. + */ + long getUrlsTestedCount(); + + /** + * + * + *
+   * Output only. Whether the scan run has found any vulnerabilities.
+   * 
+ * + * bool has_vulnerabilities = 8; + * + * @return The hasVulnerabilities. + */ + boolean getHasVulnerabilities(); + + /** + * + * + *
+   * Output only. The percentage of total completion ranging from 0 to 100.
+   * If the scan is in queue, the value is 0.
+   * If the scan is running, the value ranges from 0 to 100.
+   * If the scan is finished, the value is 100.
+   * 
+ * + * int32 progress_percent = 9; + * + * @return The progressPercent. + */ + int getProgressPercent(); + + /** + * + * + *
+   * Output only. If result_state is an ERROR, this field provides the primary reason for
+   * scan's termination and more details, if such are available.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + * + * @return Whether the errorTrace field is set. + */ + boolean hasErrorTrace(); + /** + * + * + *
+   * Output only. If result_state is an ERROR, this field provides the primary reason for
+   * scan's termination and more details, if such are available.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + * + * @return The errorTrace. + */ + com.google.cloud.websecurityscanner.v1.ScanRunErrorTrace getErrorTrace(); + /** + * + * + *
+   * Output only. If result_state is an ERROR, this field provides the primary reason for
+   * scan's termination and more details, if such are available.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunErrorTrace error_trace = 10; + */ + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceOrBuilder getErrorTraceOrBuilder(); + + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + java.util.List getWarningTracesList(); + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace getWarningTraces(int index); + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + int getWarningTracesCount(); + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + java.util.List + getWarningTracesOrBuilderList(); + /** + * + * + *
+   * Output only. A list of warnings, if such are encountered during this scan run.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.ScanRunWarningTrace warning_traces = 11; + * + */ + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder getWarningTracesOrBuilder( + int index); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunProto.java new file mode 100644 index 00000000..9bdc9878 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunProto.java @@ -0,0 +1,105 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class ScanRunProto { + private ScanRunProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanRun_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanRun_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/websecurityscanner/v1/sca" + + "n_run.proto\022\"google.cloud.websecuritysca" + + "nner.v1\032=google/cloud/websecurityscanner" + + "/v1/scan_run_error_trace.proto\032?google/c" + + "loud/websecurityscanner/v1/scan_run_warn" + + "ing_trace.proto\032\037google/protobuf/timesta" + + "mp.proto\"\320\005\n\007ScanRun\022\014\n\004name\030\001 \001(\t\022S\n\017ex" + + "ecution_state\030\002 \001(\0162:.google.cloud.webse" + + "curityscanner.v1.ScanRun.ExecutionState\022" + + "M\n\014result_state\030\003 \001(\01627.google.cloud.web" + + "securityscanner.v1.ScanRun.ResultState\022." + + "\n\nstart_time\030\004 \001(\0132\032.google.protobuf.Tim" + + "estamp\022,\n\010end_time\030\005 \001(\0132\032.google.protob" + + "uf.Timestamp\022\032\n\022urls_crawled_count\030\006 \001(\003" + + "\022\031\n\021urls_tested_count\030\007 \001(\003\022\033\n\023has_vulne" + + "rabilities\030\010 \001(\010\022\030\n\020progress_percent\030\t \001" + + "(\005\022J\n\013error_trace\030\n \001(\01325.google.cloud.w" + + "ebsecurityscanner.v1.ScanRunErrorTrace\022O" + + "\n\016warning_traces\030\013 \003(\01327.google.cloud.we" + + "bsecurityscanner.v1.ScanRunWarningTrace\"" + + "Y\n\016ExecutionState\022\037\n\033EXECUTION_STATE_UNS" + + "PECIFIED\020\000\022\n\n\006QUEUED\020\001\022\014\n\010SCANNING\020\002\022\014\n\010" + + "FINISHED\020\003\"O\n\013ResultState\022\034\n\030RESULT_STAT" + + "E_UNSPECIFIED\020\000\022\013\n\007SUCCESS\020\001\022\t\n\005ERROR\020\002\022" + + "\n\n\006KILLED\020\003B\216\001\n&com.google.cloud.websecu" + + "rityscanner.v1B\014ScanRunProtoP\001ZTgoogle.g" + + "olang.org/genproto/googleapis/cloud/webs" + + "ecurityscanner/v1;websecurityscannerb\006pr" + + "oto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto.getDescriptor(), + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_websecurityscanner_v1_ScanRun_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanRun_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanRun_descriptor, + new java.lang.String[] { + "Name", + "ExecutionState", + "ResultState", + "StartTime", + "EndTime", + "UrlsCrawledCount", + "UrlsTestedCount", + "HasVulnerabilities", + "ProgressPercent", + "ErrorTrace", + "WarningTraces", + }); + com.google.cloud.websecurityscanner.v1.ScanRunErrorTraceProto.getDescriptor(); + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTrace.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTrace.java new file mode 100644 index 00000000..6a8ee183 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTrace.java @@ -0,0 +1,835 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Output only.
+ * Defines a warning trace message for ScanRun. Warning traces provide customers
+ * with useful information that helps make the scanning process more effective.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanRunWarningTrace} + */ +public final class ScanRunWarningTrace extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ScanRunWarningTrace) + ScanRunWarningTraceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ScanRunWarningTrace.newBuilder() to construct. + private ScanRunWarningTrace(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ScanRunWarningTrace() { + code_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ScanRunWarningTrace(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ScanRunWarningTrace( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + code_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.class, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder.class); + } + + /** + * + * + *
+   * Output only.
+   * Defines a warning message code.
+   * Next id: 6
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code} + */ + public enum Code implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default value is never used.
+     * 
+ * + * CODE_UNSPECIFIED = 0; + */ + CODE_UNSPECIFIED(0), + /** + * + * + *
+     * Indicates that a scan discovered an unexpectedly low number of URLs. This
+     * is sometimes caused by complex navigation features or by using a single
+     * URL for numerous pages.
+     * 
+ * + * INSUFFICIENT_CRAWL_RESULTS = 1; + */ + INSUFFICIENT_CRAWL_RESULTS(1), + /** + * + * + *
+     * Indicates that a scan discovered too many URLs to test, or excessive
+     * redundant URLs.
+     * 
+ * + * TOO_MANY_CRAWL_RESULTS = 2; + */ + TOO_MANY_CRAWL_RESULTS(2), + /** + * + * + *
+     * Indicates that too many tests have been generated for the scan. Customer
+     * should try reducing the number of starting URLs, increasing the QPS rate,
+     * or narrowing down the scope of the scan using the excluded patterns.
+     * 
+ * + * TOO_MANY_FUZZ_TASKS = 3; + */ + TOO_MANY_FUZZ_TASKS(3), + /** + * + * + *
+     * Indicates that a scan is blocked by IAP.
+     * 
+ * + * BLOCKED_BY_IAP = 4; + */ + BLOCKED_BY_IAP(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default value is never used.
+     * 
+ * + * CODE_UNSPECIFIED = 0; + */ + public static final int CODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Indicates that a scan discovered an unexpectedly low number of URLs. This
+     * is sometimes caused by complex navigation features or by using a single
+     * URL for numerous pages.
+     * 
+ * + * INSUFFICIENT_CRAWL_RESULTS = 1; + */ + public static final int INSUFFICIENT_CRAWL_RESULTS_VALUE = 1; + /** + * + * + *
+     * Indicates that a scan discovered too many URLs to test, or excessive
+     * redundant URLs.
+     * 
+ * + * TOO_MANY_CRAWL_RESULTS = 2; + */ + public static final int TOO_MANY_CRAWL_RESULTS_VALUE = 2; + /** + * + * + *
+     * Indicates that too many tests have been generated for the scan. Customer
+     * should try reducing the number of starting URLs, increasing the QPS rate,
+     * or narrowing down the scope of the scan using the excluded patterns.
+     * 
+ * + * TOO_MANY_FUZZ_TASKS = 3; + */ + public static final int TOO_MANY_FUZZ_TASKS_VALUE = 3; + /** + * + * + *
+     * Indicates that a scan is blocked by IAP.
+     * 
+ * + * BLOCKED_BY_IAP = 4; + */ + public static final int BLOCKED_BY_IAP_VALUE = 4; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Code valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Code forNumber(int value) { + switch (value) { + case 0: + return CODE_UNSPECIFIED; + case 1: + return INSUFFICIENT_CRAWL_RESULTS; + case 2: + return TOO_MANY_CRAWL_RESULTS; + case 3: + return TOO_MANY_FUZZ_TASKS; + case 4: + return BLOCKED_BY_IAP; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Code findValueByNumber(int number) { + return Code.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Code[] VALUES = values(); + + public static Code valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Code(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code) + } + + public static final int CODE_FIELD_NUMBER = 1; + private int code_; + /** + * + * + *
+   * Output only. Indicates the warning code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+   * Output only. Indicates the warning code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code result = + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code.valueOf(code_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (code_ + != com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code.CODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, code_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (code_ + != com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code.CODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, code_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace other = + (com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace) obj; + + if (code_ != other.code_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CODE_FIELD_NUMBER; + hash = (53 * hash) + code_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Output only.
+   * Defines a warning trace message for ScanRun. Warning traces provide customers
+   * with useful information that helps make the scanning process more effective.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ScanRunWarningTrace} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ScanRunWarningTrace) + com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.class, + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + code_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTraceProto + .internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace build() { + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace buildPartial() { + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace result = + new com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace(this); + result.code_ = code_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace other) { + if (other == com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.getDefaultInstance()) + return this; + if (other.code_ != 0) { + setCodeValue(other.getCodeValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int code_ = 0; + /** + * + * + *
+     * Output only. Indicates the warning code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + @java.lang.Override + public int getCodeValue() { + return code_; + } + /** + * + * + *
+     * Output only. Indicates the warning code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @param value The enum numeric value on the wire for code to set. + * @return This builder for chaining. + */ + public Builder setCodeValue(int value) { + + code_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the warning code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return The code. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code getCode() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code result = + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code.valueOf(code_); + return result == null + ? com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Indicates the warning code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @param value The code to set. + * @return This builder for chaining. + */ + public Builder setCode(com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code value) { + if (value == null) { + throw new NullPointerException(); + } + + code_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Indicates the warning code.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return This builder for chaining. + */ + public Builder clearCode() { + + code_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ScanRunWarningTrace) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ScanRunWarningTrace) + private static final com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace(); + } + + public static com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ScanRunWarningTrace parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ScanRunWarningTrace(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTraceOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTraceOrBuilder.java new file mode 100644 index 00000000..1586e0e0 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTraceOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ScanRunWarningTraceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ScanRunWarningTrace) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Indicates the warning code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return The enum numeric value on the wire for code. + */ + int getCodeValue(); + /** + * + * + *
+   * Output only. Indicates the warning code.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code code = 1; + * + * @return The code. + */ + com.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code getCode(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTraceProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTraceProto.java new file mode 100644 index 00000000..3a32a1da --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ScanRunWarningTraceProto.java @@ -0,0 +1,71 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class ScanRunWarningTraceProto { + private ScanRunWarningTraceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n?google/cloud/websecurityscanner/v1/sca" + + "n_run_warning_trace.proto\022\"google.cloud." + + "websecurityscanner.v1\"\351\001\n\023ScanRunWarning" + + "Trace\022J\n\004code\030\001 \001(\0162<.google.cloud.webse" + + "curityscanner.v1.ScanRunWarningTrace.Cod" + + "e\"\205\001\n\004Code\022\024\n\020CODE_UNSPECIFIED\020\000\022\036\n\032INSU" + + "FFICIENT_CRAWL_RESULTS\020\001\022\032\n\026TOO_MANY_CRA" + + "WL_RESULTS\020\002\022\027\n\023TOO_MANY_FUZZ_TASKS\020\003\022\022\n" + + "\016BLOCKED_BY_IAP\020\004B\232\001\n&com.google.cloud.w" + + "ebsecurityscanner.v1B\030ScanRunWarningTrac" + + "eProtoP\001ZTgoogle.golang.org/genproto/goo" + + "gleapis/cloud/websecurityscanner/v1;webs" + + "ecurityscannerb\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_websecurityscanner_v1_ScanRunWarningTrace_descriptor, + new java.lang.String[] { + "Code", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StartScanRunRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StartScanRunRequest.java new file mode 100644 index 00000000..94e2b6c4 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StartScanRunRequest.java @@ -0,0 +1,644 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `StartScanRun` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.StartScanRunRequest} + */ +public final class StartScanRunRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.StartScanRunRequest) + StartScanRunRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StartScanRunRequest.newBuilder() to construct. + private StartScanRunRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StartScanRunRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StartScanRunRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StartScanRunRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest.class, + com.google.cloud.websecurityscanner.v1.StartScanRunRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be used. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be used. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.StartScanRunRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.StartScanRunRequest other = + (com.google.cloud.websecurityscanner.v1.StartScanRunRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `StartScanRun` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.StartScanRunRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.StartScanRunRequest) + com.google.cloud.websecurityscanner.v1.StartScanRunRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.StartScanRunRequest.class, + com.google.cloud.websecurityscanner.v1.StartScanRunRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.StartScanRunRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StartScanRunRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.StartScanRunRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StartScanRunRequest build() { + com.google.cloud.websecurityscanner.v1.StartScanRunRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StartScanRunRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.StartScanRunRequest result = + new com.google.cloud.websecurityscanner.v1.StartScanRunRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.StartScanRunRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.StartScanRunRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.StartScanRunRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.StartScanRunRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.StartScanRunRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.StartScanRunRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be used. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be used. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be used. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be used. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanConfig to be used. The name follows the
+     * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.StartScanRunRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.StartScanRunRequest) + private static final com.google.cloud.websecurityscanner.v1.StartScanRunRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.StartScanRunRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.StartScanRunRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StartScanRunRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StartScanRunRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StartScanRunRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StartScanRunRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StartScanRunRequestOrBuilder.java new file mode 100644 index 00000000..4529ac02 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StartScanRunRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface StartScanRunRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.StartScanRunRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be used. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the ScanConfig to be used. The name follows the
+   * format of 'projects/{projectId}/scanConfigs/{scanConfigId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StopScanRunRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StopScanRunRequest.java new file mode 100644 index 00000000..b6132f70 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StopScanRunRequest.java @@ -0,0 +1,651 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `StopScanRun` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.StopScanRunRequest} + */ +public final class StopScanRunRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.StopScanRunRequest) + StopScanRunRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use StopScanRunRequest.newBuilder() to construct. + private StopScanRunRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StopScanRunRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StopScanRunRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private StopScanRunRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest.class, + com.google.cloud.websecurityscanner.v1.StopScanRunRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the ScanRun to be stopped. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the ScanRun to be stopped. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.StopScanRunRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.StopScanRunRequest other = + (com.google.cloud.websecurityscanner.v1.StopScanRunRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `StopScanRun` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.StopScanRunRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.StopScanRunRequest) + com.google.cloud.websecurityscanner.v1.StopScanRunRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.StopScanRunRequest.class, + com.google.cloud.websecurityscanner.v1.StopScanRunRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.StopScanRunRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StopScanRunRequest getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.StopScanRunRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StopScanRunRequest build() { + com.google.cloud.websecurityscanner.v1.StopScanRunRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StopScanRunRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.StopScanRunRequest result = + new com.google.cloud.websecurityscanner.v1.StopScanRunRequest(this); + result.name_ = name_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.StopScanRunRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.StopScanRunRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.StopScanRunRequest other) { + if (other == com.google.cloud.websecurityscanner.v1.StopScanRunRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.StopScanRunRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.StopScanRunRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the ScanRun to be stopped. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be stopped. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be stopped. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be stopped. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the ScanRun to be stopped. The name follows the
+     * format of
+     * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.StopScanRunRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.StopScanRunRequest) + private static final com.google.cloud.websecurityscanner.v1.StopScanRunRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.StopScanRunRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.StopScanRunRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StopScanRunRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StopScanRunRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.StopScanRunRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StopScanRunRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StopScanRunRequestOrBuilder.java new file mode 100644 index 00000000..8201e67e --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/StopScanRunRequestOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface StopScanRunRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.StopScanRunRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the ScanRun to be stopped. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the ScanRun to be stopped. The name follows the
+   * format of
+   * 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/UpdateScanConfigRequest.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/UpdateScanConfigRequest.java new file mode 100644 index 00000000..dd6ee50a --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/UpdateScanConfigRequest.java @@ -0,0 +1,1062 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Request for the `UpdateScanConfigRequest` method.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} + */ +public final class UpdateScanConfigRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + UpdateScanConfigRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateScanConfigRequest.newBuilder() to construct. + private UpdateScanConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateScanConfigRequest() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateScanConfigRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateScanConfigRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 18: + { + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder subBuilder = null; + if (scanConfig_ != null) { + subBuilder = scanConfig_.toBuilder(); + } + scanConfig_ = + input.readMessage( + com.google.cloud.websecurityscanner.v1.ScanConfig.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(scanConfig_); + scanConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.Builder.class); + } + + public static final int SCAN_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.websecurityscanner.v1.ScanConfig 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.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return Whether the scanConfig field is set. + */ + @java.lang.Override + public boolean hasScanConfig() { + return scanConfig_ != null; + } + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return The scanConfig. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig() { + return scanConfig_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance() + : 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.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigOrBuilder() { + return getScanConfig(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 3; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (scanConfig_ != null) { + output.writeMessage(2, getScanConfig()); + } + if (updateMask_ != null) { + output.writeMessage(3, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (scanConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getScanConfig()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateMask()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest other = + (com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) obj; + + if (hasScanConfig() != other.hasScanConfig()) return false; + if (hasScanConfig()) { + if (!getScanConfig().equals(other.getScanConfig())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasScanConfig()) { + hash = (37 * hash) + SCAN_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getScanConfig().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request for the `UpdateScanConfigRequest` method.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.UpdateScanConfigRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.class, + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (scanConfigBuilder_ == null) { + scanConfig_ = null; + } else { + scanConfig_ = null; + scanConfigBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.WebSecurityScannerProto + .internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest build() { + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest buildPartial() { + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest result = + new com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest(this); + if (scanConfigBuilder_ == null) { + result.scanConfig_ = scanConfig_; + } else { + result.scanConfig_ = scanConfigBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest other) { + if (other + == com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest.getDefaultInstance()) + return this; + if (other.hasScanConfig()) { + mergeScanConfig(other.getScanConfig()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.cloud.websecurityscanner.v1.ScanConfig scanConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder> + scanConfigBuilder_; + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return Whether the scanConfig field is set. + */ + public boolean hasScanConfig() { + return scanConfigBuilder_ != null || scanConfig_ != null; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return The scanConfig. + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig() { + if (scanConfigBuilder_ == null) { + return scanConfig_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance() + : scanConfig_; + } else { + return scanConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder setScanConfig(com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + scanConfig_ = value; + onChanged(); + } else { + scanConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder setScanConfig( + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder builderForValue) { + if (scanConfigBuilder_ == null) { + scanConfig_ = builderForValue.build(); + onChanged(); + } else { + scanConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder mergeScanConfig(com.google.cloud.websecurityscanner.v1.ScanConfig value) { + if (scanConfigBuilder_ == null) { + if (scanConfig_ != null) { + scanConfig_ = + com.google.cloud.websecurityscanner.v1.ScanConfig.newBuilder(scanConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + scanConfig_ = value; + } + onChanged(); + } else { + scanConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public Builder clearScanConfig() { + if (scanConfigBuilder_ == null) { + scanConfig_ = null; + onChanged(); + } else { + scanConfig_ = null; + scanConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfig.Builder getScanConfigBuilder() { + + onChanged(); + return getScanConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + public com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigOrBuilder() { + if (scanConfigBuilder_ != null) { + return scanConfigBuilder_.getMessageOrBuilder(); + } else { + return scanConfig_ == null + ? com.google.cloud.websecurityscanner.v1.ScanConfig.getDefaultInstance() + : 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.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder> + getScanConfigFieldBuilder() { + if (scanConfigBuilder_ == null) { + scanConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.ScanConfig, + com.google.cloud.websecurityscanner.v1.ScanConfig.Builder, + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder>( + getScanConfig(), getParentForChildren(), isClean()); + scanConfig_ = null; + } + return scanConfigBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. The update mask applies to the resource. For the `FieldMask` definition,
+     * see
+     * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + private static final com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest(); + } + + public static com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateScanConfigRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateScanConfigRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/UpdateScanConfigRequestOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/UpdateScanConfigRequestOrBuilder.java new file mode 100644 index 00000000..84d3918a --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/UpdateScanConfigRequestOrBuilder.java @@ -0,0 +1,107 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface UpdateScanConfigRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.UpdateScanConfigRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return Whether the scanConfig field is set. + */ + boolean hasScanConfig(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + * + * @return The scanConfig. + */ + com.google.cloud.websecurityscanner.v1.ScanConfig getScanConfig(); + /** + * + * + *
+   * 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.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.ScanConfig scan_config = 2; + */ + com.google.cloud.websecurityscanner.v1.ScanConfigOrBuilder getScanConfigOrBuilder(); + + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. The update mask applies to the resource. For the `FieldMask` definition,
+   * see
+   * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 3; + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ViolatingResource.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ViolatingResource.java new file mode 100644 index 00000000..4071cc63 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ViolatingResource.java @@ -0,0 +1,818 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Information regarding any resource causing the vulnerability such
+ * as JavaScript sources, image, audio files, etc.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ViolatingResource} + */ +public final class ViolatingResource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.ViolatingResource) + ViolatingResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use ViolatingResource.newBuilder() to construct. + private ViolatingResource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ViolatingResource() { + contentType_ = ""; + resourceUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ViolatingResource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ViolatingResource( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + contentType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ViolatingResource.class, + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder.class); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object contentType_; + /** + * + * + *
+   * The MIME type of this resource.
+   * 
+ * + * string content_type = 1; + * + * @return The contentType. + */ + @java.lang.Override + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } + } + /** + * + * + *
+   * The MIME type of this resource.
+   * 
+ * + * string content_type = 1; + * + * @return The bytes for contentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_URL_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceUrl_; + /** + * + * + *
+   * URL of this violating resource.
+   * 
+ * + * string resource_url = 2; + * + * @return The resourceUrl. + */ + @java.lang.Override + public java.lang.String getResourceUrl() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUrl_ = s; + return s; + } + } + /** + * + * + *
+   * URL of this violating resource.
+   * 
+ * + * string resource_url = 2; + * + * @return The bytes for resourceUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceUrlBytes() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, contentType_); + } + if (!getResourceUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, contentType_); + } + if (!getResourceUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.ViolatingResource)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.ViolatingResource other = + (com.google.cloud.websecurityscanner.v1.ViolatingResource) obj; + + if (!getContentType().equals(other.getContentType())) return false; + if (!getResourceUrl().equals(other.getResourceUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + hash = (37 * hash) + RESOURCE_URL_FIELD_NUMBER; + hash = (53 * hash) + getResourceUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.ViolatingResource prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information regarding any resource causing the vulnerability such
+   * as JavaScript sources, image, audio files, etc.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.ViolatingResource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.ViolatingResource) + com.google.cloud.websecurityscanner.v1.ViolatingResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.ViolatingResource.class, + com.google.cloud.websecurityscanner.v1.ViolatingResource.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.ViolatingResource.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + contentType_ = ""; + + resourceUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_ViolatingResource_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ViolatingResource getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.ViolatingResource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ViolatingResource build() { + com.google.cloud.websecurityscanner.v1.ViolatingResource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ViolatingResource buildPartial() { + com.google.cloud.websecurityscanner.v1.ViolatingResource result = + new com.google.cloud.websecurityscanner.v1.ViolatingResource(this); + result.contentType_ = contentType_; + result.resourceUrl_ = resourceUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.ViolatingResource) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.ViolatingResource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.ViolatingResource other) { + if (other == com.google.cloud.websecurityscanner.v1.ViolatingResource.getDefaultInstance()) + return this; + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + onChanged(); + } + if (!other.getResourceUrl().isEmpty()) { + resourceUrl_ = other.resourceUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.ViolatingResource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.ViolatingResource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object contentType_ = ""; + /** + * + * + *
+     * The MIME type of this resource.
+     * 
+ * + * string content_type = 1; + * + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The MIME type of this resource.
+     * 
+ * + * string content_type = 1; + * + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The MIME type of this resource.
+     * 
+ * + * string content_type = 1; + * + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The MIME type of this resource.
+     * 
+ * + * string content_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = getDefaultInstance().getContentType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The MIME type of this resource.
+     * 
+ * + * string content_type = 1; + * + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentType_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceUrl_ = ""; + /** + * + * + *
+     * URL of this violating resource.
+     * 
+ * + * string resource_url = 2; + * + * @return The resourceUrl. + */ + public java.lang.String getResourceUrl() { + java.lang.Object ref = resourceUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * URL of this violating resource.
+     * 
+ * + * string resource_url = 2; + * + * @return The bytes for resourceUrl. + */ + public com.google.protobuf.ByteString getResourceUrlBytes() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * URL of this violating resource.
+     * 
+ * + * string resource_url = 2; + * + * @param value The resourceUrl to set. + * @return This builder for chaining. + */ + public Builder setResourceUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * URL of this violating resource.
+     * 
+ * + * string resource_url = 2; + * + * @return This builder for chaining. + */ + public Builder clearResourceUrl() { + + resourceUrl_ = getDefaultInstance().getResourceUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * URL of this violating resource.
+     * 
+ * + * string resource_url = 2; + * + * @param value The bytes for resourceUrl to set. + * @return This builder for chaining. + */ + public Builder setResourceUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.ViolatingResource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.ViolatingResource) + private static final com.google.cloud.websecurityscanner.v1.ViolatingResource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.ViolatingResource(); + } + + public static com.google.cloud.websecurityscanner.v1.ViolatingResource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ViolatingResource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ViolatingResource(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.ViolatingResource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ViolatingResourceOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ViolatingResourceOrBuilder.java new file mode 100644 index 00000000..ba3decef --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/ViolatingResourceOrBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface ViolatingResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.ViolatingResource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The MIME type of this resource.
+   * 
+ * + * string content_type = 1; + * + * @return The contentType. + */ + java.lang.String getContentType(); + /** + * + * + *
+   * The MIME type of this resource.
+   * 
+ * + * string content_type = 1; + * + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString getContentTypeBytes(); + + /** + * + * + *
+   * URL of this violating resource.
+   * 
+ * + * string resource_url = 2; + * + * @return The resourceUrl. + */ + java.lang.String getResourceUrl(); + /** + * + * + *
+   * URL of this violating resource.
+   * 
+ * + * string resource_url = 2; + * + * @return The bytes for resourceUrl. + */ + com.google.protobuf.ByteString getResourceUrlBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableHeaders.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableHeaders.java new file mode 100644 index 00000000..087b303b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableHeaders.java @@ -0,0 +1,2423 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Information about vulnerable or missing HTTP Headers.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.VulnerableHeaders} + */ +public final class VulnerableHeaders extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.VulnerableHeaders) + VulnerableHeadersOrBuilder { + private static final long serialVersionUID = 0L; + // Use VulnerableHeaders.newBuilder() to construct. + private VulnerableHeaders(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VulnerableHeaders() { + headers_ = java.util.Collections.emptyList(); + missingHeaders_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VulnerableHeaders(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VulnerableHeaders( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + headers_ = + new java.util.ArrayList< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header>(); + mutable_bitField0_ |= 0x00000001; + } + headers_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.parser(), + extensionRegistry)); + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + missingHeaders_ = + new java.util.ArrayList< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header>(); + mutable_bitField0_ |= 0x00000002; + } + missingHeaders_.add( + input.readMessage( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.parser(), + extensionRegistry)); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + headers_ = java.util.Collections.unmodifiableList(headers_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + missingHeaders_ = java.util.Collections.unmodifiableList(missingHeaders_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.class, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder.class); + } + + public interface HeaderOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Header name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+     * Header name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+     * Header value.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + java.lang.String getValue(); + /** + * + * + *
+     * Header value.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + com.google.protobuf.ByteString getValueBytes(); + } + /** + * + * + *
+   * Describes a HTTP Header.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} + */ + public static final class Header extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + HeaderOrBuilder { + private static final long serialVersionUID = 0L; + // Use Header.newBuilder() to construct. + private Header(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Header() { + name_ = ""; + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Header(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Header( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.class, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+     * Header name.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+     * Header name.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private volatile java.lang.Object value_; + /** + * + * + *
+     * Header value.
+     * 
+ * + * string value = 2; + * + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } + } + /** + * + * + *
+     * Header value.
+     * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!getValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header other = + (com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) obj; + + if (!getName().equals(other.getName())) return false; + if (!getValue().equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Describes a HTTP Header.
+     * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.VulnerableHeaders.Header} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.class, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder.class); + } + + // Construct using + // com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_Header_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header build() { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header buildPartial() { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header result = + new com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header(this); + result.name_ = name_; + result.value_ = value_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header other) { + if (other + == com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+       * Header name.
+       * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Header name.
+       * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Header name.
+       * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Header name.
+       * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+       * Header name.
+       * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object value_ = ""; + /** + * + * + *
+       * Header value.
+       * 
+ * + * string value = 2; + * + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * Header value.
+       * 
+ * + * string value = 2; + * + * @return The bytes for value. + */ + public com.google.protobuf.ByteString getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * Header value.
+       * 
+ * + * string value = 2; + * + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + * + * + *
+       * Header value.
+       * 
+ * + * string value = 2; + * + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + * + * + *
+       * Header value.
+       * 
+ * + * string value = 2; + * + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.VulnerableHeaders.Header) + private static final com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header(); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
PARSER = + new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Header parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Header(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser
parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser
getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int HEADERS_FIELD_NUMBER = 1; + private java.util.List headers_; + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + @java.lang.Override + public java.util.List + getHeadersList() { + return headers_; + } + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + getHeadersOrBuilderList() { + return headers_; + } + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + @java.lang.Override + public int getHeadersCount() { + return headers_.size(); + } + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header getHeaders(int index) { + return headers_.get(index); + } + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder + getHeadersOrBuilder(int index) { + return headers_.get(index); + } + + public static final int MISSING_HEADERS_FIELD_NUMBER = 2; + private java.util.List + missingHeaders_; + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + @java.lang.Override + public java.util.List + getMissingHeadersList() { + return missingHeaders_; + } + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + getMissingHeadersOrBuilderList() { + return missingHeaders_; + } + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + @java.lang.Override + public int getMissingHeadersCount() { + return missingHeaders_.size(); + } + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header getMissingHeaders( + int index) { + return missingHeaders_.get(index); + } + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder + getMissingHeadersOrBuilder(int index) { + return missingHeaders_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < headers_.size(); i++) { + output.writeMessage(1, headers_.get(i)); + } + for (int i = 0; i < missingHeaders_.size(); i++) { + output.writeMessage(2, missingHeaders_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < headers_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, headers_.get(i)); + } + for (int i = 0; i < missingHeaders_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, missingHeaders_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.VulnerableHeaders)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.VulnerableHeaders other = + (com.google.cloud.websecurityscanner.v1.VulnerableHeaders) obj; + + if (!getHeadersList().equals(other.getHeadersList())) return false; + if (!getMissingHeadersList().equals(other.getMissingHeadersList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getHeadersCount() > 0) { + hash = (37 * hash) + HEADERS_FIELD_NUMBER; + hash = (53 * hash) + getHeadersList().hashCode(); + } + if (getMissingHeadersCount() > 0) { + hash = (37 * hash) + MISSING_HEADERS_FIELD_NUMBER; + hash = (53 * hash) + getMissingHeadersList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about vulnerable or missing HTTP Headers.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.VulnerableHeaders} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.VulnerableHeaders) + com.google.cloud.websecurityscanner.v1.VulnerableHeadersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.class, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.VulnerableHeaders.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getHeadersFieldBuilder(); + getMissingHeadersFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (headersBuilder_ == null) { + headers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + headersBuilder_.clear(); + } + if (missingHeadersBuilder_ == null) { + missingHeaders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + } else { + missingHeadersBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableHeaders_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.VulnerableHeaders.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders build() { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders buildPartial() { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders result = + new com.google.cloud.websecurityscanner.v1.VulnerableHeaders(this); + int from_bitField0_ = bitField0_; + if (headersBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + headers_ = java.util.Collections.unmodifiableList(headers_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.headers_ = headers_; + } else { + result.headers_ = headersBuilder_.build(); + } + if (missingHeadersBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0)) { + missingHeaders_ = java.util.Collections.unmodifiableList(missingHeaders_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.missingHeaders_ = missingHeaders_; + } else { + result.missingHeaders_ = missingHeadersBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.VulnerableHeaders) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.VulnerableHeaders) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.VulnerableHeaders other) { + if (other == com.google.cloud.websecurityscanner.v1.VulnerableHeaders.getDefaultInstance()) + return this; + if (headersBuilder_ == null) { + if (!other.headers_.isEmpty()) { + if (headers_.isEmpty()) { + headers_ = other.headers_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureHeadersIsMutable(); + headers_.addAll(other.headers_); + } + onChanged(); + } + } else { + if (!other.headers_.isEmpty()) { + if (headersBuilder_.isEmpty()) { + headersBuilder_.dispose(); + headersBuilder_ = null; + headers_ = other.headers_; + bitField0_ = (bitField0_ & ~0x00000001); + headersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getHeadersFieldBuilder() + : null; + } else { + headersBuilder_.addAllMessages(other.headers_); + } + } + } + if (missingHeadersBuilder_ == null) { + if (!other.missingHeaders_.isEmpty()) { + if (missingHeaders_.isEmpty()) { + missingHeaders_ = other.missingHeaders_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureMissingHeadersIsMutable(); + missingHeaders_.addAll(other.missingHeaders_); + } + onChanged(); + } + } else { + if (!other.missingHeaders_.isEmpty()) { + if (missingHeadersBuilder_.isEmpty()) { + missingHeadersBuilder_.dispose(); + missingHeadersBuilder_ = null; + missingHeaders_ = other.missingHeaders_; + bitField0_ = (bitField0_ & ~0x00000002); + missingHeadersBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getMissingHeadersFieldBuilder() + : null; + } else { + missingHeadersBuilder_.addAllMessages(other.missingHeaders_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.VulnerableHeaders parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.VulnerableHeaders) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List + headers_ = java.util.Collections.emptyList(); + + private void ensureHeadersIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + headers_ = + new java.util.ArrayList< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header>(headers_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + headersBuilder_; + + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public java.util.List + getHeadersList() { + if (headersBuilder_ == null) { + return java.util.Collections.unmodifiableList(headers_); + } else { + return headersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public int getHeadersCount() { + if (headersBuilder_ == null) { + return headers_.size(); + } else { + return headersBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header getHeaders(int index) { + if (headersBuilder_ == null) { + return headers_.get(index); + } else { + return headersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder setHeaders( + int index, com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header value) { + if (headersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHeadersIsMutable(); + headers_.set(index, value); + onChanged(); + } else { + headersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder setHeaders( + int index, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder builderForValue) { + if (headersBuilder_ == null) { + ensureHeadersIsMutable(); + headers_.set(index, builderForValue.build()); + onChanged(); + } else { + headersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder addHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header value) { + if (headersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHeadersIsMutable(); + headers_.add(value); + onChanged(); + } else { + headersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder addHeaders( + int index, com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header value) { + if (headersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureHeadersIsMutable(); + headers_.add(index, value); + onChanged(); + } else { + headersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder addHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder builderForValue) { + if (headersBuilder_ == null) { + ensureHeadersIsMutable(); + headers_.add(builderForValue.build()); + onChanged(); + } else { + headersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder addHeaders( + int index, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder builderForValue) { + if (headersBuilder_ == null) { + ensureHeadersIsMutable(); + headers_.add(index, builderForValue.build()); + onChanged(); + } else { + headersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder addAllHeaders( + java.lang.Iterable< + ? extends com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header> + values) { + if (headersBuilder_ == null) { + ensureHeadersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, headers_); + onChanged(); + } else { + headersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder clearHeaders() { + if (headersBuilder_ == null) { + headers_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + headersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public Builder removeHeaders(int index) { + if (headersBuilder_ == null) { + ensureHeadersIsMutable(); + headers_.remove(index); + onChanged(); + } else { + headersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder + getHeadersBuilder(int index) { + return getHeadersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder + getHeadersOrBuilder(int index) { + if (headersBuilder_ == null) { + return headers_.get(index); + } else { + return headersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + getHeadersOrBuilderList() { + if (headersBuilder_ != null) { + return headersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(headers_); + } + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder + addHeadersBuilder() { + return getHeadersFieldBuilder() + .addBuilder( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.getDefaultInstance()); + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder + addHeadersBuilder(int index) { + return getHeadersFieldBuilder() + .addBuilder( + index, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.getDefaultInstance()); + } + /** + * + * + *
+     * List of vulnerable headers.
+     * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + * + */ + public java.util.List + getHeadersBuilderList() { + return getHeadersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + getHeadersFieldBuilder() { + if (headersBuilder_ == null) { + headersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder>( + headers_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + headers_ = null; + } + return headersBuilder_; + } + + private java.util.List + missingHeaders_ = java.util.Collections.emptyList(); + + private void ensureMissingHeadersIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + missingHeaders_ = + new java.util.ArrayList< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header>(missingHeaders_); + bitField0_ |= 0x00000002; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + missingHeadersBuilder_; + + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public java.util.List + getMissingHeadersList() { + if (missingHeadersBuilder_ == null) { + return java.util.Collections.unmodifiableList(missingHeaders_); + } else { + return missingHeadersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public int getMissingHeadersCount() { + if (missingHeadersBuilder_ == null) { + return missingHeaders_.size(); + } else { + return missingHeadersBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header getMissingHeaders( + int index) { + if (missingHeadersBuilder_ == null) { + return missingHeaders_.get(index); + } else { + return missingHeadersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder setMissingHeaders( + int index, com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header value) { + if (missingHeadersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingHeadersIsMutable(); + missingHeaders_.set(index, value); + onChanged(); + } else { + missingHeadersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder setMissingHeaders( + int index, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder builderForValue) { + if (missingHeadersBuilder_ == null) { + ensureMissingHeadersIsMutable(); + missingHeaders_.set(index, builderForValue.build()); + onChanged(); + } else { + missingHeadersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder addMissingHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header value) { + if (missingHeadersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingHeadersIsMutable(); + missingHeaders_.add(value); + onChanged(); + } else { + missingHeadersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder addMissingHeaders( + int index, com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header value) { + if (missingHeadersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureMissingHeadersIsMutable(); + missingHeaders_.add(index, value); + onChanged(); + } else { + missingHeadersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder addMissingHeaders( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder builderForValue) { + if (missingHeadersBuilder_ == null) { + ensureMissingHeadersIsMutable(); + missingHeaders_.add(builderForValue.build()); + onChanged(); + } else { + missingHeadersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder addMissingHeaders( + int index, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder builderForValue) { + if (missingHeadersBuilder_ == null) { + ensureMissingHeadersIsMutable(); + missingHeaders_.add(index, builderForValue.build()); + onChanged(); + } else { + missingHeadersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder addAllMissingHeaders( + java.lang.Iterable< + ? extends com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header> + values) { + if (missingHeadersBuilder_ == null) { + ensureMissingHeadersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, missingHeaders_); + onChanged(); + } else { + missingHeadersBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder clearMissingHeaders() { + if (missingHeadersBuilder_ == null) { + missingHeaders_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + } else { + missingHeadersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public Builder removeMissingHeaders(int index) { + if (missingHeadersBuilder_ == null) { + ensureMissingHeadersIsMutable(); + missingHeaders_.remove(index); + onChanged(); + } else { + missingHeadersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder + getMissingHeadersBuilder(int index) { + return getMissingHeadersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder + getMissingHeadersOrBuilder(int index) { + if (missingHeadersBuilder_ == null) { + return missingHeaders_.get(index); + } else { + return missingHeadersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public java.util.List< + ? extends com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + getMissingHeadersOrBuilderList() { + if (missingHeadersBuilder_ != null) { + return missingHeadersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(missingHeaders_); + } + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder + addMissingHeadersBuilder() { + return getMissingHeadersFieldBuilder() + .addBuilder( + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.getDefaultInstance()); + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder + addMissingHeadersBuilder(int index) { + return getMissingHeadersFieldBuilder() + .addBuilder( + index, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.getDefaultInstance()); + } + /** + * + * + *
+     * List of missing headers.
+     * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + public java.util.List + getMissingHeadersBuilderList() { + return getMissingHeadersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder> + getMissingHeadersFieldBuilder() { + if (missingHeadersBuilder_ == null) { + missingHeadersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header.Builder, + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder>( + missingHeaders_, + ((bitField0_ & 0x00000002) != 0), + getParentForChildren(), + isClean()); + missingHeaders_ = null; + } + return missingHeadersBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.VulnerableHeaders) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.VulnerableHeaders) + private static final com.google.cloud.websecurityscanner.v1.VulnerableHeaders DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.VulnerableHeaders(); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableHeaders getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VulnerableHeaders parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VulnerableHeaders(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableHeaders getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableHeadersOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableHeadersOrBuilder.java new file mode 100644 index 00000000..742d0ca4 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableHeadersOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface VulnerableHeadersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.VulnerableHeaders) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + java.util.List getHeadersList(); + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header getHeaders(int index); + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + int getHeadersCount(); + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + java.util.List + getHeadersOrBuilderList(); + /** + * + * + *
+   * List of vulnerable headers.
+   * 
+ * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header headers = 1; + */ + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder getHeadersOrBuilder( + int index); + + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + java.util.List + getMissingHeadersList(); + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header getMissingHeaders(int index); + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + int getMissingHeadersCount(); + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + java.util.List + getMissingHeadersOrBuilderList(); + /** + * + * + *
+   * List of missing headers.
+   * 
+ * + * + * repeated .google.cloud.websecurityscanner.v1.VulnerableHeaders.Header missing_headers = 2; + * + */ + com.google.cloud.websecurityscanner.v1.VulnerableHeaders.HeaderOrBuilder + getMissingHeadersOrBuilder(int index); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableParameters.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableParameters.java new file mode 100644 index 00000000..755e9c6b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableParameters.java @@ -0,0 +1,738 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +/** + * + * + *
+ * Information about vulnerable request parameters.
+ * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.VulnerableParameters} + */ +public final class VulnerableParameters extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.VulnerableParameters) + VulnerableParametersOrBuilder { + private static final long serialVersionUID = 0L; + // Use VulnerableParameters.newBuilder() to construct. + private VulnerableParameters(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VulnerableParameters() { + parameterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VulnerableParameters(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VulnerableParameters( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + parameterNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + parameterNames_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + parameterNames_ = parameterNames_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.VulnerableParameters.class, + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder.class); + } + + public static final int PARAMETER_NAMES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList parameterNames_; + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @return A list containing the parameterNames. + */ + public com.google.protobuf.ProtocolStringList getParameterNamesList() { + return parameterNames_; + } + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @return The count of parameterNames. + */ + public int getParameterNamesCount() { + return parameterNames_.size(); + } + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index of the element to return. + * @return The parameterNames at the given index. + */ + public java.lang.String getParameterNames(int index) { + return parameterNames_.get(index); + } + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the parameterNames at the given index. + */ + public com.google.protobuf.ByteString getParameterNamesBytes(int index) { + return parameterNames_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < parameterNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parameterNames_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < parameterNames_.size(); i++) { + dataSize += computeStringSizeNoTag(parameterNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getParameterNamesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.VulnerableParameters)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.VulnerableParameters other = + (com.google.cloud.websecurityscanner.v1.VulnerableParameters) obj; + + if (!getParameterNamesList().equals(other.getParameterNamesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getParameterNamesCount() > 0) { + hash = (37 * hash) + PARAMETER_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getParameterNamesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.websecurityscanner.v1.VulnerableParameters prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information about vulnerable request parameters.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.VulnerableParameters} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.VulnerableParameters) + com.google.cloud.websecurityscanner.v1.VulnerableParametersOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.VulnerableParameters.class, + com.google.cloud.websecurityscanner.v1.VulnerableParameters.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.VulnerableParameters.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parameterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_VulnerableParameters_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableParameters getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.VulnerableParameters.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableParameters build() { + com.google.cloud.websecurityscanner.v1.VulnerableParameters result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableParameters buildPartial() { + com.google.cloud.websecurityscanner.v1.VulnerableParameters result = + new com.google.cloud.websecurityscanner.v1.VulnerableParameters(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + parameterNames_ = parameterNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.parameterNames_ = parameterNames_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.VulnerableParameters) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.VulnerableParameters) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.VulnerableParameters other) { + if (other == com.google.cloud.websecurityscanner.v1.VulnerableParameters.getDefaultInstance()) + return this; + if (!other.parameterNames_.isEmpty()) { + if (parameterNames_.isEmpty()) { + parameterNames_ = other.parameterNames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureParameterNamesIsMutable(); + parameterNames_.addAll(other.parameterNames_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.VulnerableParameters parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.websecurityscanner.v1.VulnerableParameters) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList parameterNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureParameterNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + parameterNames_ = new com.google.protobuf.LazyStringArrayList(parameterNames_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @return A list containing the parameterNames. + */ + public com.google.protobuf.ProtocolStringList getParameterNamesList() { + return parameterNames_.getUnmodifiableView(); + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @return The count of parameterNames. + */ + public int getParameterNamesCount() { + return parameterNames_.size(); + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index of the element to return. + * @return The parameterNames at the given index. + */ + public java.lang.String getParameterNames(int index) { + return parameterNames_.get(index); + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the parameterNames at the given index. + */ + public com.google.protobuf.ByteString getParameterNamesBytes(int index) { + return parameterNames_.getByteString(index); + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index to set the value at. + * @param value The parameterNames to set. + * @return This builder for chaining. + */ + public Builder setParameterNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParameterNamesIsMutable(); + parameterNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @param value The parameterNames to add. + * @return This builder for chaining. + */ + public Builder addParameterNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureParameterNamesIsMutable(); + parameterNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @param values The parameterNames to add. + * @return This builder for chaining. + */ + public Builder addAllParameterNames(java.lang.Iterable values) { + ensureParameterNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, parameterNames_); + onChanged(); + return this; + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @return This builder for chaining. + */ + public Builder clearParameterNames() { + parameterNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The vulnerable parameter names.
+     * 
+ * + * repeated string parameter_names = 1; + * + * @param value The bytes of the parameterNames to add. + * @return This builder for chaining. + */ + public Builder addParameterNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureParameterNamesIsMutable(); + parameterNames_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.VulnerableParameters) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.VulnerableParameters) + private static final com.google.cloud.websecurityscanner.v1.VulnerableParameters DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.VulnerableParameters(); + } + + public static com.google.cloud.websecurityscanner.v1.VulnerableParameters getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VulnerableParameters parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VulnerableParameters(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.VulnerableParameters getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableParametersOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableParametersOrBuilder.java new file mode 100644 index 00000000..edcdf61b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/VulnerableParametersOrBuilder.java @@ -0,0 +1,76 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface VulnerableParametersOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.VulnerableParameters) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @return A list containing the parameterNames. + */ + java.util.List getParameterNamesList(); + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @return The count of parameterNames. + */ + int getParameterNamesCount(); + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index of the element to return. + * @return The parameterNames at the given index. + */ + java.lang.String getParameterNames(int index); + /** + * + * + *
+   * The vulnerable parameter names.
+   * 
+ * + * repeated string parameter_names = 1; + * + * @param index The index of the value to return. + * @return The bytes of the parameterNames at the given index. + */ + com.google.protobuf.ByteString getParameterNamesBytes(int index); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerProto.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerProto.java new file mode 100644 index 00000000..15a12413 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/WebSecurityScannerProto.java @@ -0,0 +1,405 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +package com.google.cloud.websecurityscanner.v1; + +public final class WebSecurityScannerProto { + private WebSecurityScannerProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_CreateScanConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_DeleteScanConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_GetScanConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_UpdateScanConfigRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListScanConfigsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_StartScanRunRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_GetScanRunRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListScanRunsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListScanRunsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_StopScanRunRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListCrawledUrlsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_GetFindingRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListFindingsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListFindingsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_websecurityscanner_v1_ListFindingTypeStatsResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n=google/cloud/websecurityscanner/v1/web" + + "_security_scanner.proto\022\"google.cloud.we" + + "bsecurityscanner.v1\032\034google/api/annotati" + + "ons.proto\0324google/cloud/websecurityscann" + + "er/v1/crawled_url.proto\0320google/cloud/we" + + "bsecurityscanner/v1/finding.proto\032;googl" + + "e/cloud/websecurityscanner/v1/finding_ty" + + "pe_stats.proto\0324google/cloud/websecurity" + + "scanner/v1/scan_config.proto\0321google/clo" + + "ud/websecurityscanner/v1/scan_run.proto\032" + + "\033google/protobuf/empty.proto\032 google/pro" + + "tobuf/field_mask.proto\032\027google/api/clien" + + "t.proto\"n\n\027CreateScanConfigRequest\022\016\n\006pa" + + "rent\030\001 \001(\t\022C\n\013scan_config\030\002 \001(\0132..google" + + ".cloud.websecurityscanner.v1.ScanConfig\"" + + "\'\n\027DeleteScanConfigRequest\022\014\n\004name\030\001 \001(\t" + + "\"$\n\024GetScanConfigRequest\022\014\n\004name\030\001 \001(\t\"O" + + "\n\026ListScanConfigsRequest\022\016\n\006parent\030\001 \001(\t" + + "\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_size\030\003 \001(\005\"" + + "\217\001\n\027UpdateScanConfigRequest\022C\n\013scan_conf" + + "ig\030\002 \001(\0132..google.cloud.websecurityscann" + + "er.v1.ScanConfig\022/\n\013update_mask\030\003 \001(\0132\032." + + "google.protobuf.FieldMask\"x\n\027ListScanCon" + + "figsResponse\022D\n\014scan_configs\030\001 \003(\0132..goo" + + "gle.cloud.websecurityscanner.v1.ScanConf" + + "ig\022\027\n\017next_page_token\030\002 \001(\t\"#\n\023StartScan" + + "RunRequest\022\014\n\004name\030\001 \001(\t\"!\n\021GetScanRunRe" + + "quest\022\014\n\004name\030\001 \001(\t\"L\n\023ListScanRunsReque" + + "st\022\016\n\006parent\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t\022\021" + + "\n\tpage_size\030\003 \001(\005\"o\n\024ListScanRunsRespons" + + "e\022>\n\tscan_runs\030\001 \003(\0132+.google.cloud.webs" + + "ecurityscanner.v1.ScanRun\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"\"\n\022StopScanRunRequest\022\014\n\004name" + + "\030\001 \001(\t\"O\n\026ListCrawledUrlsRequest\022\016\n\006pare" + + "nt\030\001 \001(\t\022\022\n\npage_token\030\002 \001(\t\022\021\n\tpage_siz" + + "e\030\003 \001(\005\"x\n\027ListCrawledUrlsResponse\022D\n\014cr" + + "awled_urls\030\001 \003(\0132..google.cloud.websecur" + + "ityscanner.v1.CrawledUrl\022\027\n\017next_page_to" + + "ken\030\002 \001(\t\"!\n\021GetFindingRequest\022\014\n\004name\030\001" + + " \001(\t\"\\\n\023ListFindingsRequest\022\016\n\006parent\030\001 " + + "\001(\t\022\016\n\006filter\030\002 \001(\t\022\022\n\npage_token\030\003 \001(\t\022" + + "\021\n\tpage_size\030\004 \001(\005\"n\n\024ListFindingsRespon" + + "se\022=\n\010findings\030\001 \003(\0132+.google.cloud.webs" + + "ecurityscanner.v1.Finding\022\027\n\017next_page_t" + + "oken\030\002 \001(\t\"-\n\033ListFindingTypeStatsReques" + + "t\022\016\n\006parent\030\001 \001(\t\"p\n\034ListFindingTypeStat" + + "sResponse\022P\n\022finding_type_stats\030\001 \003(\01324." + + "google.cloud.websecurityscanner.v1.Findi" + + "ngTypeStats2\351\023\n\022WebSecurityScanner\022\271\001\n\020C" + + "reateScanConfig\022;.google.cloud.websecuri" + + "tyscanner.v1.CreateScanConfigRequest\032..g" + + "oogle.cloud.websecurityscanner.v1.ScanCo" + + "nfig\"8\202\323\344\223\0022\"#/v1/{parent=projects/*}/sc" + + "anConfigs:\013scan_config\022\224\001\n\020DeleteScanCon" + + "fig\022;.google.cloud.websecurityscanner.v1" + + ".DeleteScanConfigRequest\032\026.google.protob" + + "uf.Empty\"+\202\323\344\223\002%*#/v1/{name=projects/*/s" + + "canConfigs/*}\022\246\001\n\rGetScanConfig\0228.google" + + ".cloud.websecurityscanner.v1.GetScanConf" + + "igRequest\032..google.cloud.websecurityscan" + + "ner.v1.ScanConfig\"+\202\323\344\223\002%\022#/v1/{name=pro" + + "jects/*/scanConfigs/*}\022\267\001\n\017ListScanConfi" + + "gs\022:.google.cloud.websecurityscanner.v1." + + "ListScanConfigsRequest\032;.google.cloud.we" + + "bsecurityscanner.v1.ListScanConfigsRespo" + + "nse\"+\202\323\344\223\002%\022#/v1/{parent=projects/*}/sca" + + "nConfigs\022\305\001\n\020UpdateScanConfig\022;.google.c" + + "loud.websecurityscanner.v1.UpdateScanCon" + + "figRequest\032..google.cloud.websecuritysca" + + "nner.v1.ScanConfig\"D\202\323\344\223\002>2//v1/{scan_co" + + "nfig.name=projects/*/scanConfigs/*}:\013sca" + + "n_config\022\252\001\n\014StartScanRun\0227.google.cloud" + + ".websecurityscanner.v1.StartScanRunReque" + + "st\032+.google.cloud.websecurityscanner.v1." + + "ScanRun\"4\202\323\344\223\002.\")/v1/{name=projects/*/sc" + + "anConfigs/*}:start:\001*\022\250\001\n\nGetScanRun\0225.g" + + "oogle.cloud.websecurityscanner.v1.GetSca" + + "nRunRequest\032+.google.cloud.websecuritysc" + + "anner.v1.ScanRun\"6\202\323\344\223\0020\022./v1/{name=proj" + + "ects/*/scanConfigs/*/scanRuns/*}\022\271\001\n\014Lis" + + "tScanRuns\0227.google.cloud.websecurityscan" + + "ner.v1.ListScanRunsRequest\0328.google.clou" + + "d.websecurityscanner.v1.ListScanRunsResp" + + "onse\"6\202\323\344\223\0020\022./v1/{parent=projects/*/sca" + + "nConfigs/*}/scanRuns\022\262\001\n\013StopScanRun\0226.g" + + "oogle.cloud.websecurityscanner.v1.StopSc" + + "anRunRequest\032+.google.cloud.websecuritys" + + "canner.v1.ScanRun\">\202\323\344\223\0028\"3/v1/{name=pro" + + "jects/*/scanConfigs/*/scanRuns/*}:stop:\001" + + "*\022\320\001\n\017ListCrawledUrls\022:.google.cloud.web" + + "securityscanner.v1.ListCrawledUrlsReques" + + "t\032;.google.cloud.websecurityscanner.v1.L" + + "istCrawledUrlsResponse\"D\202\323\344\223\002>\022 + * Information reported for an XSS. + * + * + * Protobuf type {@code google.cloud.websecurityscanner.v1.Xss} + */ +public final class Xss extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.websecurityscanner.v1.Xss) + XssOrBuilder { + private static final long serialVersionUID = 0L; + // Use Xss.newBuilder() to construct. + private Xss(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Xss() { + stackTraces_ = com.google.protobuf.LazyStringArrayList.EMPTY; + errorMessage_ = ""; + attackVector_ = 0; + storedXssSeedingUrl_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Xss(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Xss( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + stackTraces_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + stackTraces_.add(s); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + errorMessage_ = s; + break; + } + case 24: + { + int rawValue = input.readEnum(); + + attackVector_ = rawValue; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + storedXssSeedingUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + stackTraces_ = stackTraces_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Xss_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Xss_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.Xss.class, + com.google.cloud.websecurityscanner.v1.Xss.Builder.class); + } + + /** + * + * + *
+   * Types of XSS attack vector.
+   * 
+ * + * Protobuf enum {@code google.cloud.websecurityscanner.v1.Xss.AttackVector} + */ + public enum AttackVector implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unknown attack vector.
+     * 
+ * + * ATTACK_VECTOR_UNSPECIFIED = 0; + */ + ATTACK_VECTOR_UNSPECIFIED(0), + /** + * + * + *
+     * The attack comes from fuzzing the browser's localStorage.
+     * 
+ * + * LOCAL_STORAGE = 1; + */ + LOCAL_STORAGE(1), + /** + * + * + *
+     * The attack comes from fuzzing the browser's sessionStorage.
+     * 
+ * + * SESSION_STORAGE = 2; + */ + SESSION_STORAGE(2), + /** + * + * + *
+     * The attack comes from fuzzing the window's name property.
+     * 
+ * + * WINDOW_NAME = 3; + */ + WINDOW_NAME(3), + /** + * + * + *
+     * The attack comes from fuzzing the referrer property.
+     * 
+ * + * REFERRER = 4; + */ + REFERRER(4), + /** + * + * + *
+     * The attack comes from fuzzing an input element.
+     * 
+ * + * FORM_INPUT = 5; + */ + FORM_INPUT(5), + /** + * + * + *
+     * The attack comes from fuzzing the browser's cookies.
+     * 
+ * + * COOKIE = 6; + */ + COOKIE(6), + /** + * + * + *
+     * The attack comes from hijacking the post messaging mechanism.
+     * 
+ * + * POST_MESSAGE = 7; + */ + POST_MESSAGE(7), + /** + * + * + *
+     * The attack comes from fuzzing parameters in the url.
+     * 
+ * + * GET_PARAMETERS = 8; + */ + GET_PARAMETERS(8), + /** + * + * + *
+     * The attack comes from fuzzing the fragment in the url.
+     * 
+ * + * URL_FRAGMENT = 9; + */ + URL_FRAGMENT(9), + /** + * + * + *
+     * The attack comes from fuzzing the HTML comments.
+     * 
+ * + * HTML_COMMENT = 10; + */ + HTML_COMMENT(10), + /** + * + * + *
+     * The attack comes from fuzzing the POST parameters.
+     * 
+ * + * POST_PARAMETERS = 11; + */ + POST_PARAMETERS(11), + /** + * + * + *
+     * The attack comes from fuzzing the protocol.
+     * 
+ * + * PROTOCOL = 12; + */ + PROTOCOL(12), + /** + * + * + *
+     * The attack comes from the server side and is stored.
+     * 
+ * + * STORED_XSS = 13; + */ + STORED_XSS(13), + /** + * + * + *
+     * The attack is a Same-Origin Method Execution attack via a GET parameter.
+     * 
+ * + * SAME_ORIGIN = 14; + */ + SAME_ORIGIN(14), + /** + * + * + *
+     * The attack payload is received from a third-party host via a URL that is
+     * user-controllable
+     * 
+ * + * USER_CONTROLLABLE_URL = 15; + */ + USER_CONTROLLABLE_URL(15), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unknown attack vector.
+     * 
+ * + * ATTACK_VECTOR_UNSPECIFIED = 0; + */ + public static final int ATTACK_VECTOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The attack comes from fuzzing the browser's localStorage.
+     * 
+ * + * LOCAL_STORAGE = 1; + */ + public static final int LOCAL_STORAGE_VALUE = 1; + /** + * + * + *
+     * The attack comes from fuzzing the browser's sessionStorage.
+     * 
+ * + * SESSION_STORAGE = 2; + */ + public static final int SESSION_STORAGE_VALUE = 2; + /** + * + * + *
+     * The attack comes from fuzzing the window's name property.
+     * 
+ * + * WINDOW_NAME = 3; + */ + public static final int WINDOW_NAME_VALUE = 3; + /** + * + * + *
+     * The attack comes from fuzzing the referrer property.
+     * 
+ * + * REFERRER = 4; + */ + public static final int REFERRER_VALUE = 4; + /** + * + * + *
+     * The attack comes from fuzzing an input element.
+     * 
+ * + * FORM_INPUT = 5; + */ + public static final int FORM_INPUT_VALUE = 5; + /** + * + * + *
+     * The attack comes from fuzzing the browser's cookies.
+     * 
+ * + * COOKIE = 6; + */ + public static final int COOKIE_VALUE = 6; + /** + * + * + *
+     * The attack comes from hijacking the post messaging mechanism.
+     * 
+ * + * POST_MESSAGE = 7; + */ + public static final int POST_MESSAGE_VALUE = 7; + /** + * + * + *
+     * The attack comes from fuzzing parameters in the url.
+     * 
+ * + * GET_PARAMETERS = 8; + */ + public static final int GET_PARAMETERS_VALUE = 8; + /** + * + * + *
+     * The attack comes from fuzzing the fragment in the url.
+     * 
+ * + * URL_FRAGMENT = 9; + */ + public static final int URL_FRAGMENT_VALUE = 9; + /** + * + * + *
+     * The attack comes from fuzzing the HTML comments.
+     * 
+ * + * HTML_COMMENT = 10; + */ + public static final int HTML_COMMENT_VALUE = 10; + /** + * + * + *
+     * The attack comes from fuzzing the POST parameters.
+     * 
+ * + * POST_PARAMETERS = 11; + */ + public static final int POST_PARAMETERS_VALUE = 11; + /** + * + * + *
+     * The attack comes from fuzzing the protocol.
+     * 
+ * + * PROTOCOL = 12; + */ + public static final int PROTOCOL_VALUE = 12; + /** + * + * + *
+     * The attack comes from the server side and is stored.
+     * 
+ * + * STORED_XSS = 13; + */ + public static final int STORED_XSS_VALUE = 13; + /** + * + * + *
+     * The attack is a Same-Origin Method Execution attack via a GET parameter.
+     * 
+ * + * SAME_ORIGIN = 14; + */ + public static final int SAME_ORIGIN_VALUE = 14; + /** + * + * + *
+     * The attack payload is received from a third-party host via a URL that is
+     * user-controllable
+     * 
+ * + * USER_CONTROLLABLE_URL = 15; + */ + public static final int USER_CONTROLLABLE_URL_VALUE = 15; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AttackVector valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static AttackVector forNumber(int value) { + switch (value) { + case 0: + return ATTACK_VECTOR_UNSPECIFIED; + case 1: + return LOCAL_STORAGE; + case 2: + return SESSION_STORAGE; + case 3: + return WINDOW_NAME; + case 4: + return REFERRER; + case 5: + return FORM_INPUT; + case 6: + return COOKIE; + case 7: + return POST_MESSAGE; + case 8: + return GET_PARAMETERS; + case 9: + return URL_FRAGMENT; + case 10: + return HTML_COMMENT; + case 11: + return POST_PARAMETERS; + case 12: + return PROTOCOL; + case 13: + return STORED_XSS; + case 14: + return SAME_ORIGIN; + case 15: + return USER_CONTROLLABLE_URL; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AttackVector findValueByNumber(int number) { + return AttackVector.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.Xss.getDescriptor().getEnumTypes().get(0); + } + + private static final AttackVector[] VALUES = values(); + + public static AttackVector valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private AttackVector(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.websecurityscanner.v1.Xss.AttackVector) + } + + public static final int STACK_TRACES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList stackTraces_; + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @return A list containing the stackTraces. + */ + public com.google.protobuf.ProtocolStringList getStackTracesList() { + return stackTraces_; + } + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @return The count of stackTraces. + */ + public int getStackTracesCount() { + return stackTraces_.size(); + } + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index of the element to return. + * @return The stackTraces at the given index. + */ + public java.lang.String getStackTraces(int index) { + return stackTraces_.get(index); + } + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the stackTraces at the given index. + */ + public com.google.protobuf.ByteString getStackTracesBytes(int index) { + return stackTraces_.getByteString(index); + } + + public static final int ERROR_MESSAGE_FIELD_NUMBER = 2; + private volatile java.lang.Object errorMessage_; + /** + * + * + *
+   * An error message generated by a javascript breakage.
+   * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + @java.lang.Override + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } + } + /** + * + * + *
+   * An error message generated by a javascript breakage.
+   * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + @java.lang.Override + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ATTACK_VECTOR_FIELD_NUMBER = 3; + private int attackVector_; + /** + * + * + *
+   * The attack vector of the payload triggering this XSS.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return The enum numeric value on the wire for attackVector. + */ + @java.lang.Override + public int getAttackVectorValue() { + return attackVector_; + } + /** + * + * + *
+   * The attack vector of the payload triggering this XSS.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return The attackVector. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss.AttackVector getAttackVector() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.Xss.AttackVector result = + com.google.cloud.websecurityscanner.v1.Xss.AttackVector.valueOf(attackVector_); + return result == null + ? com.google.cloud.websecurityscanner.v1.Xss.AttackVector.UNRECOGNIZED + : result; + } + + public static final int STORED_XSS_SEEDING_URL_FIELD_NUMBER = 4; + private volatile java.lang.Object storedXssSeedingUrl_; + /** + * + * + *
+   * The reproduction url for the seeding POST request of a Stored XSS.
+   * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return The storedXssSeedingUrl. + */ + @java.lang.Override + public java.lang.String getStoredXssSeedingUrl() { + java.lang.Object ref = storedXssSeedingUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storedXssSeedingUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The reproduction url for the seeding POST request of a Stored XSS.
+   * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return The bytes for storedXssSeedingUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getStoredXssSeedingUrlBytes() { + java.lang.Object ref = storedXssSeedingUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + storedXssSeedingUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < stackTraces_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, stackTraces_.getRaw(i)); + } + if (!getErrorMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); + } + if (attackVector_ + != com.google.cloud.websecurityscanner.v1.Xss.AttackVector.ATTACK_VECTOR_UNSPECIFIED + .getNumber()) { + output.writeEnum(3, attackVector_); + } + if (!getStoredXssSeedingUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, storedXssSeedingUrl_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < stackTraces_.size(); i++) { + dataSize += computeStringSizeNoTag(stackTraces_.getRaw(i)); + } + size += dataSize; + size += 1 * getStackTracesList().size(); + } + if (!getErrorMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); + } + if (attackVector_ + != com.google.cloud.websecurityscanner.v1.Xss.AttackVector.ATTACK_VECTOR_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(3, attackVector_); + } + if (!getStoredXssSeedingUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, storedXssSeedingUrl_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.websecurityscanner.v1.Xss)) { + return super.equals(obj); + } + com.google.cloud.websecurityscanner.v1.Xss other = + (com.google.cloud.websecurityscanner.v1.Xss) obj; + + if (!getStackTracesList().equals(other.getStackTracesList())) return false; + if (!getErrorMessage().equals(other.getErrorMessage())) return false; + if (attackVector_ != other.attackVector_) return false; + if (!getStoredXssSeedingUrl().equals(other.getStoredXssSeedingUrl())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getStackTracesCount() > 0) { + hash = (37 * hash) + STACK_TRACES_FIELD_NUMBER; + hash = (53 * hash) + getStackTracesList().hashCode(); + } + hash = (37 * hash) + ERROR_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getErrorMessage().hashCode(); + hash = (37 * hash) + ATTACK_VECTOR_FIELD_NUMBER; + hash = (53 * hash) + attackVector_; + hash = (37 * hash) + STORED_XSS_SEEDING_URL_FIELD_NUMBER; + hash = (53 * hash) + getStoredXssSeedingUrl().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.websecurityscanner.v1.Xss parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.websecurityscanner.v1.Xss prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Information reported for an XSS.
+   * 
+ * + * Protobuf type {@code google.cloud.websecurityscanner.v1.Xss} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.websecurityscanner.v1.Xss) + com.google.cloud.websecurityscanner.v1.XssOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Xss_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Xss_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.websecurityscanner.v1.Xss.class, + com.google.cloud.websecurityscanner.v1.Xss.Builder.class); + } + + // Construct using com.google.cloud.websecurityscanner.v1.Xss.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + stackTraces_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + errorMessage_ = ""; + + attackVector_ = 0; + + storedXssSeedingUrl_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.websecurityscanner.v1.FindingAddonProto + .internal_static_google_cloud_websecurityscanner_v1_Xss_descriptor; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss getDefaultInstanceForType() { + return com.google.cloud.websecurityscanner.v1.Xss.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss build() { + com.google.cloud.websecurityscanner.v1.Xss result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss buildPartial() { + com.google.cloud.websecurityscanner.v1.Xss result = + new com.google.cloud.websecurityscanner.v1.Xss(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + stackTraces_ = stackTraces_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.stackTraces_ = stackTraces_; + result.errorMessage_ = errorMessage_; + result.attackVector_ = attackVector_; + result.storedXssSeedingUrl_ = storedXssSeedingUrl_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.websecurityscanner.v1.Xss) { + return mergeFrom((com.google.cloud.websecurityscanner.v1.Xss) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.websecurityscanner.v1.Xss other) { + if (other == com.google.cloud.websecurityscanner.v1.Xss.getDefaultInstance()) return this; + if (!other.stackTraces_.isEmpty()) { + if (stackTraces_.isEmpty()) { + stackTraces_ = other.stackTraces_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStackTracesIsMutable(); + stackTraces_.addAll(other.stackTraces_); + } + onChanged(); + } + if (!other.getErrorMessage().isEmpty()) { + errorMessage_ = other.errorMessage_; + onChanged(); + } + if (other.attackVector_ != 0) { + setAttackVectorValue(other.getAttackVectorValue()); + } + if (!other.getStoredXssSeedingUrl().isEmpty()) { + storedXssSeedingUrl_ = other.storedXssSeedingUrl_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.websecurityscanner.v1.Xss parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.websecurityscanner.v1.Xss) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList stackTraces_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureStackTracesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + stackTraces_ = new com.google.protobuf.LazyStringArrayList(stackTraces_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @return A list containing the stackTraces. + */ + public com.google.protobuf.ProtocolStringList getStackTracesList() { + return stackTraces_.getUnmodifiableView(); + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @return The count of stackTraces. + */ + public int getStackTracesCount() { + return stackTraces_.size(); + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index of the element to return. + * @return The stackTraces at the given index. + */ + public java.lang.String getStackTraces(int index) { + return stackTraces_.get(index); + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the stackTraces at the given index. + */ + public com.google.protobuf.ByteString getStackTracesBytes(int index) { + return stackTraces_.getByteString(index); + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index to set the value at. + * @param value The stackTraces to set. + * @return This builder for chaining. + */ + public Builder setStackTraces(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStackTracesIsMutable(); + stackTraces_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @param value The stackTraces to add. + * @return This builder for chaining. + */ + public Builder addStackTraces(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureStackTracesIsMutable(); + stackTraces_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @param values The stackTraces to add. + * @return This builder for chaining. + */ + public Builder addAllStackTraces(java.lang.Iterable values) { + ensureStackTracesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stackTraces_); + onChanged(); + return this; + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @return This builder for chaining. + */ + public Builder clearStackTraces() { + stackTraces_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Stack traces leading to the point where the XSS occurred.
+     * 
+ * + * repeated string stack_traces = 1; + * + * @param value The bytes of the stackTraces to add. + * @return This builder for chaining. + */ + public Builder addStackTracesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureStackTracesIsMutable(); + stackTraces_.add(value); + onChanged(); + return this; + } + + private java.lang.Object errorMessage_ = ""; + /** + * + * + *
+     * An error message generated by a javascript breakage.
+     * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + public java.lang.String getErrorMessage() { + java.lang.Object ref = errorMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + errorMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * An error message generated by a javascript breakage.
+     * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + public com.google.protobuf.ByteString getErrorMessageBytes() { + java.lang.Object ref = errorMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + errorMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * An error message generated by a javascript breakage.
+     * 
+ * + * string error_message = 2; + * + * @param value The errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessage(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + errorMessage_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * An error message generated by a javascript breakage.
+     * 
+ * + * string error_message = 2; + * + * @return This builder for chaining. + */ + public Builder clearErrorMessage() { + + errorMessage_ = getDefaultInstance().getErrorMessage(); + onChanged(); + return this; + } + /** + * + * + *
+     * An error message generated by a javascript breakage.
+     * 
+ * + * string error_message = 2; + * + * @param value The bytes for errorMessage to set. + * @return This builder for chaining. + */ + public Builder setErrorMessageBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + errorMessage_ = value; + onChanged(); + return this; + } + + private int attackVector_ = 0; + /** + * + * + *
+     * The attack vector of the payload triggering this XSS.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return The enum numeric value on the wire for attackVector. + */ + @java.lang.Override + public int getAttackVectorValue() { + return attackVector_; + } + /** + * + * + *
+     * The attack vector of the payload triggering this XSS.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @param value The enum numeric value on the wire for attackVector to set. + * @return This builder for chaining. + */ + public Builder setAttackVectorValue(int value) { + + attackVector_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The attack vector of the payload triggering this XSS.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return The attackVector. + */ + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss.AttackVector getAttackVector() { + @SuppressWarnings("deprecation") + com.google.cloud.websecurityscanner.v1.Xss.AttackVector result = + com.google.cloud.websecurityscanner.v1.Xss.AttackVector.valueOf(attackVector_); + return result == null + ? com.google.cloud.websecurityscanner.v1.Xss.AttackVector.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The attack vector of the payload triggering this XSS.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @param value The attackVector to set. + * @return This builder for chaining. + */ + public Builder setAttackVector(com.google.cloud.websecurityscanner.v1.Xss.AttackVector value) { + if (value == null) { + throw new NullPointerException(); + } + + attackVector_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The attack vector of the payload triggering this XSS.
+     * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return This builder for chaining. + */ + public Builder clearAttackVector() { + + attackVector_ = 0; + onChanged(); + return this; + } + + private java.lang.Object storedXssSeedingUrl_ = ""; + /** + * + * + *
+     * The reproduction url for the seeding POST request of a Stored XSS.
+     * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return The storedXssSeedingUrl. + */ + public java.lang.String getStoredXssSeedingUrl() { + java.lang.Object ref = storedXssSeedingUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storedXssSeedingUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The reproduction url for the seeding POST request of a Stored XSS.
+     * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return The bytes for storedXssSeedingUrl. + */ + public com.google.protobuf.ByteString getStoredXssSeedingUrlBytes() { + java.lang.Object ref = storedXssSeedingUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + storedXssSeedingUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The reproduction url for the seeding POST request of a Stored XSS.
+     * 
+ * + * string stored_xss_seeding_url = 4; + * + * @param value The storedXssSeedingUrl to set. + * @return This builder for chaining. + */ + public Builder setStoredXssSeedingUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storedXssSeedingUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The reproduction url for the seeding POST request of a Stored XSS.
+     * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return This builder for chaining. + */ + public Builder clearStoredXssSeedingUrl() { + + storedXssSeedingUrl_ = getDefaultInstance().getStoredXssSeedingUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The reproduction url for the seeding POST request of a Stored XSS.
+     * 
+ * + * string stored_xss_seeding_url = 4; + * + * @param value The bytes for storedXssSeedingUrl to set. + * @return This builder for chaining. + */ + public Builder setStoredXssSeedingUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storedXssSeedingUrl_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.websecurityscanner.v1.Xss) + } + + // @@protoc_insertion_point(class_scope:google.cloud.websecurityscanner.v1.Xss) + private static final com.google.cloud.websecurityscanner.v1.Xss DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.websecurityscanner.v1.Xss(); + } + + public static com.google.cloud.websecurityscanner.v1.Xss getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Xss parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Xss(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.websecurityscanner.v1.Xss getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/XssOrBuilder.java b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/XssOrBuilder.java new file mode 100644 index 00000000..28d99d6c --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/java/com/google/cloud/websecurityscanner/v1/XssOrBuilder.java @@ -0,0 +1,151 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/websecurityscanner/v1/finding_addon.proto + +package com.google.cloud.websecurityscanner.v1; + +public interface XssOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.websecurityscanner.v1.Xss) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @return A list containing the stackTraces. + */ + java.util.List getStackTracesList(); + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @return The count of stackTraces. + */ + int getStackTracesCount(); + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index of the element to return. + * @return The stackTraces at the given index. + */ + java.lang.String getStackTraces(int index); + /** + * + * + *
+   * Stack traces leading to the point where the XSS occurred.
+   * 
+ * + * repeated string stack_traces = 1; + * + * @param index The index of the value to return. + * @return The bytes of the stackTraces at the given index. + */ + com.google.protobuf.ByteString getStackTracesBytes(int index); + + /** + * + * + *
+   * An error message generated by a javascript breakage.
+   * 
+ * + * string error_message = 2; + * + * @return The errorMessage. + */ + java.lang.String getErrorMessage(); + /** + * + * + *
+   * An error message generated by a javascript breakage.
+   * 
+ * + * string error_message = 2; + * + * @return The bytes for errorMessage. + */ + com.google.protobuf.ByteString getErrorMessageBytes(); + + /** + * + * + *
+   * The attack vector of the payload triggering this XSS.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return The enum numeric value on the wire for attackVector. + */ + int getAttackVectorValue(); + /** + * + * + *
+   * The attack vector of the payload triggering this XSS.
+   * 
+ * + * .google.cloud.websecurityscanner.v1.Xss.AttackVector attack_vector = 3; + * + * @return The attackVector. + */ + com.google.cloud.websecurityscanner.v1.Xss.AttackVector getAttackVector(); + + /** + * + * + *
+   * The reproduction url for the seeding POST request of a Stored XSS.
+   * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return The storedXssSeedingUrl. + */ + java.lang.String getStoredXssSeedingUrl(); + /** + * + * + *
+   * The reproduction url for the seeding POST request of a Stored XSS.
+   * 
+ * + * string stored_xss_seeding_url = 4; + * + * @return The bytes for storedXssSeedingUrl. + */ + com.google.protobuf.ByteString getStoredXssSeedingUrlBytes(); +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/crawled_url.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/crawled_url.proto new file mode 100644 index 00000000..b64eb402 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/crawled_url.proto @@ -0,0 +1,37 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "CrawledUrlProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web +// Security Scanner Service crawls the web applications, following all links +// within the scope of sites, to find the URLs to test against. +message CrawledUrl { + // Output only. The http method of the request that was used to visit the URL, in + // uppercase. + string http_method = 1; + + // Output only. The URL that was crawled. + string url = 2; + + // Output only. The body of the request that was used to visit the URL. + string body = 3; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding.proto new file mode 100644 index 00000000..7a8cdf96 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding.proto @@ -0,0 +1,116 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/websecurityscanner/v1/finding_addon.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// A Finding resource represents a vulnerability instance identified during a +// ScanRun. +message Finding { + option (google.api.resource) = { + type: "websecurityscanner.googleapis.com/Finding" + pattern: "projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}" + }; + + // The severity level of a vulnerability. + enum Severity { + // No severity specified. The default value. + SEVERITY_UNSPECIFIED = 0; + + // Critical severity. + CRITICAL = 1; + + // High severity. + HIGH = 2; + + // Medium severity. + MEDIUM = 3; + + // Low severity. + LOW = 4; + } + + // Output only. The resource name of the Finding. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanruns/{scanRunId}/findings/{findingId}'. + // The finding IDs are generated by the system. + string name = 1; + + // Output only. The type of the Finding. + // Detailed and up-to-date information on findings can be found here: + // https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings + string finding_type = 2; + + // Output only. The severity level of the reported vulnerability. + Severity severity = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The http method of the request that triggered the vulnerability, in + // uppercase. + string http_method = 3; + + // Output only. The URL produced by the server-side fuzzer and used in the request that + // triggered the vulnerability. + string fuzzed_url = 4; + + // Output only. The body of the request that triggered the vulnerability. + string body = 5; + + // Output only. The description of the vulnerability. + string description = 6; + + // Output only. The URL containing human-readable payload that user can leverage to + // reproduce the vulnerability. + string reproduction_url = 7; + + // Output only. If the vulnerability was originated from nested IFrame, the immediate + // parent IFrame is reported. + string frame_url = 8; + + // Output only. The URL where the browser lands when the vulnerability is detected. + string final_url = 9; + + // Output only. The tracking ID uniquely identifies a vulnerability instance across + // multiple ScanRuns. + string tracking_id = 10; + + // Output only. An addon containing information reported for a vulnerability with an HTML + // form, if any. + Form form = 16; + + // Output only. An addon containing information about outdated libraries. + OutdatedLibrary outdated_library = 11; + + // Output only. An addon containing detailed information regarding any resource causing the + // vulnerability such as JavaScript sources, image, audio files, etc. + ViolatingResource violating_resource = 12; + + // Output only. An addon containing information about vulnerable or missing HTTP headers. + VulnerableHeaders vulnerable_headers = 15; + + // Output only. An addon containing information about request parameters which were found + // to be vulnerable. + VulnerableParameters vulnerable_parameters = 13; + + // Output only. An addon containing information reported for an XSS, if any. + Xss xss = 14; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding_addon.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding_addon.proto new file mode 100644 index 00000000..c171ca3b --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding_addon.proto @@ -0,0 +1,144 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingAddonProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// ! Information about a vulnerability with an HTML. +message Form { + // ! The URI where to send the form when it's submitted. + string action_uri = 1; + + // ! The names of form fields related to the vulnerability. + repeated string fields = 2; +} + +// Information reported for an outdated library. +message OutdatedLibrary { + // The name of the outdated library. + string library_name = 1; + + // The version number. + string version = 2; + + // URLs to learn more information about the vulnerabilities in the library. + repeated string learn_more_urls = 3; +} + +// Information regarding any resource causing the vulnerability such +// as JavaScript sources, image, audio files, etc. +message ViolatingResource { + // The MIME type of this resource. + string content_type = 1; + + // URL of this violating resource. + string resource_url = 2; +} + +// Information about vulnerable request parameters. +message VulnerableParameters { + // The vulnerable parameter names. + repeated string parameter_names = 1; +} + +// Information about vulnerable or missing HTTP Headers. +message VulnerableHeaders { + // Describes a HTTP Header. + message Header { + // Header name. + string name = 1; + + // Header value. + string value = 2; + } + + // List of vulnerable headers. + repeated Header headers = 1; + + // List of missing headers. + repeated Header missing_headers = 2; +} + +// Information reported for an XSS. +message Xss { + // Types of XSS attack vector. + enum AttackVector { + // Unknown attack vector. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The attack comes from fuzzing the browser's localStorage. + LOCAL_STORAGE = 1; + + // The attack comes from fuzzing the browser's sessionStorage. + SESSION_STORAGE = 2; + + // The attack comes from fuzzing the window's name property. + WINDOW_NAME = 3; + + // The attack comes from fuzzing the referrer property. + REFERRER = 4; + + // The attack comes from fuzzing an input element. + FORM_INPUT = 5; + + // The attack comes from fuzzing the browser's cookies. + COOKIE = 6; + + // The attack comes from hijacking the post messaging mechanism. + POST_MESSAGE = 7; + + // The attack comes from fuzzing parameters in the url. + GET_PARAMETERS = 8; + + // The attack comes from fuzzing the fragment in the url. + URL_FRAGMENT = 9; + + // The attack comes from fuzzing the HTML comments. + HTML_COMMENT = 10; + + // The attack comes from fuzzing the POST parameters. + POST_PARAMETERS = 11; + + // The attack comes from fuzzing the protocol. + PROTOCOL = 12; + + // The attack comes from the server side and is stored. + STORED_XSS = 13; + + // The attack is a Same-Origin Method Execution attack via a GET parameter. + SAME_ORIGIN = 14; + + // The attack payload is received from a third-party host via a URL that is + // user-controllable + USER_CONTROLLABLE_URL = 15; + } + + // Stack traces leading to the point where the XSS occurred. + repeated string stack_traces = 1; + + // An error message generated by a javascript breakage. + string error_message = 2; + + // The attack vector of the payload triggering this XSS. + AttackVector attack_vector = 3; + + // The reproduction url for the seeding POST request of a Stored XSS. + string stored_xss_seeding_url = 4; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding_type_stats.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding_type_stats.proto new file mode 100644 index 00000000..66419f76 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/finding_type_stats.proto @@ -0,0 +1,32 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "FindingTypeStatsProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// A FindingTypeStats resource represents stats regarding a specific FindingType +// of Findings under a given ScanRun. +message FindingTypeStats { + // Output only. The finding type associated with the stats. + string finding_type = 1; + + // Output only. The count of findings belonging to this finding type. + int32 finding_count = 2; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_config.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_config.proto new file mode 100644 index 00000000..f5cf4f67 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_config.proto @@ -0,0 +1,185 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// A ScanConfig resource contains the configurations to launch a scan. +message ScanConfig { + // Scan authentication configuration. + message Authentication { + // Describes authentication configuration that uses a Google account. + message GoogleAccount { + // Required. The user name of the Google account. + string username = 1; + + // Required. Input only. The password of the Google account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2; + } + + // Describes authentication configuration that uses a custom account. + message CustomAccount { + // Required. The user name of the custom account. + string username = 1; + + // Required. Input only. The password of the custom account. The credential is stored encrypted + // and not returned in any response nor included in audit logs. + string password = 2; + + // Required. The login form URL of the website. + string login_url = 3; + } + + // Describes authentication configuration for Identity-Aware-Proxy (IAP). + message IapCredential { + // Describes authentication configuration when Web-Security-Scanner + // service account is added in Identity-Aware-Proxy (IAP) access policies. + message IapTestServiceAccountInfo { + // Required. Describes OAuth2 client id of resources protected by + // Identity-Aware-Proxy (IAP). + string target_audience_client_id = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Identity-Aware-Proxy (IAP) Authentication Configuration + oneof iap_credentials { + // Authentication configuration when Web-Security-Scanner service + // account is added in Identity-Aware-Proxy (IAP) access policies. + IapTestServiceAccountInfo iap_test_service_account_info = 1; + } + } + + // Required. + // Authentication configuration + oneof authentication { + // Authentication using a Google account. + GoogleAccount google_account = 1; + + // Authentication using a custom account. + CustomAccount custom_account = 2; + + // Authentication using Identity-Aware-Proxy (IAP). + IapCredential iap_credential = 4; + } + } + + // Scan schedule configuration. + message Schedule { + // A timestamp indicates when the next run will be scheduled. The value is + // refreshed by the server after each run. If unspecified, it will default + // to current server time, which means the scan will be scheduled to start + // immediately. + google.protobuf.Timestamp schedule_time = 1; + + // Required. The duration of time between executions in days. + int32 interval_duration_days = 2; + } + + // Type of user agents used for scanning. + enum UserAgent { + // The user agent is unknown. Service will default to CHROME_LINUX. + USER_AGENT_UNSPECIFIED = 0; + + // Chrome on Linux. This is the service default if unspecified. + CHROME_LINUX = 1; + + // Chrome on Android. + CHROME_ANDROID = 2; + + // Safari on IPhone. + SAFARI_IPHONE = 3; + } + + // Scan risk levels supported by Web Security Scanner. LOW impact + // scanning will minimize requests with the potential to modify data. To + // achieve the maximum scan coverage, NORMAL risk level is recommended. + enum RiskLevel { + // Use default, which is NORMAL. + RISK_LEVEL_UNSPECIFIED = 0; + + // Normal scanning (Recommended) + NORMAL = 1; + + // Lower impact scanning + LOW = 2; + } + + // Controls export of scan configurations and results to Security + // Command Center. + enum ExportToSecurityCommandCenter { + // Use default, which is ENABLED. + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0; + + // Export results of this scan to Security Command Center. + ENABLED = 1; + + // Do not export results of this scan to Security Command Center. + DISABLED = 2; + } + + // The resource name of the ScanConfig. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}'. The ScanConfig IDs are + // generated by the system. + string name = 1; + + // Required. The user provided display name of the ScanConfig. + string display_name = 2; + + // The maximum QPS during scanning. A valid value ranges from 5 to 20 + // inclusively. If the field is unspecified or its value is set 0, server will + // default to 15. Other values outside of [5, 20] range will be rejected with + // INVALID_ARGUMENT error. + int32 max_qps = 3; + + // Required. The starting URLs from which the scanner finds site pages. + repeated string starting_urls = 4; + + // The authentication configuration. If specified, service will use the + // authentication configuration during scanning. + Authentication authentication = 5; + + // The user agent used during scanning. + UserAgent user_agent = 6; + + // The excluded URL patterns as described in + // https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls + repeated string blacklist_patterns = 7; + + // The schedule of the ScanConfig. + Schedule schedule = 8; + + // Controls export of scan configurations and results to Security + // Command Center. + ExportToSecurityCommandCenter export_to_security_command_center = 10; + + // The risk level selected for the scan + RiskLevel risk_level = 12; + + // Whether the scan config is managed by Web Security Scanner, output + // only. + bool managed_scan = 13; + + // Whether the scan configuration has enabled static IP address scan feature. + // If enabled, the scanner will access applications from static IP addresses. + bool static_ip_scan = 14; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_config_error.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_config_error.proto new file mode 100644 index 00000000..7618c393 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_config_error.proto @@ -0,0 +1,186 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanConfigErrorProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// Defines a custom error message used by CreateScanConfig and UpdateScanConfig +// APIs when scan configuration validation fails. It is also reported as part of +// a ScanRunErrorTrace message if scan validation fails due to a scan +// configuration error. +message ScanConfigError { + // Output only. + // Defines an error reason code. + // Next id: 44 + enum Code { + option allow_alias = true; + + // There is no error. + CODE_UNSPECIFIED = 0; + + // There is no error. + OK = 0; + + // Indicates an internal server error. + // Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. + INTERNAL_ERROR = 1; + + // One of the seed URLs is an App Engine URL but we cannot validate the scan + // settings due to an App Engine API backend error. + APPENGINE_API_BACKEND_ERROR = 2; + + // One of the seed URLs is an App Engine URL but we cannot access the + // App Engine API to validate scan settings. + APPENGINE_API_NOT_ACCESSIBLE = 3; + + // One of the seed URLs is an App Engine URL but the Default Host of the + // App Engine is not set. + APPENGINE_DEFAULT_HOST_MISSING = 4; + + // Google corporate accounts can not be used for scanning. + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6; + + // The account of the scan creator can not be used for scanning. + CANNOT_USE_OWNER_ACCOUNT = 7; + + // This scan targets Compute Engine, but we cannot validate scan settings + // due to a Compute Engine API backend error. + COMPUTE_API_BACKEND_ERROR = 8; + + // This scan targets Compute Engine, but we cannot access the Compute Engine + // API to validate the scan settings. + COMPUTE_API_NOT_ACCESSIBLE = 9; + + // The Custom Login URL does not belong to the current project. + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10; + + // The Custom Login URL is malformed (can not be parsed). + CUSTOM_LOGIN_URL_MALFORMED = 11; + + // The Custom Login URL is mapped to a non-routable IP address in DNS. + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12; + + // The Custom Login URL is mapped to an IP address which is not reserved for + // the current project. + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13; + + // The Custom Login URL has a non-routable IP address. + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14; + + // The Custom Login URL has an IP address which is not reserved for the + // current project. + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15; + + // Another scan with the same name (case-sensitive) already exists. + DUPLICATE_SCAN_NAME = 16; + + // A field is set to an invalid value. + INVALID_FIELD_VALUE = 18; + + // There was an error trying to authenticate to the scan target. + FAILED_TO_AUTHENTICATE_TO_TARGET = 19; + + // Finding type value is not specified in the list findings request. + FINDING_TYPE_UNSPECIFIED = 20; + + // Scan targets Compute Engine, yet current project was not whitelisted for + // Google Compute Engine Scanning Alpha access. + FORBIDDEN_TO_SCAN_COMPUTE = 21; + + // User tries to update managed scan + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43; + + // The supplied filter is malformed. For example, it can not be parsed, does + // not have a filter type in expression, or the same filter type appears + // more than once. + MALFORMED_FILTER = 22; + + // The supplied resource name is malformed (can not be parsed). + MALFORMED_RESOURCE_NAME = 23; + + // The current project is not in an active state. + PROJECT_INACTIVE = 24; + + // A required field is not set. + REQUIRED_FIELD = 25; + + // Project id, scanconfig id, scanrun id, or finding id are not consistent + // with each other in resource name. + RESOURCE_NAME_INCONSISTENT = 26; + + // The scan being requested to start is already running. + SCAN_ALREADY_RUNNING = 27; + + // The scan that was requested to be stopped is not running. + SCAN_NOT_RUNNING = 28; + + // One of the seed URLs does not belong to the current project. + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29; + + // One of the seed URLs is malformed (can not be parsed). + SEED_URL_MALFORMED = 30; + + // One of the seed URLs is mapped to a non-routable IP address in DNS. + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31; + + // One of the seed URLs is mapped to an IP address which is not reserved + // for the current project. + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32; + + // One of the seed URLs has on-routable IP address. + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33; + + // One of the seed URLs has an IP address that is not reserved + // for the current project. + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35; + + // The Web Security Scanner service account is not configured under the + // project. + SERVICE_ACCOUNT_NOT_CONFIGURED = 36; + + // A project has reached the maximum number of scans. + TOO_MANY_SCANS = 37; + + // Resolving the details of the current project fails. + UNABLE_TO_RESOLVE_PROJECT_INFO = 38; + + // One or more blacklist patterns were in the wrong format. + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39; + + // The supplied filter is not supported. + UNSUPPORTED_FILTER = 40; + + // The supplied finding type is not supported. For example, we do not + // provide findings of the given finding type. + UNSUPPORTED_FINDING_TYPE = 41; + + // The URL scheme of one or more of the supplied URLs is not supported. + UNSUPPORTED_URL_SCHEME = 42; + } + + // Output only. Indicates the reason code for a configuration failure. + Code code = 1; + + // Output only. Indicates the full name of the ScanConfig field that triggers this error, + // for example "scan_config.max_qps". This field is provided for + // troubleshooting purposes only and its actual value can change in the + // future. + string field_name = 2; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run.proto new file mode 100644 index 00000000..42335337 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run.proto @@ -0,0 +1,107 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/cloud/websecurityscanner/v1/scan_run_error_trace.proto"; +import "google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// A ScanRun is a output-only resource representing an actual run of the scan. +// Next id: 12 +message ScanRun { + // Types of ScanRun execution state. + enum ExecutionState { + // Represents an invalid state caused by internal server error. This value + // should never be returned. + EXECUTION_STATE_UNSPECIFIED = 0; + + // The scan is waiting in the queue. + QUEUED = 1; + + // The scan is in progress. + SCANNING = 2; + + // The scan is either finished or stopped by user. + FINISHED = 3; + } + + // Types of ScanRun result state. + enum ResultState { + // Default value. This value is returned when the ScanRun is not yet + // finished. + RESULT_STATE_UNSPECIFIED = 0; + + // The scan finished without errors. + SUCCESS = 1; + + // The scan finished with errors. + ERROR = 2; + + // The scan was terminated by user. + KILLED = 3; + } + + // Output only. The resource name of the ScanRun. The name follows the format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + // The ScanRun IDs are generated by the system. + string name = 1; + + // Output only. The execution state of the ScanRun. + ExecutionState execution_state = 2; + + // Output only. The result state of the ScanRun. This field is only available after the + // execution state reaches "FINISHED". + ResultState result_state = 3; + + // Output only. The time at which the ScanRun started. + google.protobuf.Timestamp start_time = 4; + + // Output only. The time at which the ScanRun reached termination state - that the ScanRun + // is either finished or stopped by user. + google.protobuf.Timestamp end_time = 5; + + // Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, + // the value represents the number of URLs crawled up to now. + int64 urls_crawled_count = 6; + + // Output only. The number of URLs tested during this ScanRun. If the scan is in progress, + // the value represents the number of URLs tested up to now. The number of + // URLs tested is usually larger than the number URLS crawled because + // typically a crawled URL is tested with multiple test payloads. + int64 urls_tested_count = 7; + + // Output only. Whether the scan run has found any vulnerabilities. + bool has_vulnerabilities = 8; + + // Output only. The percentage of total completion ranging from 0 to 100. + // If the scan is in queue, the value is 0. + // If the scan is running, the value ranges from 0 to 100. + // If the scan is finished, the value is 100. + int32 progress_percent = 9; + + // Output only. If result_state is an ERROR, this field provides the primary reason for + // scan's termination and more details, if such are available. + ScanRunErrorTrace error_trace = 10; + + // Output only. A list of warnings, if such are encountered during this scan run. + repeated ScanRunWarningTrace warning_traces = 11; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto new file mode 100644 index 00000000..bae9f880 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run_error_trace.proto @@ -0,0 +1,72 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/cloud/websecurityscanner/v1/scan_config_error.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunErrorTraceProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// Output only. +// Defines an error trace message for a ScanRun. +message ScanRunErrorTrace { + // Output only. + // Defines an error reason code. + // Next id: 7 + enum Code { + // Default value is never used. + CODE_UNSPECIFIED = 0; + + // Indicates that the scan run failed due to an internal server error. + INTERNAL_ERROR = 1; + + // Indicates a scan configuration error, usually due to outdated ScanConfig + // settings, such as starting_urls or the DNS configuration. + SCAN_CONFIG_ISSUE = 2; + + // Indicates an authentication error, usually due to outdated ScanConfig + // authentication settings. + AUTHENTICATION_CONFIG_ISSUE = 3; + + // Indicates a scan operation timeout, usually caused by a very large site. + TIMED_OUT_WHILE_SCANNING = 4; + + // Indicates that a scan encountered excessive redirects, either to + // authentication or some other page outside of the scan scope. + TOO_MANY_REDIRECTS = 5; + + // Indicates that a scan encountered numerous errors from the web site + // pages. When available, most_common_http_error_code field indicates the + // most common HTTP error code encountered during the scan. + TOO_MANY_HTTP_ERRORS = 6; + } + + // Output only. Indicates the error reason code. + Code code = 1; + + // Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error + // message encountered during scan configuration validation that is performed + // before each scan run. + ScanConfigError scan_config_error = 2; + + // Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most + // common HTTP error code, if such is available. For example, if this code is + // 404, the scan has encountered too many NOT_FOUND responses. + int32 most_common_http_error_code = 3; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto new file mode 100644 index 00000000..30c8b4f2 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto @@ -0,0 +1,55 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "ScanRunWarningTraceProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// Output only. +// Defines a warning trace message for ScanRun. Warning traces provide customers +// with useful information that helps make the scanning process more effective. +message ScanRunWarningTrace { + // Output only. + // Defines a warning message code. + // Next id: 6 + enum Code { + // Default value is never used. + CODE_UNSPECIFIED = 0; + + // Indicates that a scan discovered an unexpectedly low number of URLs. This + // is sometimes caused by complex navigation features or by using a single + // URL for numerous pages. + INSUFFICIENT_CRAWL_RESULTS = 1; + + // Indicates that a scan discovered too many URLs to test, or excessive + // redundant URLs. + TOO_MANY_CRAWL_RESULTS = 2; + + // Indicates that too many tests have been generated for the scan. Customer + // should try reducing the number of starting URLs, increasing the QPS rate, + // or narrowing down the scope of the scan using the excluded patterns. + TOO_MANY_FUZZ_TASKS = 3; + + // Indicates that a scan is blocked by IAP. + BLOCKED_BY_IAP = 4; + } + + // Output only. Indicates the warning code. + Code code = 1; +} diff --git a/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/web_security_scanner.proto b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/web_security_scanner.proto new file mode 100644 index 00000000..59955710 --- /dev/null +++ b/proto-google-cloud-websecurityscanner-v1/src/main/proto/google/cloud/websecurityscanner/v1/web_security_scanner.proto @@ -0,0 +1,334 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.websecurityscanner.v1; + +import "google/api/annotations.proto"; +import "google/cloud/websecurityscanner/v1/crawled_url.proto"; +import "google/cloud/websecurityscanner/v1/finding.proto"; +import "google/cloud/websecurityscanner/v1/finding_type_stats.proto"; +import "google/cloud/websecurityscanner/v1/scan_config.proto"; +import "google/cloud/websecurityscanner/v1/scan_run.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/api/client.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/websecurityscanner/v1;websecurityscanner"; +option java_multiple_files = true; +option java_outer_classname = "WebSecurityScannerProto"; +option java_package = "com.google.cloud.websecurityscanner.v1"; + +// Web Security Scanner Service identifies security vulnerabilities in web +// applications hosted on Google Cloud. It crawls your application, and +// attempts to exercise as many user inputs and event handlers as possible. +service WebSecurityScanner { + option (google.api.default_host) = "websecurityscanner.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Creates a new ScanConfig. + rpc CreateScanConfig(CreateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + post: "/v1/{parent=projects/*}/scanConfigs" + body: "scan_config" + }; + } + + // Deletes an existing ScanConfig and its child resources. + rpc DeleteScanConfig(DeleteScanConfigRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/scanConfigs/*}" + }; + } + + // Gets a ScanConfig. + rpc GetScanConfig(GetScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/scanConfigs/*}" + }; + } + + // Lists ScanConfigs under a given project. + rpc ListScanConfigs(ListScanConfigsRequest) returns (ListScanConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*}/scanConfigs" + }; + } + + // Updates a ScanConfig. This method support partial update of a ScanConfig. + rpc UpdateScanConfig(UpdateScanConfigRequest) returns (ScanConfig) { + option (google.api.http) = { + patch: "/v1/{scan_config.name=projects/*/scanConfigs/*}" + body: "scan_config" + }; + } + + // Start a ScanRun according to the given ScanConfig. + rpc StartScanRun(StartScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1/{name=projects/*/scanConfigs/*}:start" + body: "*" + }; + } + + // Gets a ScanRun. + rpc GetScanRun(GetScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}" + }; + } + + // Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + // stop time. + rpc ListScanRuns(ListScanRunsRequest) returns (ListScanRunsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*}/scanRuns" + }; + } + + // Stops a ScanRun. The stopped ScanRun is returned. + rpc StopScanRun(StopScanRunRequest) returns (ScanRun) { + option (google.api.http) = { + post: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop" + body: "*" + }; + } + + // List CrawledUrls under a given ScanRun. + rpc ListCrawledUrls(ListCrawledUrlsRequest) returns (ListCrawledUrlsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls" + }; + } + + // Gets a Finding. + rpc GetFinding(GetFindingRequest) returns (Finding) { + option (google.api.http) = { + get: "/v1/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}" + }; + } + + // List Findings under a given ScanRun. + rpc ListFindings(ListFindingsRequest) returns (ListFindingsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings" + }; + } + + // List all FindingTypeStats under a given ScanRun. + rpc ListFindingTypeStats(ListFindingTypeStatsRequest) returns (ListFindingTypeStatsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats" + }; + } +} + +// Request for the `CreateScanConfig` method. +message CreateScanConfigRequest { + // Required. The parent resource name where the scan is created, which should be a + // project resource name in the format 'projects/{projectId}'. + string parent = 1; + + // Required. The ScanConfig to be created. + ScanConfig scan_config = 2; +} + +// Request for the `DeleteScanConfig` method. +message DeleteScanConfigRequest { + // Required. The resource name of the ScanConfig to be deleted. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1; +} + +// Request for the `GetScanConfig` method. +message GetScanConfigRequest { + // Required. The resource name of the ScanConfig to be returned. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1; +} + +// Request for the `ListScanConfigs` method. +message ListScanConfigsRequest { + // Required. The parent resource name, which should be a project resource name in the + // format 'projects/{projectId}'. + string parent = 1; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanConfigs to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Request for the `UpdateScanConfigRequest` method. +message UpdateScanConfigRequest { + // 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. + ScanConfig scan_config = 2; + + // Required. The update mask applies to the resource. For the `FieldMask` definition, + // see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 3; +} + +// Response for the `ListScanConfigs` method. +message ListScanConfigsResponse { + // The list of ScanConfigs returned. + repeated ScanConfig scan_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StartScanRun` method. +message StartScanRunRequest { + // Required. The resource name of the ScanConfig to be used. The name follows the + // format of 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string name = 1; +} + +// Request for the `GetScanRun` method. +message GetScanRunRequest { + // Required. The resource name of the ScanRun to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1; +} + +// Request for the `ListScanRuns` method. +message ListScanRunsRequest { + // Required. The parent resource name, which should be a scan resource name in the + // format 'projects/{projectId}/scanConfigs/{scanConfigId}'. + string parent = 1; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of ScanRuns to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListScanRuns` method. +message ListScanRunsResponse { + // The list of ScanRuns returned. + repeated ScanRun scan_runs = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `StopScanRun` method. +message StopScanRunRequest { + // Required. The resource name of the ScanRun to be stopped. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string name = 1; +} + +// Request for the `ListCrawledUrls` method. +message ListCrawledUrlsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 2; + + // The maximum number of CrawledUrls to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 3; +} + +// Response for the `ListCrawledUrls` method. +message ListCrawledUrlsResponse { + // The list of CrawledUrls returned. + repeated CrawledUrl crawled_urls = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `GetFinding` method. +message GetFindingRequest { + // Required. The resource name of the Finding to be returned. The name follows the + // format of + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}/findings/{findingId}'. + string name = 1; +} + +// Request for the `ListFindings` method. +message ListFindingsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1; + + // The filter expression. The expression must be in the format: + // . + // Supported field: 'finding_type'. + // Supported operator: '='. + string filter = 2; + + // A token identifying a page of results to be returned. This should be a + // `next_page_token` value returned from a previous List request. + // If unspecified, the first page of results is returned. + string page_token = 3; + + // The maximum number of Findings to return, can be limited by server. + // If not specified or not positive, the implementation will select a + // reasonable value. + int32 page_size = 4; +} + +// Response for the `ListFindings` method. +message ListFindingsResponse { + // The list of Findings returned. + repeated Finding findings = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request for the `ListFindingTypeStats` method. +message ListFindingTypeStatsRequest { + // Required. The parent resource name, which should be a scan run resource name in the + // format + // 'projects/{projectId}/scanConfigs/{scanConfigId}/scanRuns/{scanRunId}'. + string parent = 1; +} + +// Response for the `ListFindingTypeStats` method. +message ListFindingTypeStatsResponse { + // The list of FindingTypeStats returned. + repeated FindingTypeStats finding_type_stats = 1; +} diff --git a/synth.metadata b/synth.metadata index 59106e9a..6d4d7232 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,31 +3,39 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/java-websecurityscanner.git", - "sha": "4462f1b47e5357251155e69c3ada4dd6daf4e0b0" + "remote": "git@github.com:googleapis/java-websecurityscanner.git", + "sha": "558cedf68d6e2eee8c36451460894ca3a5b0ccb6" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c4e37010d74071851ff24121f522e802231ac86e", - "internalRef": "313460921" + "sha": "cf1a64d9aa88c0b9ed1d19ed6db30e67538b010d", + "internalRef": "315984872" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c4e37010d74071851ff24121f522e802231ac86e", - "internalRef": "313460921" + "sha": "cf1a64d9aa88c0b9ed1d19ed6db30e67538b010d", + "internalRef": "315984872" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "cf1a64d9aa88c0b9ed1d19ed6db30e67538b010d", + "internalRef": "315984872" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "987270824bd26f6a8c716d5e2022057b8ae7b26e" + "sha": "a0ee80e0492a03b9b2bfefb5cca7eaf17bf10438" } } ], @@ -49,6 +57,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "websecurityscanner", + "apiVersion": "v1", + "language": "java", + "generator": "bazel" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index d41b0c25..3e5fe8c3 100644 --- a/synth.py +++ b/synth.py @@ -19,7 +19,7 @@ AUTOSYNTH_MULTIPLE_COMMITS = True service = 'websecurityscanner' -versions = ['v1alpha', 'v1beta'] +versions = ['v1alpha', 'v1beta', 'v1'] for version in versions: library = java.bazel_library( diff --git a/versions.txt b/versions.txt index 6c80cd2a..47254e21 100644 --- a/versions.txt +++ b/versions.txt @@ -1,8 +1,10 @@ # Format: # module:released-version:current-version -proto-google-cloud-websecurityscanner-v1beta:0.81.3:0.81.4-SNAPSHOT proto-google-cloud-websecurityscanner-v1alpha:0.81.3:0.81.4-SNAPSHOT +proto-google-cloud-websecurityscanner-v1beta:0.81.3:0.81.4-SNAPSHOT +proto-google-cloud-websecurityscanner-v1:0.81.3:0.81.4-SNAPSHOT grpc-google-cloud-websecurityscanner-v1alpha:0.81.3:0.81.4-SNAPSHOT grpc-google-cloud-websecurityscanner-v1beta:0.81.3:0.81.4-SNAPSHOT +grpc-google-cloud-websecurityscanner-v1:0.81.3:0.81.4-SNAPSHOT google-cloud-websecurityscanner:0.116.3:0.116.4-SNAPSHOT \ No newline at end of file