From b68ebde5f9a9a5a9e57d089bd3df4cea8e11dc35 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 13 Sep 2021 16:28:41 +0000 Subject: [PATCH] feat: add OSConfigZonalService API Committer: @jaiminsh (#356) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 394704298 Source-Link: https://github.com/googleapis/googleapis/commit/31d2d3432d9a0b910d7858eab7720b63445f23b2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/aa3ce0901f686a71b68e427c6bb7a611b151b540 --- .../v1/OsConfigZonalServiceClient.java | 901 ++ .../v1/OsConfigZonalServiceSettings.java | 232 + .../cloud/osconfig/v1/gapic_metadata.json | 21 + .../cloud/osconfig/v1/package-info.java | 17 + ...pcOsConfigZonalServiceCallableFactory.java | 113 + .../v1/stub/GrpcOsConfigZonalServiceStub.java | 302 + .../v1/stub/OsConfigZonalServiceStub.java | 74 + .../OsConfigZonalServiceStubSettings.java | 520 + .../osconfig/v1/MockOsConfigZonalService.java | 59 + .../v1/MockOsConfigZonalServiceImpl.java | 145 + .../v1/OsConfigZonalServiceClientTest.java | 434 + .../osconfig/v1/OsConfigZonalServiceGrpc.java | 754 ++ .../com/google/cloud/osconfig/v1/CVSSv3.java | 3131 ++++++ .../cloud/osconfig/v1/CVSSv3OrBuilder.java | 287 + .../osconfig/v1/GetInventoryRequest.java | 843 ++ .../v1/GetInventoryRequestOrBuilder.java | 91 + .../v1/GetVulnerabilityReportRequest.java | 686 ++ ...etVulnerabilityReportRequestOrBuilder.java | 64 + .../cloud/osconfig/v1/InstanceName.java | 340 + .../google/cloud/osconfig/v1/Inventories.java | 239 +- .../google/cloud/osconfig/v1/Inventory.java | 9343 +++++++++-------- .../cloud/osconfig/v1/InventoryName.java | 223 + .../cloud/osconfig/v1/InventoryOrBuilder.java | 67 + .../cloud/osconfig/v1/InventoryView.java | 178 + .../osconfig/v1/ListInventoriesRequest.java | 1294 +++ .../v1/ListInventoriesRequestOrBuilder.java | 154 + .../osconfig/v1/ListInventoriesResponse.java | 1131 ++ .../v1/ListInventoriesResponseOrBuilder.java | 102 + .../v1/ListVulnerabilityReportsRequest.java | 1140 ++ ...tVulnerabilityReportsRequestOrBuilder.java | 127 + .../v1/ListVulnerabilityReportsResponse.java | 1179 +++ ...VulnerabilityReportsResponseOrBuilder.java | 105 + .../cloud/osconfig/v1/OsConfigProto.java | 10 +- .../v1/OsConfigZonalServiceProto.java | 100 + .../cloud/osconfig/v1/VulnerabilityProto.java | 252 + .../osconfig/v1/VulnerabilityReport.java | 6888 ++++++++++++ .../osconfig/v1/VulnerabilityReportName.java | 225 + .../v1/VulnerabilityReportOrBuilder.java | 159 + .../google/cloud/osconfig/v1/inventory.proto | 135 +- .../cloud/osconfig/v1/osconfig_service.proto | 1 + .../osconfig/v1/osconfig_zonal_service.proto | 74 + .../cloud/osconfig/v1/vulnerability.proto | 336 + 42 files changed, 27943 insertions(+), 4533 deletions(-) create mode 100644 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java create mode 100644 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java create mode 100644 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java create mode 100644 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceStub.java create mode 100644 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStub.java create mode 100644 google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStubSettings.java create mode 100644 google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalService.java create mode 100644 google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalServiceImpl.java create mode 100644 google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClientTest.java create mode 100644 grpc-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceGrpc.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3OrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequest.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequestOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequest.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequestOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InstanceName.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryName.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryView.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequest.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequestOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponse.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponseOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequest.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequestOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponse.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponseOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceProto.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityProto.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReport.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportName.java create mode 100644 proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportOrBuilder.java create mode 100644 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_zonal_service.proto create mode 100644 proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/vulnerability.proto diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java new file mode 100644 index 00000000..ae1f417f --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java @@ -0,0 +1,901 @@ +/* + * Copyright 2021 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.osconfig.v1; + +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.osconfig.v1.stub.OsConfigZonalServiceStub; +import com.google.cloud.osconfig.v1.stub.OsConfigZonalServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Zonal OS Config API + * + *

The OS Config service is the server-side component that allows users to manage package + * installations and patch jobs for Compute Engine VM instances. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+ *     OsConfigZonalServiceClient.create()) {
+ *   InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Inventory response = osConfigZonalServiceClient.getInventory(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the OsConfigZonalServiceClient 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 OsConfigZonalServiceSettings + * to create(). For example: + * + *

To customize credentials: + * + *

{@code
+ * OsConfigZonalServiceSettings osConfigZonalServiceSettings =
+ *     OsConfigZonalServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * OsConfigZonalServiceClient osConfigZonalServiceClient =
+ *     OsConfigZonalServiceClient.create(osConfigZonalServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * OsConfigZonalServiceSettings osConfigZonalServiceSettings =
+ *     OsConfigZonalServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * OsConfigZonalServiceClient osConfigZonalServiceClient =
+ *     OsConfigZonalServiceClient.create(osConfigZonalServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class OsConfigZonalServiceClient implements BackgroundResource { + private final OsConfigZonalServiceSettings settings; + private final OsConfigZonalServiceStub stub; + + /** Constructs an instance of OsConfigZonalServiceClient with default settings. */ + public static final OsConfigZonalServiceClient create() throws IOException { + return create(OsConfigZonalServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of OsConfigZonalServiceClient, 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 OsConfigZonalServiceClient create(OsConfigZonalServiceSettings settings) + throws IOException { + return new OsConfigZonalServiceClient(settings); + } + + /** + * Constructs an instance of OsConfigZonalServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(OsConfigZonalServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final OsConfigZonalServiceClient create(OsConfigZonalServiceStub stub) { + return new OsConfigZonalServiceClient(stub); + } + + /** + * Constructs an instance of OsConfigZonalServiceClient, 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 OsConfigZonalServiceClient(OsConfigZonalServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((OsConfigZonalServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected OsConfigZonalServiceClient(OsConfigZonalServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final OsConfigZonalServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public OsConfigZonalServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Inventory response = osConfigZonalServiceClient.getInventory(name);
+   * }
+   * }
+ * + * @param name Required. API resource name for inventory resource. + *

Format: `projects/{project}/locations/{location}/instances/{instance}/inventory` + *

For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Inventory getInventory(InventoryName name) { + GetInventoryRequest request = + GetInventoryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   String name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   Inventory response = osConfigZonalServiceClient.getInventory(name);
+   * }
+   * }
+ * + * @param name Required. API resource name for inventory resource. + *

Format: `projects/{project}/locations/{location}/instances/{instance}/inventory` + *

For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Inventory getInventory(String name) { + GetInventoryRequest request = GetInventoryRequest.newBuilder().setName(name).build(); + return getInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   GetInventoryRequest request =
+   *       GetInventoryRequest.newBuilder()
+   *           .setName(InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setView(InventoryView.forNumber(0))
+   *           .build();
+   *   Inventory response = osConfigZonalServiceClient.getInventory(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 Inventory getInventory(GetInventoryRequest request) { + return getInventoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   GetInventoryRequest request =
+   *       GetInventoryRequest.newBuilder()
+   *           .setName(InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setView(InventoryView.forNumber(0))
+   *           .build();
+   *   ApiFuture future =
+   *       osConfigZonalServiceClient.getInventoryCallable().futureCall(request);
+   *   // Do something.
+   *   Inventory response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInventoryCallable() { + return stub.getInventoryCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   InstanceName parent =
+   *       InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   for (Inventory element : osConfigZonalServiceClient.listInventories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + *

Format: `projects/{project}/locations/{location}/instances/-` + *

For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInventoriesPagedResponse listInventories(InstanceName parent) { + ListInventoriesRequest request = + ListInventoriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInventories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   String parent =
+   *       InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]").toString();
+   *   for (Inventory element : osConfigZonalServiceClient.listInventories(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + *

Format: `projects/{project}/locations/{location}/instances/-` + *

For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInventoriesPagedResponse listInventories(String parent) { + ListInventoriesRequest request = ListInventoriesRequest.newBuilder().setParent(parent).build(); + return listInventories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   ListInventoriesRequest request =
+   *       ListInventoriesRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]")
+   *                   .toString())
+   *           .setView(InventoryView.forNumber(0))
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (Inventory element : osConfigZonalServiceClient.listInventories(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 ListInventoriesPagedResponse listInventories(ListInventoriesRequest request) { + return listInventoriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   ListInventoriesRequest request =
+   *       ListInventoriesRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]")
+   *                   .toString())
+   *           .setView(InventoryView.forNumber(0))
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       osConfigZonalServiceClient.listInventoriesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Inventory element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInventoriesPagedCallable() { + return stub.listInventoriesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   ListInventoriesRequest request =
+   *       ListInventoriesRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]")
+   *                   .toString())
+   *           .setView(InventoryView.forNumber(0))
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListInventoriesResponse response =
+   *         osConfigZonalServiceClient.listInventoriesCallable().call(request);
+   *     for (Inventory element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInventoriesCallable() { + return stub.listInventoriesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   VulnerabilityReportName name =
+   *       VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   VulnerabilityReport response = osConfigZonalServiceClient.getVulnerabilityReport(name);
+   * }
+   * }
+ * + * @param name Required. API resource name for vulnerability resource. + *

Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + *

For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final VulnerabilityReport getVulnerabilityReport(VulnerabilityReportName name) { + GetVulnerabilityReportRequest request = + GetVulnerabilityReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getVulnerabilityReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   String name = VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   VulnerabilityReport response = osConfigZonalServiceClient.getVulnerabilityReport(name);
+   * }
+   * }
+ * + * @param name Required. API resource name for vulnerability resource. + *

Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + *

For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final VulnerabilityReport getVulnerabilityReport(String name) { + GetVulnerabilityReportRequest request = + GetVulnerabilityReportRequest.newBuilder().setName(name).build(); + return getVulnerabilityReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   GetVulnerabilityReportRequest request =
+   *       GetVulnerabilityReportRequest.newBuilder()
+   *           .setName(
+   *               VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   VulnerabilityReport response = osConfigZonalServiceClient.getVulnerabilityReport(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 VulnerabilityReport getVulnerabilityReport(GetVulnerabilityReportRequest request) { + return getVulnerabilityReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   GetVulnerabilityReportRequest request =
+   *       GetVulnerabilityReportRequest.newBuilder()
+   *           .setName(
+   *               VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       osConfigZonalServiceClient.getVulnerabilityReportCallable().futureCall(request);
+   *   // Do something.
+   *   VulnerabilityReport response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getVulnerabilityReportCallable() { + return stub.getVulnerabilityReportCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   InstanceName parent =
+   *       InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]");
+   *   for (VulnerabilityReport element :
+   *       osConfigZonalServiceClient.listVulnerabilityReports(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + *

Format: `projects/{project}/locations/{location}/instances/-` + *

For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVulnerabilityReportsPagedResponse listVulnerabilityReports(InstanceName parent) { + ListVulnerabilityReportsRequest request = + ListVulnerabilityReportsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listVulnerabilityReports(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   String parent =
+   *       InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]").toString();
+   *   for (VulnerabilityReport element :
+   *       osConfigZonalServiceClient.listVulnerabilityReports(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent resource name. + *

Format: `projects/{project}/locations/{location}/instances/-` + *

For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVulnerabilityReportsPagedResponse listVulnerabilityReports(String parent) { + ListVulnerabilityReportsRequest request = + ListVulnerabilityReportsRequest.newBuilder().setParent(parent).build(); + return listVulnerabilityReports(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   ListVulnerabilityReportsRequest request =
+   *       ListVulnerabilityReportsRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   for (VulnerabilityReport element :
+   *       osConfigZonalServiceClient.listVulnerabilityReports(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 ListVulnerabilityReportsPagedResponse listVulnerabilityReports( + ListVulnerabilityReportsRequest request) { + return listVulnerabilityReportsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   ListVulnerabilityReportsRequest request =
+   *       ListVulnerabilityReportsRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   ApiFuture future =
+   *       osConfigZonalServiceClient.listVulnerabilityReportsPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (VulnerabilityReport element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listVulnerabilityReportsPagedCallable() { + return stub.listVulnerabilityReportsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *

Sample code: + * + *

{@code
+   * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+   *     OsConfigZonalServiceClient.create()) {
+   *   ListVulnerabilityReportsRequest request =
+   *       ListVulnerabilityReportsRequest.newBuilder()
+   *           .setParent(
+   *               InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]")
+   *                   .toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .build();
+   *   while (true) {
+   *     ListVulnerabilityReportsResponse response =
+   *         osConfigZonalServiceClient.listVulnerabilityReportsCallable().call(request);
+   *     for (VulnerabilityReport element : response.getResponsesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listVulnerabilityReportsCallable() { + return stub.listVulnerabilityReportsCallable(); + } + + @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 ListInventoriesPagedResponse + extends AbstractPagedListResponse< + ListInventoriesRequest, + ListInventoriesResponse, + Inventory, + ListInventoriesPage, + ListInventoriesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInventoriesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListInventoriesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListInventoriesPagedResponse(ListInventoriesPage page) { + super(page, ListInventoriesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInventoriesPage + extends AbstractPage< + ListInventoriesRequest, ListInventoriesResponse, Inventory, ListInventoriesPage> { + + private ListInventoriesPage( + PageContext context, + ListInventoriesResponse response) { + super(context, response); + } + + private static ListInventoriesPage createEmptyPage() { + return new ListInventoriesPage(null, null); + } + + @Override + protected ListInventoriesPage createPage( + PageContext context, + ListInventoriesResponse response) { + return new ListInventoriesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInventoriesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInventoriesRequest, + ListInventoriesResponse, + Inventory, + ListInventoriesPage, + ListInventoriesFixedSizeCollection> { + + private ListInventoriesFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInventoriesFixedSizeCollection createEmptyCollection() { + return new ListInventoriesFixedSizeCollection(null, 0); + } + + @Override + protected ListInventoriesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInventoriesFixedSizeCollection(pages, collectionSize); + } + } + + public static class ListVulnerabilityReportsPagedResponse + extends AbstractPagedListResponse< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport, + ListVulnerabilityReportsPage, + ListVulnerabilityReportsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport> + context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListVulnerabilityReportsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListVulnerabilityReportsPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListVulnerabilityReportsPagedResponse(ListVulnerabilityReportsPage page) { + super(page, ListVulnerabilityReportsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListVulnerabilityReportsPage + extends AbstractPage< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport, + ListVulnerabilityReportsPage> { + + private ListVulnerabilityReportsPage( + PageContext< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport> + context, + ListVulnerabilityReportsResponse response) { + super(context, response); + } + + private static ListVulnerabilityReportsPage createEmptyPage() { + return new ListVulnerabilityReportsPage(null, null); + } + + @Override + protected ListVulnerabilityReportsPage createPage( + PageContext< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport> + context, + ListVulnerabilityReportsResponse response) { + return new ListVulnerabilityReportsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport> + context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListVulnerabilityReportsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport, + ListVulnerabilityReportsPage, + ListVulnerabilityReportsFixedSizeCollection> { + + private ListVulnerabilityReportsFixedSizeCollection( + List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListVulnerabilityReportsFixedSizeCollection createEmptyCollection() { + return new ListVulnerabilityReportsFixedSizeCollection(null, 0); + } + + @Override + protected ListVulnerabilityReportsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListVulnerabilityReportsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java new file mode 100644 index 00000000..5be4c0a7 --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceSettings.java @@ -0,0 +1,232 @@ +/* + * Copyright 2021 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.osconfig.v1; + +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse; +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse; + +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.osconfig.v1.stub.OsConfigZonalServiceStubSettings; +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 OsConfigZonalServiceClient}. + * + *

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

    + *
  • The default service address (osconfig.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 getInventory to 30 seconds: + * + *

{@code
+ * OsConfigZonalServiceSettings.Builder osConfigZonalServiceSettingsBuilder =
+ *     OsConfigZonalServiceSettings.newBuilder();
+ * osConfigZonalServiceSettingsBuilder
+ *     .getInventorySettings()
+ *     .setRetrySettings(
+ *         osConfigZonalServiceSettingsBuilder
+ *             .getInventorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * OsConfigZonalServiceSettings osConfigZonalServiceSettings =
+ *     osConfigZonalServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class OsConfigZonalServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to getInventory. */ + public UnaryCallSettings getInventorySettings() { + return ((OsConfigZonalServiceStubSettings) getStubSettings()).getInventorySettings(); + } + + /** Returns the object with the settings used for calls to listInventories. */ + public PagedCallSettings< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + listInventoriesSettings() { + return ((OsConfigZonalServiceStubSettings) getStubSettings()).listInventoriesSettings(); + } + + /** Returns the object with the settings used for calls to getVulnerabilityReport. */ + public UnaryCallSettings + getVulnerabilityReportSettings() { + return ((OsConfigZonalServiceStubSettings) getStubSettings()).getVulnerabilityReportSettings(); + } + + /** Returns the object with the settings used for calls to listVulnerabilityReports. */ + public PagedCallSettings< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsSettings() { + return ((OsConfigZonalServiceStubSettings) getStubSettings()) + .listVulnerabilityReportsSettings(); + } + + public static final OsConfigZonalServiceSettings create(OsConfigZonalServiceStubSettings stub) + throws IOException { + return new OsConfigZonalServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return OsConfigZonalServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return OsConfigZonalServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return OsConfigZonalServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return OsConfigZonalServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return OsConfigZonalServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return OsConfigZonalServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return OsConfigZonalServiceStubSettings.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 OsConfigZonalServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for OsConfigZonalServiceSettings. */ + public static class Builder + extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(OsConfigZonalServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(OsConfigZonalServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(OsConfigZonalServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(OsConfigZonalServiceStubSettings.newBuilder()); + } + + public OsConfigZonalServiceStubSettings.Builder getStubSettingsBuilder() { + return ((OsConfigZonalServiceStubSettings.Builder) getStubSettings()); + } + + /** + * 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) { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to getInventory. */ + public UnaryCallSettings.Builder getInventorySettings() { + return getStubSettingsBuilder().getInventorySettings(); + } + + /** Returns the builder for the settings used for calls to listInventories. */ + public PagedCallSettings.Builder< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + listInventoriesSettings() { + return getStubSettingsBuilder().listInventoriesSettings(); + } + + /** Returns the builder for the settings used for calls to getVulnerabilityReport. */ + public UnaryCallSettings.Builder + getVulnerabilityReportSettings() { + return getStubSettingsBuilder().getVulnerabilityReportSettings(); + } + + /** Returns the builder for the settings used for calls to listVulnerabilityReports. */ + public PagedCallSettings.Builder< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsSettings() { + return getStubSettingsBuilder().listVulnerabilityReportsSettings(); + } + + @Override + public OsConfigZonalServiceSettings build() throws IOException { + return new OsConfigZonalServiceSettings(this); + } + } +} diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/gapic_metadata.json b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/gapic_metadata.json index a75fb036..6749ef76 100644 --- a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/gapic_metadata.json +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/gapic_metadata.json @@ -40,6 +40,27 @@ } } } + }, + "OsConfigZonalService": { + "clients": { + "grpc": { + "libraryClient": "OsConfigZonalServiceClient", + "rpcs": { + "GetInventory": { + "methods": ["getInventory", "getInventory", "getInventory", "getInventoryCallable"] + }, + "GetVulnerabilityReport": { + "methods": ["getVulnerabilityReport", "getVulnerabilityReport", "getVulnerabilityReport", "getVulnerabilityReportCallable"] + }, + "ListInventories": { + "methods": ["listInventories", "listInventories", "listInventories", "listInventoriesPagedCallable", "listInventoriesCallable"] + }, + "ListVulnerabilityReports": { + "methods": ["listVulnerabilityReports", "listVulnerabilityReports", "listVulnerabilityReports", "listVulnerabilityReportsPagedCallable", "listVulnerabilityReportsCallable"] + } + } + } + } } } } \ No newline at end of file diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/package-info.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/package-info.java index ea3de907..8fbfd1aa 100644 --- a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/package-info.java +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/package-info.java @@ -42,6 +42,23 @@ * PatchJobs.PatchJob response = osConfigServiceClient.executePatchJob(request); * } * } + * + *

======================= OsConfigZonalServiceClient ======================= + * + *

Service Description: Zonal OS Config API + * + *

The OS Config service is the server-side component that allows users to manage package + * installations and patch jobs for Compute Engine VM instances. + * + *

Sample for OsConfigZonalServiceClient: + * + *

{@code
+ * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+ *     OsConfigZonalServiceClient.create()) {
+ *   InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Inventory response = osConfigZonalServiceClient.getInventory(name);
+ * }
+ * }
*/ @Generated("by gapic-generator-java") package com.google.cloud.osconfig.v1; diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java new file mode 100644 index 00000000..d3944581 --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2021 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.osconfig.v1.stub; + +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.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the OsConfigZonalService service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcOsConfigZonalServiceCallableFactory 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 callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings callSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, callSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, callSettings, clientContext); + } +} diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceStub.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceStub.java new file mode 100644 index 00000000..c950de78 --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceStub.java @@ -0,0 +1,302 @@ +/* + * Copyright 2021 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.osconfig.v1.stub; + +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse; +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse; + +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.UnaryCallable; +import com.google.cloud.osconfig.v1.GetInventoryRequest; +import com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest; +import com.google.cloud.osconfig.v1.Inventory; +import com.google.cloud.osconfig.v1.ListInventoriesRequest; +import com.google.cloud.osconfig.v1.ListInventoriesResponse; +import com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; +import com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; +import com.google.cloud.osconfig.v1.VulnerabilityReport; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the OsConfigZonalService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcOsConfigZonalServiceStub extends OsConfigZonalServiceStub { + private static final MethodDescriptor + getInventoryMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.osconfig.v1.OsConfigZonalService/GetInventory") + .setRequestMarshaller(ProtoUtils.marshaller(GetInventoryRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Inventory.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + listInventoriesMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.osconfig.v1.OsConfigZonalService/ListInventories") + .setRequestMarshaller( + ProtoUtils.marshaller(ListInventoriesRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListInventoriesResponse.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + getVulnerabilityReportMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.osconfig.v1.OsConfigZonalService/GetVulnerabilityReport") + .setRequestMarshaller( + ProtoUtils.marshaller(GetVulnerabilityReportRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(VulnerabilityReport.getDefaultInstance())) + .build(); + + private static final MethodDescriptor< + ListVulnerabilityReportsRequest, ListVulnerabilityReportsResponse> + listVulnerabilityReportsMethodDescriptor = + MethodDescriptor + .newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.osconfig.v1.OsConfigZonalService/ListVulnerabilityReports") + .setRequestMarshaller( + ProtoUtils.marshaller(ListVulnerabilityReportsRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(ListVulnerabilityReportsResponse.getDefaultInstance())) + .build(); + + private final UnaryCallable getInventoryCallable; + private final UnaryCallable + listInventoriesCallable; + private final UnaryCallable + listInventoriesPagedCallable; + private final UnaryCallable + getVulnerabilityReportCallable; + private final UnaryCallable + listVulnerabilityReportsCallable; + private final UnaryCallable< + ListVulnerabilityReportsRequest, ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsPagedCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcOsConfigZonalServiceStub create(OsConfigZonalServiceStubSettings settings) + throws IOException { + return new GrpcOsConfigZonalServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcOsConfigZonalServiceStub create(ClientContext clientContext) + throws IOException { + return new GrpcOsConfigZonalServiceStub( + OsConfigZonalServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcOsConfigZonalServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcOsConfigZonalServiceStub( + OsConfigZonalServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcOsConfigZonalServiceStub, 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 GrpcOsConfigZonalServiceStub( + OsConfigZonalServiceStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcOsConfigZonalServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcOsConfigZonalServiceStub, 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 GrpcOsConfigZonalServiceStub( + OsConfigZonalServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings getInventoryTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getInventoryMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listInventoriesTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listInventoriesMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + GrpcCallSettings + getVulnerabilityReportTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getVulnerabilityReportMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + }) + .build(); + GrpcCallSettings + listVulnerabilityReportsTransportSettings = + GrpcCallSettings + .newBuilder() + .setMethodDescriptor(listVulnerabilityReportsMethodDescriptor) + .setParamsExtractor( + request -> { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + }) + .build(); + + this.getInventoryCallable = + callableFactory.createUnaryCallable( + getInventoryTransportSettings, settings.getInventorySettings(), clientContext); + this.listInventoriesCallable = + callableFactory.createUnaryCallable( + listInventoriesTransportSettings, settings.listInventoriesSettings(), clientContext); + this.listInventoriesPagedCallable = + callableFactory.createPagedCallable( + listInventoriesTransportSettings, settings.listInventoriesSettings(), clientContext); + this.getVulnerabilityReportCallable = + callableFactory.createUnaryCallable( + getVulnerabilityReportTransportSettings, + settings.getVulnerabilityReportSettings(), + clientContext); + this.listVulnerabilityReportsCallable = + callableFactory.createUnaryCallable( + listVulnerabilityReportsTransportSettings, + settings.listVulnerabilityReportsSettings(), + clientContext); + this.listVulnerabilityReportsPagedCallable = + callableFactory.createPagedCallable( + listVulnerabilityReportsTransportSettings, + settings.listVulnerabilityReportsSettings(), + clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable getInventoryCallable() { + return getInventoryCallable; + } + + @Override + public UnaryCallable listInventoriesCallable() { + return listInventoriesCallable; + } + + @Override + public UnaryCallable + listInventoriesPagedCallable() { + return listInventoriesPagedCallable; + } + + @Override + public UnaryCallable + getVulnerabilityReportCallable() { + return getVulnerabilityReportCallable; + } + + @Override + public UnaryCallable + listVulnerabilityReportsCallable() { + return listVulnerabilityReportsCallable; + } + + @Override + public UnaryCallable + listVulnerabilityReportsPagedCallable() { + return listVulnerabilityReportsPagedCallable; + } + + @Override + public final void close() { + try { + backgroundResources.close(); + } catch (RuntimeException e) { + throw e; + } catch (Exception e) { + throw new IllegalStateException("Failed to close resource", e); + } + } + + @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-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStub.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStub.java new file mode 100644 index 00000000..e645a46e --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStub.java @@ -0,0 +1,74 @@ +/* + * Copyright 2021 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.osconfig.v1.stub; + +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse; +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.osconfig.v1.GetInventoryRequest; +import com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest; +import com.google.cloud.osconfig.v1.Inventory; +import com.google.cloud.osconfig.v1.ListInventoriesRequest; +import com.google.cloud.osconfig.v1.ListInventoriesResponse; +import com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; +import com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; +import com.google.cloud.osconfig.v1.VulnerabilityReport; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the OsConfigZonalService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class OsConfigZonalServiceStub implements BackgroundResource { + + public UnaryCallable getInventoryCallable() { + throw new UnsupportedOperationException("Not implemented: getInventoryCallable()"); + } + + public UnaryCallable + listInventoriesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInventoriesPagedCallable()"); + } + + public UnaryCallable listInventoriesCallable() { + throw new UnsupportedOperationException("Not implemented: listInventoriesCallable()"); + } + + public UnaryCallable + getVulnerabilityReportCallable() { + throw new UnsupportedOperationException("Not implemented: getVulnerabilityReportCallable()"); + } + + public UnaryCallable + listVulnerabilityReportsPagedCallable() { + throw new UnsupportedOperationException( + "Not implemented: listVulnerabilityReportsPagedCallable()"); + } + + public UnaryCallable + listVulnerabilityReportsCallable() { + throw new UnsupportedOperationException("Not implemented: listVulnerabilityReportsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStubSettings.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStubSettings.java new file mode 100644 index 00000000..1967ba7b --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/OsConfigZonalServiceStubSettings.java @@ -0,0 +1,520 @@ +/* + * Copyright 2021 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.osconfig.v1.stub; + +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse; +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse; + +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.osconfig.v1.GetInventoryRequest; +import com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest; +import com.google.cloud.osconfig.v1.Inventory; +import com.google.cloud.osconfig.v1.ListInventoriesRequest; +import com.google.cloud.osconfig.v1.ListInventoriesResponse; +import com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest; +import com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse; +import com.google.cloud.osconfig.v1.VulnerabilityReport; +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 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 OsConfigZonalServiceStub}. + * + *

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

    + *
  • The default service address (osconfig.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 getInventory to 30 seconds: + * + *

{@code
+ * OsConfigZonalServiceStubSettings.Builder osConfigZonalServiceSettingsBuilder =
+ *     OsConfigZonalServiceStubSettings.newBuilder();
+ * osConfigZonalServiceSettingsBuilder
+ *     .getInventorySettings()
+ *     .setRetrySettings(
+ *         osConfigZonalServiceSettingsBuilder
+ *             .getInventorySettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * OsConfigZonalServiceStubSettings osConfigZonalServiceSettings =
+ *     osConfigZonalServiceSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class OsConfigZonalServiceStubSettings + 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 getInventorySettings; + private final PagedCallSettings< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + listInventoriesSettings; + private final UnaryCallSettings + getVulnerabilityReportSettings; + private final PagedCallSettings< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsSettings; + + private static final PagedListDescriptor< + ListInventoriesRequest, ListInventoriesResponse, Inventory> + LIST_INVENTORIES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInventoriesRequest injectToken( + ListInventoriesRequest payload, String token) { + return ListInventoriesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInventoriesRequest injectPageSize( + ListInventoriesRequest payload, int pageSize) { + return ListInventoriesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInventoriesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInventoriesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInventoriesResponse payload) { + return payload.getInventoriesList() == null + ? ImmutableList.of() + : payload.getInventoriesList(); + } + }; + + private static final PagedListDescriptor< + ListVulnerabilityReportsRequest, ListVulnerabilityReportsResponse, VulnerabilityReport> + LIST_VULNERABILITY_REPORTS_PAGE_STR_DESC = + new PagedListDescriptor< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport>() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListVulnerabilityReportsRequest injectToken( + ListVulnerabilityReportsRequest payload, String token) { + return ListVulnerabilityReportsRequest.newBuilder(payload) + .setPageToken(token) + .build(); + } + + @Override + public ListVulnerabilityReportsRequest injectPageSize( + ListVulnerabilityReportsRequest payload, int pageSize) { + return ListVulnerabilityReportsRequest.newBuilder(payload) + .setPageSize(pageSize) + .build(); + } + + @Override + public Integer extractPageSize(ListVulnerabilityReportsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListVulnerabilityReportsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources( + ListVulnerabilityReportsResponse payload) { + return payload.getVulnerabilityReportsList() == null + ? ImmutableList.of() + : payload.getVulnerabilityReportsList(); + } + }; + + private static final PagedListResponseFactory< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + LIST_INVENTORIES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInventoriesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INVENTORIES_PAGE_STR_DESC, request, context); + return ListInventoriesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + LIST_VULNERABILITY_REPORTS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable + callable, + ListVulnerabilityReportsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + VulnerabilityReport> + pageContext = + PageContext.create( + callable, LIST_VULNERABILITY_REPORTS_PAGE_STR_DESC, request, context); + return ListVulnerabilityReportsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Returns the object with the settings used for calls to getInventory. */ + public UnaryCallSettings getInventorySettings() { + return getInventorySettings; + } + + /** Returns the object with the settings used for calls to listInventories. */ + public PagedCallSettings< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + listInventoriesSettings() { + return listInventoriesSettings; + } + + /** Returns the object with the settings used for calls to getVulnerabilityReport. */ + public UnaryCallSettings + getVulnerabilityReportSettings() { + return getVulnerabilityReportSettings; + } + + /** Returns the object with the settings used for calls to listVulnerabilityReports. */ + public PagedCallSettings< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsSettings() { + return listVulnerabilityReportsSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public OsConfigZonalServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcOsConfigZonalServiceStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", 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 "osconfig.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "osconfig.mtls.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) + .setUseJwtAccessWithScope(true); + } + + /** 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(OsConfigZonalServiceStubSettings.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 OsConfigZonalServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + getInventorySettings = settingsBuilder.getInventorySettings().build(); + listInventoriesSettings = settingsBuilder.listInventoriesSettings().build(); + getVulnerabilityReportSettings = settingsBuilder.getVulnerabilityReportSettings().build(); + listVulnerabilityReportsSettings = settingsBuilder.listVulnerabilityReportsSettings().build(); + } + + /** Builder for OsConfigZonalServiceStubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder getInventorySettings; + private final PagedCallSettings.Builder< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + listInventoriesSettings; + private final UnaryCallSettings.Builder + getVulnerabilityReportSettings; + private final PagedCallSettings.Builder< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + 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(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(60000L)) + .setTotalTimeout(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + getInventorySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listInventoriesSettings = PagedCallSettings.newBuilder(LIST_INVENTORIES_PAGE_STR_FACT); + getVulnerabilityReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listVulnerabilityReportsSettings = + PagedCallSettings.newBuilder(LIST_VULNERABILITY_REPORTS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getInventorySettings, + listInventoriesSettings, + getVulnerabilityReportSettings, + listVulnerabilityReportsSettings); + initDefaults(this); + } + + protected Builder(OsConfigZonalServiceStubSettings settings) { + super(settings); + + getInventorySettings = settings.getInventorySettings.toBuilder(); + listInventoriesSettings = settings.listInventoriesSettings.toBuilder(); + getVulnerabilityReportSettings = settings.getVulnerabilityReportSettings.toBuilder(); + listVulnerabilityReportsSettings = settings.listVulnerabilityReportsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + getInventorySettings, + listInventoriesSettings, + getVulnerabilityReportSettings, + listVulnerabilityReportsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .getInventorySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listInventoriesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getVulnerabilityReportSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listVulnerabilityReportsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + return builder; + } + + /** + * 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) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to getInventory. */ + public UnaryCallSettings.Builder getInventorySettings() { + return getInventorySettings; + } + + /** Returns the builder for the settings used for calls to listInventories. */ + public PagedCallSettings.Builder< + ListInventoriesRequest, ListInventoriesResponse, ListInventoriesPagedResponse> + listInventoriesSettings() { + return listInventoriesSettings; + } + + /** Returns the builder for the settings used for calls to getVulnerabilityReport. */ + public UnaryCallSettings.Builder + getVulnerabilityReportSettings() { + return getVulnerabilityReportSettings; + } + + /** Returns the builder for the settings used for calls to listVulnerabilityReports. */ + public PagedCallSettings.Builder< + ListVulnerabilityReportsRequest, + ListVulnerabilityReportsResponse, + ListVulnerabilityReportsPagedResponse> + listVulnerabilityReportsSettings() { + return listVulnerabilityReportsSettings; + } + + @Override + public OsConfigZonalServiceStubSettings build() throws IOException { + return new OsConfigZonalServiceStubSettings(this); + } + } +} diff --git a/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalService.java b/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalService.java new file mode 100644 index 00000000..3647b4ed --- /dev/null +++ b/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalService.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 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.osconfig.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; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockOsConfigZonalService implements MockGrpcService { + private final MockOsConfigZonalServiceImpl serviceImpl; + + public MockOsConfigZonalService() { + serviceImpl = new MockOsConfigZonalServiceImpl(); + } + + @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-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalServiceImpl.java b/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalServiceImpl.java new file mode 100644 index 00000000..14107e30 --- /dev/null +++ b/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/MockOsConfigZonalServiceImpl.java @@ -0,0 +1,145 @@ +/* + * Copyright 2021 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.osconfig.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.osconfig.v1.OsConfigZonalServiceGrpc.OsConfigZonalServiceImplBase; +import com.google.protobuf.AbstractMessage; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; +import javax.annotation.Generated; + +@BetaApi +@Generated("by gapic-generator-java") +public class MockOsConfigZonalServiceImpl extends OsConfigZonalServiceImplBase { + private List requests; + private Queue responses; + + public MockOsConfigZonalServiceImpl() { + 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 getInventory( + GetInventoryRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Inventory) { + requests.add(request); + responseObserver.onNext(((Inventory) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetInventory, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Inventory.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listInventories( + ListInventoriesRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListInventoriesResponse) { + requests.add(request); + responseObserver.onNext(((ListInventoriesResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListInventories, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListInventoriesResponse.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void getVulnerabilityReport( + GetVulnerabilityReportRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof VulnerabilityReport) { + requests.add(request); + responseObserver.onNext(((VulnerabilityReport) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method GetVulnerabilityReport, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + VulnerabilityReport.class.getName(), + Exception.class.getName()))); + } + } + + @Override + public void listVulnerabilityReports( + ListVulnerabilityReportsRequest request, + StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof ListVulnerabilityReportsResponse) { + requests.add(request); + responseObserver.onNext(((ListVulnerabilityReportsResponse) response)); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError(((Exception) response)); + } else { + responseObserver.onError( + new IllegalArgumentException( + String.format( + "Unrecognized response type %s for method ListVulnerabilityReports, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + ListVulnerabilityReportsResponse.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClientTest.java b/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClientTest.java new file mode 100644 index 00000000..11173724 --- /dev/null +++ b/google-cloud-os-config/src/test/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClientTest.java @@ -0,0 +1,434 @@ +/* + * Copyright 2021 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.osconfig.v1; + +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListInventoriesPagedResponse; +import static com.google.cloud.osconfig.v1.OsConfigZonalServiceClient.ListVulnerabilityReportsPagedResponse; + +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.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; +import javax.annotation.Generated; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@Generated("by gapic-generator-java") +public class OsConfigZonalServiceClientTest { + private static MockOsConfigZonalService mockOsConfigZonalService; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private OsConfigZonalServiceClient client; + + @BeforeClass + public static void startStaticServer() { + mockOsConfigZonalService = new MockOsConfigZonalService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockOsConfigZonalService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + OsConfigZonalServiceSettings settings = + OsConfigZonalServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = OsConfigZonalServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void getInventoryTest() throws Exception { + Inventory expectedResponse = + Inventory.newBuilder() + .setName(InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setOsInfo(Inventory.OsInfo.newBuilder().build()) + .putAllItems(new HashMap()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Inventory actualResponse = client.getInventory(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInventoryRequest actualRequest = ((GetInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInventoryExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInventoryTest2() throws Exception { + Inventory expectedResponse = + Inventory.newBuilder() + .setName(InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setOsInfo(Inventory.OsInfo.newBuilder().build()) + .putAllItems(new HashMap()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + String name = "name3373707"; + + Inventory actualResponse = client.getInventory(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetInventoryRequest actualRequest = ((GetInventoryRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getInventoryExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + String name = "name3373707"; + client.getInventory(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInventoriesTest() throws Exception { + Inventory responsesElement = Inventory.newBuilder().build(); + ListInventoriesResponse expectedResponse = + ListInventoriesResponse.newBuilder() + .setNextPageToken("") + .addAllInventories(Arrays.asList(responsesElement)) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + InstanceName parent = + InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + ListInventoriesPagedResponse pagedListResponse = client.listInventories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInventoriesList().get(0), resources.get(0)); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInventoriesRequest actualRequest = ((ListInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInventoriesExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + InstanceName parent = + InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]"); + client.listInventories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInventoriesTest2() throws Exception { + Inventory responsesElement = Inventory.newBuilder().build(); + ListInventoriesResponse expectedResponse = + ListInventoriesResponse.newBuilder() + .setNextPageToken("") + .addAllInventories(Arrays.asList(responsesElement)) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListInventoriesPagedResponse pagedListResponse = client.listInventories(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInventoriesList().get(0), resources.get(0)); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListInventoriesRequest actualRequest = ((ListInventoriesRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listInventoriesExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listInventories(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getVulnerabilityReportTest() throws Exception { + VulnerabilityReport expectedResponse = + VulnerabilityReport.newBuilder() + .setName(VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .addAllVulnerabilities(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + VulnerabilityReportName name = + VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + VulnerabilityReport actualResponse = client.getVulnerabilityReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVulnerabilityReportRequest actualRequest = + ((GetVulnerabilityReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name.toString(), actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getVulnerabilityReportExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + VulnerabilityReportName name = + VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getVulnerabilityReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getVulnerabilityReportTest2() throws Exception { + VulnerabilityReport expectedResponse = + VulnerabilityReport.newBuilder() + .setName(VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .addAllVulnerabilities(new ArrayList()) + .setUpdateTime(Timestamp.newBuilder().build()) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + String name = "name3373707"; + + VulnerabilityReport actualResponse = client.getVulnerabilityReport(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + GetVulnerabilityReportRequest actualRequest = + ((GetVulnerabilityReportRequest) actualRequests.get(0)); + + Assert.assertEquals(name, actualRequest.getName()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void getVulnerabilityReportExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + String name = "name3373707"; + client.getVulnerabilityReport(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVulnerabilityReportsTest() throws Exception { + VulnerabilityReport responsesElement = VulnerabilityReport.newBuilder().build(); + ListVulnerabilityReportsResponse expectedResponse = + ListVulnerabilityReportsResponse.newBuilder() + .setNextPageToken("") + .addAllVulnerabilityReports(Arrays.asList(responsesElement)) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + InstanceName parent = + InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]"); + + ListVulnerabilityReportsPagedResponse pagedListResponse = + client.listVulnerabilityReports(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVulnerabilityReportsList().get(0), resources.get(0)); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVulnerabilityReportsRequest actualRequest = + ((ListVulnerabilityReportsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent.toString(), actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listVulnerabilityReportsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + InstanceName parent = + InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]"); + client.listVulnerabilityReports(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listVulnerabilityReportsTest2() throws Exception { + VulnerabilityReport responsesElement = VulnerabilityReport.newBuilder().build(); + ListVulnerabilityReportsResponse expectedResponse = + ListVulnerabilityReportsResponse.newBuilder() + .setNextPageToken("") + .addAllVulnerabilityReports(Arrays.asList(responsesElement)) + .build(); + mockOsConfigZonalService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + + ListVulnerabilityReportsPagedResponse pagedListResponse = + client.listVulnerabilityReports(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getVulnerabilityReportsList().get(0), resources.get(0)); + + List actualRequests = mockOsConfigZonalService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListVulnerabilityReportsRequest actualRequest = + ((ListVulnerabilityReportsRequest) actualRequests.get(0)); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void listVulnerabilityReportsExceptionTest2() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockOsConfigZonalService.addException(exception); + + try { + String parent = "parent-995424086"; + client.listVulnerabilityReports(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/grpc-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceGrpc.java b/grpc-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceGrpc.java new file mode 100644 index 00000000..dcd3012f --- /dev/null +++ b/grpc-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceGrpc.java @@ -0,0 +1,754 @@ +/* + * 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.osconfig.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Zonal OS Config API
+ * The OS Config service is the server-side component that allows users to
+ * manage package installations and patch jobs for Compute Engine VM instances.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/osconfig/v1/osconfig_zonal_service.proto") +public final class OsConfigZonalServiceGrpc { + + private OsConfigZonalServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.osconfig.v1.OsConfigZonalService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.GetInventoryRequest, com.google.cloud.osconfig.v1.Inventory> + getGetInventoryMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetInventory", + requestType = com.google.cloud.osconfig.v1.GetInventoryRequest.class, + responseType = com.google.cloud.osconfig.v1.Inventory.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.GetInventoryRequest, com.google.cloud.osconfig.v1.Inventory> + getGetInventoryMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.GetInventoryRequest, + com.google.cloud.osconfig.v1.Inventory> + getGetInventoryMethod; + if ((getGetInventoryMethod = OsConfigZonalServiceGrpc.getGetInventoryMethod) == null) { + synchronized (OsConfigZonalServiceGrpc.class) { + if ((getGetInventoryMethod = OsConfigZonalServiceGrpc.getGetInventoryMethod) == null) { + OsConfigZonalServiceGrpc.getGetInventoryMethod = + getGetInventoryMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetInventory")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.GetInventoryRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.Inventory.getDefaultInstance())) + .setSchemaDescriptor( + new OsConfigZonalServiceMethodDescriptorSupplier("GetInventory")) + .build(); + } + } + } + return getGetInventoryMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.ListInventoriesRequest, + com.google.cloud.osconfig.v1.ListInventoriesResponse> + getListInventoriesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListInventories", + requestType = com.google.cloud.osconfig.v1.ListInventoriesRequest.class, + responseType = com.google.cloud.osconfig.v1.ListInventoriesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.ListInventoriesRequest, + com.google.cloud.osconfig.v1.ListInventoriesResponse> + getListInventoriesMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.ListInventoriesRequest, + com.google.cloud.osconfig.v1.ListInventoriesResponse> + getListInventoriesMethod; + if ((getListInventoriesMethod = OsConfigZonalServiceGrpc.getListInventoriesMethod) == null) { + synchronized (OsConfigZonalServiceGrpc.class) { + if ((getListInventoriesMethod = OsConfigZonalServiceGrpc.getListInventoriesMethod) + == null) { + OsConfigZonalServiceGrpc.getListInventoriesMethod = + getListInventoriesMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListInventories")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.ListInventoriesRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.ListInventoriesResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new OsConfigZonalServiceMethodDescriptorSupplier("ListInventories")) + .build(); + } + } + } + return getListInventoriesMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest, + com.google.cloud.osconfig.v1.VulnerabilityReport> + getGetVulnerabilityReportMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetVulnerabilityReport", + requestType = com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.class, + responseType = com.google.cloud.osconfig.v1.VulnerabilityReport.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest, + com.google.cloud.osconfig.v1.VulnerabilityReport> + getGetVulnerabilityReportMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest, + com.google.cloud.osconfig.v1.VulnerabilityReport> + getGetVulnerabilityReportMethod; + if ((getGetVulnerabilityReportMethod = OsConfigZonalServiceGrpc.getGetVulnerabilityReportMethod) + == null) { + synchronized (OsConfigZonalServiceGrpc.class) { + if ((getGetVulnerabilityReportMethod = + OsConfigZonalServiceGrpc.getGetVulnerabilityReportMethod) + == null) { + OsConfigZonalServiceGrpc.getGetVulnerabilityReportMethod = + getGetVulnerabilityReportMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "GetVulnerabilityReport")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.VulnerabilityReport + .getDefaultInstance())) + .setSchemaDescriptor( + new OsConfigZonalServiceMethodDescriptorSupplier( + "GetVulnerabilityReport")) + .build(); + } + } + } + return getGetVulnerabilityReportMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse> + getListVulnerabilityReportsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListVulnerabilityReports", + requestType = com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.class, + responseType = com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse> + getListVulnerabilityReportsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse> + getListVulnerabilityReportsMethod; + if ((getListVulnerabilityReportsMethod = + OsConfigZonalServiceGrpc.getListVulnerabilityReportsMethod) + == null) { + synchronized (OsConfigZonalServiceGrpc.class) { + if ((getListVulnerabilityReportsMethod = + OsConfigZonalServiceGrpc.getListVulnerabilityReportsMethod) + == null) { + OsConfigZonalServiceGrpc.getListVulnerabilityReportsMethod = + getListVulnerabilityReportsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName(SERVICE_NAME, "ListVulnerabilityReports")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new OsConfigZonalServiceMethodDescriptorSupplier( + "ListVulnerabilityReports")) + .build(); + } + } + } + return getListVulnerabilityReportsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static OsConfigZonalServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsConfigZonalServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsConfigZonalServiceStub(channel, callOptions); + } + }; + return OsConfigZonalServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static OsConfigZonalServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsConfigZonalServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsConfigZonalServiceBlockingStub(channel, callOptions); + } + }; + return OsConfigZonalServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static OsConfigZonalServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public OsConfigZonalServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsConfigZonalServiceFutureStub(channel, callOptions); + } + }; + return OsConfigZonalServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Zonal OS Config API
+   * The OS Config service is the server-side component that allows users to
+   * manage package installations and patch jobs for Compute Engine VM instances.
+   * 
+ */ + public abstract static class OsConfigZonalServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Get inventory data for the specified VM instance. If the VM has no
+     * associated inventory, the message `NOT_FOUND` is returned.
+     * 
+ */ + public void getInventory( + com.google.cloud.osconfig.v1.GetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetInventoryMethod(), responseObserver); + } + + /** + * + * + *
+     * List inventory data for all VM instances in the specified zone.
+     * 
+ */ + public void listInventories( + com.google.cloud.osconfig.v1.ListInventoriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListInventoriesMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the vulnerability report for the specified VM instance. Only VMs with
+     * inventory data have vulnerability reports associated with them.
+     * 
+ */ + public void getVulnerabilityReport( + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getGetVulnerabilityReportMethod(), responseObserver); + } + + /** + * + * + *
+     * List vulnerability reports for all VM instances in the specified zone.
+     * 
+ */ + public void listVulnerabilityReports( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListVulnerabilityReportsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getGetInventoryMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.osconfig.v1.GetInventoryRequest, + com.google.cloud.osconfig.v1.Inventory>(this, METHODID_GET_INVENTORY))) + .addMethod( + getListInventoriesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.osconfig.v1.ListInventoriesRequest, + com.google.cloud.osconfig.v1.ListInventoriesResponse>( + this, METHODID_LIST_INVENTORIES))) + .addMethod( + getGetVulnerabilityReportMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest, + com.google.cloud.osconfig.v1.VulnerabilityReport>( + this, METHODID_GET_VULNERABILITY_REPORT))) + .addMethod( + getListVulnerabilityReportsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse>( + this, METHODID_LIST_VULNERABILITY_REPORTS))) + .build(); + } + } + + /** + * + * + *
+   * Zonal OS Config API
+   * The OS Config service is the server-side component that allows users to
+   * manage package installations and patch jobs for Compute Engine VM instances.
+   * 
+ */ + public static final class OsConfigZonalServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private OsConfigZonalServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsConfigZonalServiceStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsConfigZonalServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Get inventory data for the specified VM instance. If the VM has no
+     * associated inventory, the message `NOT_FOUND` is returned.
+     * 
+ */ + public void getInventory( + com.google.cloud.osconfig.v1.GetInventoryRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetInventoryMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List inventory data for all VM instances in the specified zone.
+     * 
+ */ + public void listInventories( + com.google.cloud.osconfig.v1.ListInventoriesRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListInventoriesMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the vulnerability report for the specified VM instance. Only VMs with
+     * inventory data have vulnerability reports associated with them.
+     * 
+ */ + public void getVulnerabilityReport( + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetVulnerabilityReportMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * List vulnerability reports for all VM instances in the specified zone.
+     * 
+ */ + public void listVulnerabilityReports( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListVulnerabilityReportsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Zonal OS Config API
+   * The OS Config service is the server-side component that allows users to
+   * manage package installations and patch jobs for Compute Engine VM instances.
+   * 
+ */ + public static final class OsConfigZonalServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private OsConfigZonalServiceBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsConfigZonalServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsConfigZonalServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Get inventory data for the specified VM instance. If the VM has no
+     * associated inventory, the message `NOT_FOUND` is returned.
+     * 
+ */ + public com.google.cloud.osconfig.v1.Inventory getInventory( + com.google.cloud.osconfig.v1.GetInventoryRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetInventoryMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List inventory data for all VM instances in the specified zone.
+     * 
+ */ + public com.google.cloud.osconfig.v1.ListInventoriesResponse listInventories( + com.google.cloud.osconfig.v1.ListInventoriesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListInventoriesMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the vulnerability report for the specified VM instance. Only VMs with
+     * inventory data have vulnerability reports associated with them.
+     * 
+ */ + public com.google.cloud.osconfig.v1.VulnerabilityReport getVulnerabilityReport( + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetVulnerabilityReportMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * List vulnerability reports for all VM instances in the specified zone.
+     * 
+ */ + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse listVulnerabilityReports( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListVulnerabilityReportsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Zonal OS Config API
+   * The OS Config service is the server-side component that allows users to
+   * manage package installations and patch jobs for Compute Engine VM instances.
+   * 
+ */ + public static final class OsConfigZonalServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private OsConfigZonalServiceFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected OsConfigZonalServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new OsConfigZonalServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Get inventory data for the specified VM instance. If the VM has no
+     * associated inventory, the message `NOT_FOUND` is returned.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.osconfig.v1.Inventory> + getInventory(com.google.cloud.osconfig.v1.GetInventoryRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetInventoryMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List inventory data for all VM instances in the specified zone.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.osconfig.v1.ListInventoriesResponse> + listInventories(com.google.cloud.osconfig.v1.ListInventoriesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListInventoriesMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the vulnerability report for the specified VM instance. Only VMs with
+     * inventory data have vulnerability reports associated with them.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.osconfig.v1.VulnerabilityReport> + getVulnerabilityReport(com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetVulnerabilityReportMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * List vulnerability reports for all VM instances in the specified zone.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse> + listVulnerabilityReports( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListVulnerabilityReportsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_GET_INVENTORY = 0; + private static final int METHODID_LIST_INVENTORIES = 1; + private static final int METHODID_GET_VULNERABILITY_REPORT = 2; + private static final int METHODID_LIST_VULNERABILITY_REPORTS = 3; + + 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 OsConfigZonalServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(OsConfigZonalServiceImplBase 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_GET_INVENTORY: + serviceImpl.getInventory( + (com.google.cloud.osconfig.v1.GetInventoryRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_INVENTORIES: + serviceImpl.listInventories( + (com.google.cloud.osconfig.v1.ListInventoriesRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_VULNERABILITY_REPORT: + serviceImpl.getVulnerabilityReport( + (com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_VULNERABILITY_REPORTS: + serviceImpl.listVulnerabilityReports( + (com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse>) + 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 OsConfigZonalServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + OsConfigZonalServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.osconfig.v1.OsConfigZonalServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("OsConfigZonalService"); + } + } + + private static final class OsConfigZonalServiceFileDescriptorSupplier + extends OsConfigZonalServiceBaseDescriptorSupplier { + OsConfigZonalServiceFileDescriptorSupplier() {} + } + + private static final class OsConfigZonalServiceMethodDescriptorSupplier + extends OsConfigZonalServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + OsConfigZonalServiceMethodDescriptorSupplier(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 (OsConfigZonalServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new OsConfigZonalServiceFileDescriptorSupplier()) + .addMethod(getGetInventoryMethod()) + .addMethod(getListInventoriesMethod()) + .addMethod(getGetVulnerabilityReportMethod()) + .addMethod(getListVulnerabilityReportsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3.java new file mode 100644 index 00000000..df8e9451 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3.java @@ -0,0 +1,3131 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * Common Vulnerability Scoring System version 3.
+ * For details, see https://www.first.org/cvss/specification-document
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.CVSSv3} + */ +public final class CVSSv3 extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.CVSSv3) + CVSSv3OrBuilder { + private static final long serialVersionUID = 0L; + // Use CVSSv3.newBuilder() to construct. + private CVSSv3(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CVSSv3() { + attackVector_ = 0; + attackComplexity_ = 0; + privilegesRequired_ = 0; + userInteraction_ = 0; + scope_ = 0; + confidentialityImpact_ = 0; + integrityImpact_ = 0; + availabilityImpact_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CVSSv3(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CVSSv3( + 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 13: + { + baseScore_ = input.readFloat(); + break; + } + case 21: + { + exploitabilityScore_ = input.readFloat(); + break; + } + case 29: + { + impactScore_ = input.readFloat(); + break; + } + case 40: + { + int rawValue = input.readEnum(); + + attackVector_ = rawValue; + break; + } + case 48: + { + int rawValue = input.readEnum(); + + attackComplexity_ = rawValue; + break; + } + case 56: + { + int rawValue = input.readEnum(); + + privilegesRequired_ = rawValue; + break; + } + case 64: + { + int rawValue = input.readEnum(); + + userInteraction_ = rawValue; + break; + } + case 72: + { + int rawValue = input.readEnum(); + + scope_ = rawValue; + break; + } + case 80: + { + int rawValue = input.readEnum(); + + confidentialityImpact_ = rawValue; + break; + } + case 88: + { + int rawValue = input.readEnum(); + + integrityImpact_ = rawValue; + break; + } + case 96: + { + int rawValue = input.readEnum(); + + availabilityImpact_ = 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.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_CVSSv3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_CVSSv3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.CVSSv3.class, + com.google.cloud.osconfig.v1.CVSSv3.Builder.class); + } + + /** + * + * + *
+   * This metric reflects the context by which vulnerability exploitation is
+   * possible.
+   * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.CVSSv3.AttackVector} + */ + public enum AttackVector implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * ATTACK_VECTOR_UNSPECIFIED = 0; + */ + ATTACK_VECTOR_UNSPECIFIED(0), + /** + * + * + *
+     * The vulnerable component is bound to the network stack and the set of
+     * possible attackers extends beyond the other options listed below, up to
+     * and including the entire Internet.
+     * 
+ * + * ATTACK_VECTOR_NETWORK = 1; + */ + ATTACK_VECTOR_NETWORK(1), + /** + * + * + *
+     * The vulnerable component is bound to the network stack, but the attack is
+     * limited at the protocol level to a logically adjacent topology.
+     * 
+ * + * ATTACK_VECTOR_ADJACENT = 2; + */ + ATTACK_VECTOR_ADJACENT(2), + /** + * + * + *
+     * The vulnerable component is not bound to the network stack and the
+     * attacker's path is via read/write/execute capabilities.
+     * 
+ * + * ATTACK_VECTOR_LOCAL = 3; + */ + ATTACK_VECTOR_LOCAL(3), + /** + * + * + *
+     * The attack requires the attacker to physically touch or manipulate the
+     * vulnerable component.
+     * 
+ * + * ATTACK_VECTOR_PHYSICAL = 4; + */ + ATTACK_VECTOR_PHYSICAL(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * ATTACK_VECTOR_UNSPECIFIED = 0; + */ + public static final int ATTACK_VECTOR_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The vulnerable component is bound to the network stack and the set of
+     * possible attackers extends beyond the other options listed below, up to
+     * and including the entire Internet.
+     * 
+ * + * ATTACK_VECTOR_NETWORK = 1; + */ + public static final int ATTACK_VECTOR_NETWORK_VALUE = 1; + /** + * + * + *
+     * The vulnerable component is bound to the network stack, but the attack is
+     * limited at the protocol level to a logically adjacent topology.
+     * 
+ * + * ATTACK_VECTOR_ADJACENT = 2; + */ + public static final int ATTACK_VECTOR_ADJACENT_VALUE = 2; + /** + * + * + *
+     * The vulnerable component is not bound to the network stack and the
+     * attacker's path is via read/write/execute capabilities.
+     * 
+ * + * ATTACK_VECTOR_LOCAL = 3; + */ + public static final int ATTACK_VECTOR_LOCAL_VALUE = 3; + /** + * + * + *
+     * The attack requires the attacker to physically touch or manipulate the
+     * vulnerable component.
+     * 
+ * + * ATTACK_VECTOR_PHYSICAL = 4; + */ + public static final int ATTACK_VECTOR_PHYSICAL_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 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 ATTACK_VECTOR_NETWORK; + case 2: + return ATTACK_VECTOR_ADJACENT; + case 3: + return ATTACK_VECTOR_LOCAL; + case 4: + return ATTACK_VECTOR_PHYSICAL; + 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.osconfig.v1.CVSSv3.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.osconfig.v1.CVSSv3.AttackVector) + } + + /** + * + * + *
+   * This metric describes the conditions beyond the attacker's control that
+   * must exist in order to exploit the vulnerability.
+   * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.CVSSv3.AttackComplexity} + */ + public enum AttackComplexity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * ATTACK_COMPLEXITY_UNSPECIFIED = 0; + */ + ATTACK_COMPLEXITY_UNSPECIFIED(0), + /** + * + * + *
+     * Specialized access conditions or extenuating circumstances do not exist.
+     * An attacker can expect repeatable success when attacking the vulnerable
+     * component.
+     * 
+ * + * ATTACK_COMPLEXITY_LOW = 1; + */ + ATTACK_COMPLEXITY_LOW(1), + /** + * + * + *
+     * A successful attack depends on conditions beyond the attacker's control.
+     * That is, a successful attack cannot be accomplished at will, but requires
+     * the attacker to invest in some measurable amount of effort in preparation
+     * or execution against the vulnerable component before a successful attack
+     * can be expected.
+     * 
+ * + * ATTACK_COMPLEXITY_HIGH = 2; + */ + ATTACK_COMPLEXITY_HIGH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * ATTACK_COMPLEXITY_UNSPECIFIED = 0; + */ + public static final int ATTACK_COMPLEXITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Specialized access conditions or extenuating circumstances do not exist.
+     * An attacker can expect repeatable success when attacking the vulnerable
+     * component.
+     * 
+ * + * ATTACK_COMPLEXITY_LOW = 1; + */ + public static final int ATTACK_COMPLEXITY_LOW_VALUE = 1; + /** + * + * + *
+     * A successful attack depends on conditions beyond the attacker's control.
+     * That is, a successful attack cannot be accomplished at will, but requires
+     * the attacker to invest in some measurable amount of effort in preparation
+     * or execution against the vulnerable component before a successful attack
+     * can be expected.
+     * 
+ * + * ATTACK_COMPLEXITY_HIGH = 2; + */ + public static final int ATTACK_COMPLEXITY_HIGH_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 AttackComplexity 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 AttackComplexity forNumber(int value) { + switch (value) { + case 0: + return ATTACK_COMPLEXITY_UNSPECIFIED; + case 1: + return ATTACK_COMPLEXITY_LOW; + case 2: + return ATTACK_COMPLEXITY_HIGH; + 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 AttackComplexity findValueByNumber(int number) { + return AttackComplexity.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.osconfig.v1.CVSSv3.getDescriptor().getEnumTypes().get(1); + } + + private static final AttackComplexity[] VALUES = values(); + + public static AttackComplexity 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 AttackComplexity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.osconfig.v1.CVSSv3.AttackComplexity) + } + + /** + * + * + *
+   * This metric describes the level of privileges an attacker must possess
+   * before successfully exploiting the vulnerability.
+   * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired} + */ + public enum PrivilegesRequired implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + */ + PRIVILEGES_REQUIRED_UNSPECIFIED(0), + /** + * + * + *
+     * The attacker is unauthorized prior to attack, and therefore does not
+     * require any access to settings or files of the vulnerable system to
+     * carry out an attack.
+     * 
+ * + * PRIVILEGES_REQUIRED_NONE = 1; + */ + PRIVILEGES_REQUIRED_NONE(1), + /** + * + * + *
+     * The attacker requires privileges that provide basic user capabilities
+     * that could normally affect only settings and files owned by a user.
+     * Alternatively, an attacker with Low privileges has the ability to access
+     * only non-sensitive resources.
+     * 
+ * + * PRIVILEGES_REQUIRED_LOW = 2; + */ + PRIVILEGES_REQUIRED_LOW(2), + /** + * + * + *
+     * The attacker requires privileges that provide significant (e.g.,
+     * administrative) control over the vulnerable component allowing access to
+     * component-wide settings and files.
+     * 
+ * + * PRIVILEGES_REQUIRED_HIGH = 3; + */ + PRIVILEGES_REQUIRED_HIGH(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + */ + public static final int PRIVILEGES_REQUIRED_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The attacker is unauthorized prior to attack, and therefore does not
+     * require any access to settings or files of the vulnerable system to
+     * carry out an attack.
+     * 
+ * + * PRIVILEGES_REQUIRED_NONE = 1; + */ + public static final int PRIVILEGES_REQUIRED_NONE_VALUE = 1; + /** + * + * + *
+     * The attacker requires privileges that provide basic user capabilities
+     * that could normally affect only settings and files owned by a user.
+     * Alternatively, an attacker with Low privileges has the ability to access
+     * only non-sensitive resources.
+     * 
+ * + * PRIVILEGES_REQUIRED_LOW = 2; + */ + public static final int PRIVILEGES_REQUIRED_LOW_VALUE = 2; + /** + * + * + *
+     * The attacker requires privileges that provide significant (e.g.,
+     * administrative) control over the vulnerable component allowing access to
+     * component-wide settings and files.
+     * 
+ * + * PRIVILEGES_REQUIRED_HIGH = 3; + */ + public static final int PRIVILEGES_REQUIRED_HIGH_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 PrivilegesRequired 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 PrivilegesRequired forNumber(int value) { + switch (value) { + case 0: + return PRIVILEGES_REQUIRED_UNSPECIFIED; + case 1: + return PRIVILEGES_REQUIRED_NONE; + case 2: + return PRIVILEGES_REQUIRED_LOW; + case 3: + return PRIVILEGES_REQUIRED_HIGH; + 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 PrivilegesRequired findValueByNumber(int number) { + return PrivilegesRequired.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.osconfig.v1.CVSSv3.getDescriptor().getEnumTypes().get(2); + } + + private static final PrivilegesRequired[] VALUES = values(); + + public static PrivilegesRequired 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 PrivilegesRequired(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired) + } + + /** + * + * + *
+   * This metric captures the requirement for a human user, other than the
+   * attacker, to participate in the successful compromise of the vulnerable
+   * component.
+   * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.CVSSv3.UserInteraction} + */ + public enum UserInteraction implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * USER_INTERACTION_UNSPECIFIED = 0; + */ + USER_INTERACTION_UNSPECIFIED(0), + /** + * + * + *
+     * The vulnerable system can be exploited without interaction from any user.
+     * 
+ * + * USER_INTERACTION_NONE = 1; + */ + USER_INTERACTION_NONE(1), + /** + * + * + *
+     * Successful exploitation of this vulnerability requires a user to take
+     * some action before the vulnerability can be exploited.
+     * 
+ * + * USER_INTERACTION_REQUIRED = 2; + */ + USER_INTERACTION_REQUIRED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * USER_INTERACTION_UNSPECIFIED = 0; + */ + public static final int USER_INTERACTION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The vulnerable system can be exploited without interaction from any user.
+     * 
+ * + * USER_INTERACTION_NONE = 1; + */ + public static final int USER_INTERACTION_NONE_VALUE = 1; + /** + * + * + *
+     * Successful exploitation of this vulnerability requires a user to take
+     * some action before the vulnerability can be exploited.
+     * 
+ * + * USER_INTERACTION_REQUIRED = 2; + */ + public static final int USER_INTERACTION_REQUIRED_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 UserInteraction 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 UserInteraction forNumber(int value) { + switch (value) { + case 0: + return USER_INTERACTION_UNSPECIFIED; + case 1: + return USER_INTERACTION_NONE; + case 2: + return USER_INTERACTION_REQUIRED; + 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 UserInteraction findValueByNumber(int number) { + return UserInteraction.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.osconfig.v1.CVSSv3.getDescriptor().getEnumTypes().get(3); + } + + private static final UserInteraction[] VALUES = values(); + + public static UserInteraction 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 UserInteraction(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.osconfig.v1.CVSSv3.UserInteraction) + } + + /** + * + * + *
+   * The Scope metric captures whether a vulnerability in one vulnerable
+   * component impacts resources in components beyond its security scope.
+   * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.CVSSv3.Scope} + */ + public enum Scope implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * SCOPE_UNSPECIFIED = 0; + */ + SCOPE_UNSPECIFIED(0), + /** + * + * + *
+     * An exploited vulnerability can only affect resources managed by the same
+     * security authority.
+     * 
+ * + * SCOPE_UNCHANGED = 1; + */ + SCOPE_UNCHANGED(1), + /** + * + * + *
+     * An exploited vulnerability can affect resources beyond the security scope
+     * managed by the security authority of the vulnerable component.
+     * 
+ * + * SCOPE_CHANGED = 2; + */ + SCOPE_CHANGED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * SCOPE_UNSPECIFIED = 0; + */ + public static final int SCOPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * An exploited vulnerability can only affect resources managed by the same
+     * security authority.
+     * 
+ * + * SCOPE_UNCHANGED = 1; + */ + public static final int SCOPE_UNCHANGED_VALUE = 1; + /** + * + * + *
+     * An exploited vulnerability can affect resources beyond the security scope
+     * managed by the security authority of the vulnerable component.
+     * 
+ * + * SCOPE_CHANGED = 2; + */ + public static final int SCOPE_CHANGED_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 Scope 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 Scope forNumber(int value) { + switch (value) { + case 0: + return SCOPE_UNSPECIFIED; + case 1: + return SCOPE_UNCHANGED; + case 2: + return SCOPE_CHANGED; + 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 Scope findValueByNumber(int number) { + return Scope.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.osconfig.v1.CVSSv3.getDescriptor().getEnumTypes().get(4); + } + + private static final Scope[] VALUES = values(); + + public static Scope 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 Scope(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.osconfig.v1.CVSSv3.Scope) + } + + /** + * + * + *
+   * The Impact metrics capture the effects of a successfully exploited
+   * vulnerability on the component that suffers the worst outcome that is most
+   * directly and predictably associated with the attack.
+   * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.CVSSv3.Impact} + */ + public enum Impact implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * IMPACT_UNSPECIFIED = 0; + */ + IMPACT_UNSPECIFIED(0), + /** + * + * + *
+     * High impact.
+     * 
+ * + * IMPACT_HIGH = 1; + */ + IMPACT_HIGH(1), + /** + * + * + *
+     * Low impact.
+     * 
+ * + * IMPACT_LOW = 2; + */ + IMPACT_LOW(2), + /** + * + * + *
+     * No impact.
+     * 
+ * + * IMPACT_NONE = 3; + */ + IMPACT_NONE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Invalid value.
+     * 
+ * + * IMPACT_UNSPECIFIED = 0; + */ + public static final int IMPACT_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * High impact.
+     * 
+ * + * IMPACT_HIGH = 1; + */ + public static final int IMPACT_HIGH_VALUE = 1; + /** + * + * + *
+     * Low impact.
+     * 
+ * + * IMPACT_LOW = 2; + */ + public static final int IMPACT_LOW_VALUE = 2; + /** + * + * + *
+     * No impact.
+     * 
+ * + * IMPACT_NONE = 3; + */ + public static final int IMPACT_NONE_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 Impact 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 Impact forNumber(int value) { + switch (value) { + case 0: + return IMPACT_UNSPECIFIED; + case 1: + return IMPACT_HIGH; + case 2: + return IMPACT_LOW; + case 3: + return IMPACT_NONE; + 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 Impact findValueByNumber(int number) { + return Impact.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.osconfig.v1.CVSSv3.getDescriptor().getEnumTypes().get(5); + } + + private static final Impact[] VALUES = values(); + + public static Impact 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 Impact(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.osconfig.v1.CVSSv3.Impact) + } + + public static final int BASE_SCORE_FIELD_NUMBER = 1; + private float baseScore_; + /** + * + * + *
+   * The base score is a function of the base metric scores.
+   * https://www.first.org/cvss/specification-document#Base-Metrics
+   * 
+ * + * float base_score = 1; + * + * @return The baseScore. + */ + @java.lang.Override + public float getBaseScore() { + return baseScore_; + } + + public static final int EXPLOITABILITY_SCORE_FIELD_NUMBER = 2; + private float exploitabilityScore_; + /** + * + * + *
+   * The Exploitability sub-score equation is derived from the Base
+   * Exploitability metrics.
+   * https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics
+   * 
+ * + * float exploitability_score = 2; + * + * @return The exploitabilityScore. + */ + @java.lang.Override + public float getExploitabilityScore() { + return exploitabilityScore_; + } + + public static final int IMPACT_SCORE_FIELD_NUMBER = 3; + private float impactScore_; + /** + * + * + *
+   * The Impact sub-score equation is derived from the Base Impact metrics.
+   * 
+ * + * float impact_score = 3; + * + * @return The impactScore. + */ + @java.lang.Override + public float getImpactScore() { + return impactScore_; + } + + public static final int ATTACK_VECTOR_FIELD_NUMBER = 5; + private int attackVector_; + /** + * + * + *
+   * This metric reflects the context by which vulnerability exploitation is
+   * possible.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return The enum numeric value on the wire for attackVector. + */ + @java.lang.Override + public int getAttackVectorValue() { + return attackVector_; + } + /** + * + * + *
+   * This metric reflects the context by which vulnerability exploitation is
+   * possible.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return The attackVector. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.AttackVector getAttackVector() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.AttackVector result = + com.google.cloud.osconfig.v1.CVSSv3.AttackVector.valueOf(attackVector_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.AttackVector.UNRECOGNIZED : result; + } + + public static final int ATTACK_COMPLEXITY_FIELD_NUMBER = 6; + private int attackComplexity_; + /** + * + * + *
+   * This metric describes the conditions beyond the attacker's control that
+   * must exist in order to exploit the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return The enum numeric value on the wire for attackComplexity. + */ + @java.lang.Override + public int getAttackComplexityValue() { + return attackComplexity_; + } + /** + * + * + *
+   * This metric describes the conditions beyond the attacker's control that
+   * must exist in order to exploit the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return The attackComplexity. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity getAttackComplexity() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity result = + com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity.valueOf(attackComplexity_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity.UNRECOGNIZED + : result; + } + + public static final int PRIVILEGES_REQUIRED_FIELD_NUMBER = 7; + private int privilegesRequired_; + /** + * + * + *
+   * This metric describes the level of privileges an attacker must possess
+   * before successfully exploiting the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return The enum numeric value on the wire for privilegesRequired. + */ + @java.lang.Override + public int getPrivilegesRequiredValue() { + return privilegesRequired_; + } + /** + * + * + *
+   * This metric describes the level of privileges an attacker must possess
+   * before successfully exploiting the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return The privilegesRequired. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired getPrivilegesRequired() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired result = + com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired.valueOf(privilegesRequired_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired.UNRECOGNIZED + : result; + } + + public static final int USER_INTERACTION_FIELD_NUMBER = 8; + private int userInteraction_; + /** + * + * + *
+   * This metric captures the requirement for a human user, other than the
+   * attacker, to participate in the successful compromise of the vulnerable
+   * component.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return The enum numeric value on the wire for userInteraction. + */ + @java.lang.Override + public int getUserInteractionValue() { + return userInteraction_; + } + /** + * + * + *
+   * This metric captures the requirement for a human user, other than the
+   * attacker, to participate in the successful compromise of the vulnerable
+   * component.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return The userInteraction. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.UserInteraction getUserInteraction() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.UserInteraction result = + com.google.cloud.osconfig.v1.CVSSv3.UserInteraction.valueOf(userInteraction_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.UserInteraction.UNRECOGNIZED + : result; + } + + public static final int SCOPE_FIELD_NUMBER = 9; + private int scope_; + /** + * + * + *
+   * The Scope metric captures whether a vulnerability in one vulnerable
+   * component impacts resources in components beyond its security scope.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return The enum numeric value on the wire for scope. + */ + @java.lang.Override + public int getScopeValue() { + return scope_; + } + /** + * + * + *
+   * The Scope metric captures whether a vulnerability in one vulnerable
+   * component impacts resources in components beyond its security scope.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return The scope. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Scope getScope() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Scope result = + com.google.cloud.osconfig.v1.CVSSv3.Scope.valueOf(scope_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Scope.UNRECOGNIZED : result; + } + + public static final int CONFIDENTIALITY_IMPACT_FIELD_NUMBER = 10; + private int confidentialityImpact_; + /** + * + * + *
+   * This metric measures the impact to the confidentiality of the information
+   * resources managed by a software component due to a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return The enum numeric value on the wire for confidentialityImpact. + */ + @java.lang.Override + public int getConfidentialityImpactValue() { + return confidentialityImpact_; + } + /** + * + * + *
+   * This metric measures the impact to the confidentiality of the information
+   * resources managed by a software component due to a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return The confidentialityImpact. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Impact getConfidentialityImpact() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Impact result = + com.google.cloud.osconfig.v1.CVSSv3.Impact.valueOf(confidentialityImpact_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Impact.UNRECOGNIZED : result; + } + + public static final int INTEGRITY_IMPACT_FIELD_NUMBER = 11; + private int integrityImpact_; + /** + * + * + *
+   * This metric measures the impact to integrity of a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return The enum numeric value on the wire for integrityImpact. + */ + @java.lang.Override + public int getIntegrityImpactValue() { + return integrityImpact_; + } + /** + * + * + *
+   * This metric measures the impact to integrity of a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return The integrityImpact. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Impact getIntegrityImpact() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Impact result = + com.google.cloud.osconfig.v1.CVSSv3.Impact.valueOf(integrityImpact_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Impact.UNRECOGNIZED : result; + } + + public static final int AVAILABILITY_IMPACT_FIELD_NUMBER = 12; + private int availabilityImpact_; + /** + * + * + *
+   * This metric measures the impact to the availability of the impacted
+   * component resulting from a successfully exploited vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return The enum numeric value on the wire for availabilityImpact. + */ + @java.lang.Override + public int getAvailabilityImpactValue() { + return availabilityImpact_; + } + /** + * + * + *
+   * This metric measures the impact to the availability of the impacted
+   * component resulting from a successfully exploited vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return The availabilityImpact. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Impact getAvailabilityImpact() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Impact result = + com.google.cloud.osconfig.v1.CVSSv3.Impact.valueOf(availabilityImpact_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Impact.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 (baseScore_ != 0F) { + output.writeFloat(1, baseScore_); + } + if (exploitabilityScore_ != 0F) { + output.writeFloat(2, exploitabilityScore_); + } + if (impactScore_ != 0F) { + output.writeFloat(3, impactScore_); + } + if (attackVector_ + != com.google.cloud.osconfig.v1.CVSSv3.AttackVector.ATTACK_VECTOR_UNSPECIFIED.getNumber()) { + output.writeEnum(5, attackVector_); + } + if (attackComplexity_ + != com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity.ATTACK_COMPLEXITY_UNSPECIFIED + .getNumber()) { + output.writeEnum(6, attackComplexity_); + } + if (privilegesRequired_ + != com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired.PRIVILEGES_REQUIRED_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, privilegesRequired_); + } + if (userInteraction_ + != com.google.cloud.osconfig.v1.CVSSv3.UserInteraction.USER_INTERACTION_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, userInteraction_); + } + if (scope_ != com.google.cloud.osconfig.v1.CVSSv3.Scope.SCOPE_UNSPECIFIED.getNumber()) { + output.writeEnum(9, scope_); + } + if (confidentialityImpact_ + != com.google.cloud.osconfig.v1.CVSSv3.Impact.IMPACT_UNSPECIFIED.getNumber()) { + output.writeEnum(10, confidentialityImpact_); + } + if (integrityImpact_ + != com.google.cloud.osconfig.v1.CVSSv3.Impact.IMPACT_UNSPECIFIED.getNumber()) { + output.writeEnum(11, integrityImpact_); + } + if (availabilityImpact_ + != com.google.cloud.osconfig.v1.CVSSv3.Impact.IMPACT_UNSPECIFIED.getNumber()) { + output.writeEnum(12, availabilityImpact_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (baseScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, baseScore_); + } + if (exploitabilityScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, exploitabilityScore_); + } + if (impactScore_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, impactScore_); + } + if (attackVector_ + != com.google.cloud.osconfig.v1.CVSSv3.AttackVector.ATTACK_VECTOR_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, attackVector_); + } + if (attackComplexity_ + != com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity.ATTACK_COMPLEXITY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, attackComplexity_); + } + if (privilegesRequired_ + != com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired.PRIVILEGES_REQUIRED_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, privilegesRequired_); + } + if (userInteraction_ + != com.google.cloud.osconfig.v1.CVSSv3.UserInteraction.USER_INTERACTION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, userInteraction_); + } + if (scope_ != com.google.cloud.osconfig.v1.CVSSv3.Scope.SCOPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, scope_); + } + if (confidentialityImpact_ + != com.google.cloud.osconfig.v1.CVSSv3.Impact.IMPACT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, confidentialityImpact_); + } + if (integrityImpact_ + != com.google.cloud.osconfig.v1.CVSSv3.Impact.IMPACT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, integrityImpact_); + } + if (availabilityImpact_ + != com.google.cloud.osconfig.v1.CVSSv3.Impact.IMPACT_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, availabilityImpact_); + } + 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.osconfig.v1.CVSSv3)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.CVSSv3 other = (com.google.cloud.osconfig.v1.CVSSv3) obj; + + if (java.lang.Float.floatToIntBits(getBaseScore()) + != java.lang.Float.floatToIntBits(other.getBaseScore())) return false; + if (java.lang.Float.floatToIntBits(getExploitabilityScore()) + != java.lang.Float.floatToIntBits(other.getExploitabilityScore())) return false; + if (java.lang.Float.floatToIntBits(getImpactScore()) + != java.lang.Float.floatToIntBits(other.getImpactScore())) return false; + if (attackVector_ != other.attackVector_) return false; + if (attackComplexity_ != other.attackComplexity_) return false; + if (privilegesRequired_ != other.privilegesRequired_) return false; + if (userInteraction_ != other.userInteraction_) return false; + if (scope_ != other.scope_) return false; + if (confidentialityImpact_ != other.confidentialityImpact_) return false; + if (integrityImpact_ != other.integrityImpact_) return false; + if (availabilityImpact_ != other.availabilityImpact_) 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) + BASE_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getBaseScore()); + hash = (37 * hash) + EXPLOITABILITY_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getExploitabilityScore()); + hash = (37 * hash) + IMPACT_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getImpactScore()); + hash = (37 * hash) + ATTACK_VECTOR_FIELD_NUMBER; + hash = (53 * hash) + attackVector_; + hash = (37 * hash) + ATTACK_COMPLEXITY_FIELD_NUMBER; + hash = (53 * hash) + attackComplexity_; + hash = (37 * hash) + PRIVILEGES_REQUIRED_FIELD_NUMBER; + hash = (53 * hash) + privilegesRequired_; + hash = (37 * hash) + USER_INTERACTION_FIELD_NUMBER; + hash = (53 * hash) + userInteraction_; + hash = (37 * hash) + SCOPE_FIELD_NUMBER; + hash = (53 * hash) + scope_; + hash = (37 * hash) + CONFIDENTIALITY_IMPACT_FIELD_NUMBER; + hash = (53 * hash) + confidentialityImpact_; + hash = (37 * hash) + INTEGRITY_IMPACT_FIELD_NUMBER; + hash = (53 * hash) + integrityImpact_; + hash = (37 * hash) + AVAILABILITY_IMPACT_FIELD_NUMBER; + hash = (53 * hash) + availabilityImpact_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.CVSSv3 parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 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.osconfig.v1.CVSSv3 parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 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.osconfig.v1.CVSSv3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 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.osconfig.v1.CVSSv3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 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.osconfig.v1.CVSSv3 parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 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.osconfig.v1.CVSSv3 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; + } + /** + * + * + *
+   * Common Vulnerability Scoring System version 3.
+   * For details, see https://www.first.org/cvss/specification-document
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.CVSSv3} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.CVSSv3) + com.google.cloud.osconfig.v1.CVSSv3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_CVSSv3_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_CVSSv3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.CVSSv3.class, + com.google.cloud.osconfig.v1.CVSSv3.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.CVSSv3.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(); + baseScore_ = 0F; + + exploitabilityScore_ = 0F; + + impactScore_ = 0F; + + attackVector_ = 0; + + attackComplexity_ = 0; + + privilegesRequired_ = 0; + + userInteraction_ = 0; + + scope_ = 0; + + confidentialityImpact_ = 0; + + integrityImpact_ = 0; + + availabilityImpact_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_CVSSv3_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3 getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.CVSSv3.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3 build() { + com.google.cloud.osconfig.v1.CVSSv3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3 buildPartial() { + com.google.cloud.osconfig.v1.CVSSv3 result = new com.google.cloud.osconfig.v1.CVSSv3(this); + result.baseScore_ = baseScore_; + result.exploitabilityScore_ = exploitabilityScore_; + result.impactScore_ = impactScore_; + result.attackVector_ = attackVector_; + result.attackComplexity_ = attackComplexity_; + result.privilegesRequired_ = privilegesRequired_; + result.userInteraction_ = userInteraction_; + result.scope_ = scope_; + result.confidentialityImpact_ = confidentialityImpact_; + result.integrityImpact_ = integrityImpact_; + result.availabilityImpact_ = availabilityImpact_; + 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.osconfig.v1.CVSSv3) { + return mergeFrom((com.google.cloud.osconfig.v1.CVSSv3) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.CVSSv3 other) { + if (other == com.google.cloud.osconfig.v1.CVSSv3.getDefaultInstance()) return this; + if (other.getBaseScore() != 0F) { + setBaseScore(other.getBaseScore()); + } + if (other.getExploitabilityScore() != 0F) { + setExploitabilityScore(other.getExploitabilityScore()); + } + if (other.getImpactScore() != 0F) { + setImpactScore(other.getImpactScore()); + } + if (other.attackVector_ != 0) { + setAttackVectorValue(other.getAttackVectorValue()); + } + if (other.attackComplexity_ != 0) { + setAttackComplexityValue(other.getAttackComplexityValue()); + } + if (other.privilegesRequired_ != 0) { + setPrivilegesRequiredValue(other.getPrivilegesRequiredValue()); + } + if (other.userInteraction_ != 0) { + setUserInteractionValue(other.getUserInteractionValue()); + } + if (other.scope_ != 0) { + setScopeValue(other.getScopeValue()); + } + if (other.confidentialityImpact_ != 0) { + setConfidentialityImpactValue(other.getConfidentialityImpactValue()); + } + if (other.integrityImpact_ != 0) { + setIntegrityImpactValue(other.getIntegrityImpactValue()); + } + if (other.availabilityImpact_ != 0) { + setAvailabilityImpactValue(other.getAvailabilityImpactValue()); + } + 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.osconfig.v1.CVSSv3 parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.osconfig.v1.CVSSv3) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private float baseScore_; + /** + * + * + *
+     * The base score is a function of the base metric scores.
+     * https://www.first.org/cvss/specification-document#Base-Metrics
+     * 
+ * + * float base_score = 1; + * + * @return The baseScore. + */ + @java.lang.Override + public float getBaseScore() { + return baseScore_; + } + /** + * + * + *
+     * The base score is a function of the base metric scores.
+     * https://www.first.org/cvss/specification-document#Base-Metrics
+     * 
+ * + * float base_score = 1; + * + * @param value The baseScore to set. + * @return This builder for chaining. + */ + public Builder setBaseScore(float value) { + + baseScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The base score is a function of the base metric scores.
+     * https://www.first.org/cvss/specification-document#Base-Metrics
+     * 
+ * + * float base_score = 1; + * + * @return This builder for chaining. + */ + public Builder clearBaseScore() { + + baseScore_ = 0F; + onChanged(); + return this; + } + + private float exploitabilityScore_; + /** + * + * + *
+     * The Exploitability sub-score equation is derived from the Base
+     * Exploitability metrics.
+     * https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics
+     * 
+ * + * float exploitability_score = 2; + * + * @return The exploitabilityScore. + */ + @java.lang.Override + public float getExploitabilityScore() { + return exploitabilityScore_; + } + /** + * + * + *
+     * The Exploitability sub-score equation is derived from the Base
+     * Exploitability metrics.
+     * https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics
+     * 
+ * + * float exploitability_score = 2; + * + * @param value The exploitabilityScore to set. + * @return This builder for chaining. + */ + public Builder setExploitabilityScore(float value) { + + exploitabilityScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Exploitability sub-score equation is derived from the Base
+     * Exploitability metrics.
+     * https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics
+     * 
+ * + * float exploitability_score = 2; + * + * @return This builder for chaining. + */ + public Builder clearExploitabilityScore() { + + exploitabilityScore_ = 0F; + onChanged(); + return this; + } + + private float impactScore_; + /** + * + * + *
+     * The Impact sub-score equation is derived from the Base Impact metrics.
+     * 
+ * + * float impact_score = 3; + * + * @return The impactScore. + */ + @java.lang.Override + public float getImpactScore() { + return impactScore_; + } + /** + * + * + *
+     * The Impact sub-score equation is derived from the Base Impact metrics.
+     * 
+ * + * float impact_score = 3; + * + * @param value The impactScore to set. + * @return This builder for chaining. + */ + public Builder setImpactScore(float value) { + + impactScore_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Impact sub-score equation is derived from the Base Impact metrics.
+     * 
+ * + * float impact_score = 3; + * + * @return This builder for chaining. + */ + public Builder clearImpactScore() { + + impactScore_ = 0F; + onChanged(); + return this; + } + + private int attackVector_ = 0; + /** + * + * + *
+     * This metric reflects the context by which vulnerability exploitation is
+     * possible.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return The enum numeric value on the wire for attackVector. + */ + @java.lang.Override + public int getAttackVectorValue() { + return attackVector_; + } + /** + * + * + *
+     * This metric reflects the context by which vulnerability exploitation is
+     * possible.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @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; + } + /** + * + * + *
+     * This metric reflects the context by which vulnerability exploitation is
+     * possible.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return The attackVector. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.AttackVector getAttackVector() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.AttackVector result = + com.google.cloud.osconfig.v1.CVSSv3.AttackVector.valueOf(attackVector_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.AttackVector.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * This metric reflects the context by which vulnerability exploitation is
+     * possible.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @param value The attackVector to set. + * @return This builder for chaining. + */ + public Builder setAttackVector(com.google.cloud.osconfig.v1.CVSSv3.AttackVector value) { + if (value == null) { + throw new NullPointerException(); + } + + attackVector_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric reflects the context by which vulnerability exploitation is
+     * possible.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return This builder for chaining. + */ + public Builder clearAttackVector() { + + attackVector_ = 0; + onChanged(); + return this; + } + + private int attackComplexity_ = 0; + /** + * + * + *
+     * This metric describes the conditions beyond the attacker's control that
+     * must exist in order to exploit the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return The enum numeric value on the wire for attackComplexity. + */ + @java.lang.Override + public int getAttackComplexityValue() { + return attackComplexity_; + } + /** + * + * + *
+     * This metric describes the conditions beyond the attacker's control that
+     * must exist in order to exploit the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @param value The enum numeric value on the wire for attackComplexity to set. + * @return This builder for chaining. + */ + public Builder setAttackComplexityValue(int value) { + + attackComplexity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This metric describes the conditions beyond the attacker's control that
+     * must exist in order to exploit the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return The attackComplexity. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity getAttackComplexity() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity result = + com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity.valueOf(attackComplexity_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * This metric describes the conditions beyond the attacker's control that
+     * must exist in order to exploit the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @param value The attackComplexity to set. + * @return This builder for chaining. + */ + public Builder setAttackComplexity(com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity value) { + if (value == null) { + throw new NullPointerException(); + } + + attackComplexity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric describes the conditions beyond the attacker's control that
+     * must exist in order to exploit the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return This builder for chaining. + */ + public Builder clearAttackComplexity() { + + attackComplexity_ = 0; + onChanged(); + return this; + } + + private int privilegesRequired_ = 0; + /** + * + * + *
+     * This metric describes the level of privileges an attacker must possess
+     * before successfully exploiting the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return The enum numeric value on the wire for privilegesRequired. + */ + @java.lang.Override + public int getPrivilegesRequiredValue() { + return privilegesRequired_; + } + /** + * + * + *
+     * This metric describes the level of privileges an attacker must possess
+     * before successfully exploiting the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @param value The enum numeric value on the wire for privilegesRequired to set. + * @return This builder for chaining. + */ + public Builder setPrivilegesRequiredValue(int value) { + + privilegesRequired_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This metric describes the level of privileges an attacker must possess
+     * before successfully exploiting the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return The privilegesRequired. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired getPrivilegesRequired() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired result = + com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired.valueOf(privilegesRequired_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * This metric describes the level of privileges an attacker must possess
+     * before successfully exploiting the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @param value The privilegesRequired to set. + * @return This builder for chaining. + */ + public Builder setPrivilegesRequired( + com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired value) { + if (value == null) { + throw new NullPointerException(); + } + + privilegesRequired_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric describes the level of privileges an attacker must possess
+     * before successfully exploiting the vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return This builder for chaining. + */ + public Builder clearPrivilegesRequired() { + + privilegesRequired_ = 0; + onChanged(); + return this; + } + + private int userInteraction_ = 0; + /** + * + * + *
+     * This metric captures the requirement for a human user, other than the
+     * attacker, to participate in the successful compromise of the vulnerable
+     * component.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return The enum numeric value on the wire for userInteraction. + */ + @java.lang.Override + public int getUserInteractionValue() { + return userInteraction_; + } + /** + * + * + *
+     * This metric captures the requirement for a human user, other than the
+     * attacker, to participate in the successful compromise of the vulnerable
+     * component.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @param value The enum numeric value on the wire for userInteraction to set. + * @return This builder for chaining. + */ + public Builder setUserInteractionValue(int value) { + + userInteraction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This metric captures the requirement for a human user, other than the
+     * attacker, to participate in the successful compromise of the vulnerable
+     * component.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return The userInteraction. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.UserInteraction getUserInteraction() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.UserInteraction result = + com.google.cloud.osconfig.v1.CVSSv3.UserInteraction.valueOf(userInteraction_); + return result == null + ? com.google.cloud.osconfig.v1.CVSSv3.UserInteraction.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * This metric captures the requirement for a human user, other than the
+     * attacker, to participate in the successful compromise of the vulnerable
+     * component.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @param value The userInteraction to set. + * @return This builder for chaining. + */ + public Builder setUserInteraction(com.google.cloud.osconfig.v1.CVSSv3.UserInteraction value) { + if (value == null) { + throw new NullPointerException(); + } + + userInteraction_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric captures the requirement for a human user, other than the
+     * attacker, to participate in the successful compromise of the vulnerable
+     * component.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return This builder for chaining. + */ + public Builder clearUserInteraction() { + + userInteraction_ = 0; + onChanged(); + return this; + } + + private int scope_ = 0; + /** + * + * + *
+     * The Scope metric captures whether a vulnerability in one vulnerable
+     * component impacts resources in components beyond its security scope.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return The enum numeric value on the wire for scope. + */ + @java.lang.Override + public int getScopeValue() { + return scope_; + } + /** + * + * + *
+     * The Scope metric captures whether a vulnerability in one vulnerable
+     * component impacts resources in components beyond its security scope.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @param value The enum numeric value on the wire for scope to set. + * @return This builder for chaining. + */ + public Builder setScopeValue(int value) { + + scope_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The Scope metric captures whether a vulnerability in one vulnerable
+     * component impacts resources in components beyond its security scope.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return The scope. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Scope getScope() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Scope result = + com.google.cloud.osconfig.v1.CVSSv3.Scope.valueOf(scope_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Scope.UNRECOGNIZED : result; + } + /** + * + * + *
+     * The Scope metric captures whether a vulnerability in one vulnerable
+     * component impacts resources in components beyond its security scope.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @param value The scope to set. + * @return This builder for chaining. + */ + public Builder setScope(com.google.cloud.osconfig.v1.CVSSv3.Scope value) { + if (value == null) { + throw new NullPointerException(); + } + + scope_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The Scope metric captures whether a vulnerability in one vulnerable
+     * component impacts resources in components beyond its security scope.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return This builder for chaining. + */ + public Builder clearScope() { + + scope_ = 0; + onChanged(); + return this; + } + + private int confidentialityImpact_ = 0; + /** + * + * + *
+     * This metric measures the impact to the confidentiality of the information
+     * resources managed by a software component due to a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return The enum numeric value on the wire for confidentialityImpact. + */ + @java.lang.Override + public int getConfidentialityImpactValue() { + return confidentialityImpact_; + } + /** + * + * + *
+     * This metric measures the impact to the confidentiality of the information
+     * resources managed by a software component due to a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @param value The enum numeric value on the wire for confidentialityImpact to set. + * @return This builder for chaining. + */ + public Builder setConfidentialityImpactValue(int value) { + + confidentialityImpact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This metric measures the impact to the confidentiality of the information
+     * resources managed by a software component due to a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return The confidentialityImpact. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Impact getConfidentialityImpact() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Impact result = + com.google.cloud.osconfig.v1.CVSSv3.Impact.valueOf(confidentialityImpact_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Impact.UNRECOGNIZED : result; + } + /** + * + * + *
+     * This metric measures the impact to the confidentiality of the information
+     * resources managed by a software component due to a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @param value The confidentialityImpact to set. + * @return This builder for chaining. + */ + public Builder setConfidentialityImpact(com.google.cloud.osconfig.v1.CVSSv3.Impact value) { + if (value == null) { + throw new NullPointerException(); + } + + confidentialityImpact_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric measures the impact to the confidentiality of the information
+     * resources managed by a software component due to a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return This builder for chaining. + */ + public Builder clearConfidentialityImpact() { + + confidentialityImpact_ = 0; + onChanged(); + return this; + } + + private int integrityImpact_ = 0; + /** + * + * + *
+     * This metric measures the impact to integrity of a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return The enum numeric value on the wire for integrityImpact. + */ + @java.lang.Override + public int getIntegrityImpactValue() { + return integrityImpact_; + } + /** + * + * + *
+     * This metric measures the impact to integrity of a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @param value The enum numeric value on the wire for integrityImpact to set. + * @return This builder for chaining. + */ + public Builder setIntegrityImpactValue(int value) { + + integrityImpact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This metric measures the impact to integrity of a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return The integrityImpact. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Impact getIntegrityImpact() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Impact result = + com.google.cloud.osconfig.v1.CVSSv3.Impact.valueOf(integrityImpact_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Impact.UNRECOGNIZED : result; + } + /** + * + * + *
+     * This metric measures the impact to integrity of a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @param value The integrityImpact to set. + * @return This builder for chaining. + */ + public Builder setIntegrityImpact(com.google.cloud.osconfig.v1.CVSSv3.Impact value) { + if (value == null) { + throw new NullPointerException(); + } + + integrityImpact_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric measures the impact to integrity of a successfully exploited
+     * vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return This builder for chaining. + */ + public Builder clearIntegrityImpact() { + + integrityImpact_ = 0; + onChanged(); + return this; + } + + private int availabilityImpact_ = 0; + /** + * + * + *
+     * This metric measures the impact to the availability of the impacted
+     * component resulting from a successfully exploited vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return The enum numeric value on the wire for availabilityImpact. + */ + @java.lang.Override + public int getAvailabilityImpactValue() { + return availabilityImpact_; + } + /** + * + * + *
+     * This metric measures the impact to the availability of the impacted
+     * component resulting from a successfully exploited vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @param value The enum numeric value on the wire for availabilityImpact to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityImpactValue(int value) { + + availabilityImpact_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * This metric measures the impact to the availability of the impacted
+     * component resulting from a successfully exploited vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return The availabilityImpact. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3.Impact getAvailabilityImpact() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.CVSSv3.Impact result = + com.google.cloud.osconfig.v1.CVSSv3.Impact.valueOf(availabilityImpact_); + return result == null ? com.google.cloud.osconfig.v1.CVSSv3.Impact.UNRECOGNIZED : result; + } + /** + * + * + *
+     * This metric measures the impact to the availability of the impacted
+     * component resulting from a successfully exploited vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @param value The availabilityImpact to set. + * @return This builder for chaining. + */ + public Builder setAvailabilityImpact(com.google.cloud.osconfig.v1.CVSSv3.Impact value) { + if (value == null) { + throw new NullPointerException(); + } + + availabilityImpact_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * This metric measures the impact to the availability of the impacted
+     * component resulting from a successfully exploited vulnerability.
+     * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return This builder for chaining. + */ + public Builder clearAvailabilityImpact() { + + availabilityImpact_ = 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.osconfig.v1.CVSSv3) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.CVSSv3) + private static final com.google.cloud.osconfig.v1.CVSSv3 DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.CVSSv3(); + } + + public static com.google.cloud.osconfig.v1.CVSSv3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CVSSv3 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CVSSv3(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.osconfig.v1.CVSSv3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3OrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3OrBuilder.java new file mode 100644 index 00000000..e0fa86d1 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/CVSSv3OrBuilder.java @@ -0,0 +1,287 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +public interface CVSSv3OrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.CVSSv3) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The base score is a function of the base metric scores.
+   * https://www.first.org/cvss/specification-document#Base-Metrics
+   * 
+ * + * float base_score = 1; + * + * @return The baseScore. + */ + float getBaseScore(); + + /** + * + * + *
+   * The Exploitability sub-score equation is derived from the Base
+   * Exploitability metrics.
+   * https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics
+   * 
+ * + * float exploitability_score = 2; + * + * @return The exploitabilityScore. + */ + float getExploitabilityScore(); + + /** + * + * + *
+   * The Impact sub-score equation is derived from the Base Impact metrics.
+   * 
+ * + * float impact_score = 3; + * + * @return The impactScore. + */ + float getImpactScore(); + + /** + * + * + *
+   * This metric reflects the context by which vulnerability exploitation is
+   * possible.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return The enum numeric value on the wire for attackVector. + */ + int getAttackVectorValue(); + /** + * + * + *
+   * This metric reflects the context by which vulnerability exploitation is
+   * possible.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackVector attack_vector = 5; + * + * @return The attackVector. + */ + com.google.cloud.osconfig.v1.CVSSv3.AttackVector getAttackVector(); + + /** + * + * + *
+   * This metric describes the conditions beyond the attacker's control that
+   * must exist in order to exploit the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return The enum numeric value on the wire for attackComplexity. + */ + int getAttackComplexityValue(); + /** + * + * + *
+   * This metric describes the conditions beyond the attacker's control that
+   * must exist in order to exploit the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.AttackComplexity attack_complexity = 6; + * + * @return The attackComplexity. + */ + com.google.cloud.osconfig.v1.CVSSv3.AttackComplexity getAttackComplexity(); + + /** + * + * + *
+   * This metric describes the level of privileges an attacker must possess
+   * before successfully exploiting the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return The enum numeric value on the wire for privilegesRequired. + */ + int getPrivilegesRequiredValue(); + /** + * + * + *
+   * This metric describes the level of privileges an attacker must possess
+   * before successfully exploiting the vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired privileges_required = 7; + * + * @return The privilegesRequired. + */ + com.google.cloud.osconfig.v1.CVSSv3.PrivilegesRequired getPrivilegesRequired(); + + /** + * + * + *
+   * This metric captures the requirement for a human user, other than the
+   * attacker, to participate in the successful compromise of the vulnerable
+   * component.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return The enum numeric value on the wire for userInteraction. + */ + int getUserInteractionValue(); + /** + * + * + *
+   * This metric captures the requirement for a human user, other than the
+   * attacker, to participate in the successful compromise of the vulnerable
+   * component.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.UserInteraction user_interaction = 8; + * + * @return The userInteraction. + */ + com.google.cloud.osconfig.v1.CVSSv3.UserInteraction getUserInteraction(); + + /** + * + * + *
+   * The Scope metric captures whether a vulnerability in one vulnerable
+   * component impacts resources in components beyond its security scope.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return The enum numeric value on the wire for scope. + */ + int getScopeValue(); + /** + * + * + *
+   * The Scope metric captures whether a vulnerability in one vulnerable
+   * component impacts resources in components beyond its security scope.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Scope scope = 9; + * + * @return The scope. + */ + com.google.cloud.osconfig.v1.CVSSv3.Scope getScope(); + + /** + * + * + *
+   * This metric measures the impact to the confidentiality of the information
+   * resources managed by a software component due to a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return The enum numeric value on the wire for confidentialityImpact. + */ + int getConfidentialityImpactValue(); + /** + * + * + *
+   * This metric measures the impact to the confidentiality of the information
+   * resources managed by a software component due to a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact confidentiality_impact = 10; + * + * @return The confidentialityImpact. + */ + com.google.cloud.osconfig.v1.CVSSv3.Impact getConfidentialityImpact(); + + /** + * + * + *
+   * This metric measures the impact to integrity of a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return The enum numeric value on the wire for integrityImpact. + */ + int getIntegrityImpactValue(); + /** + * + * + *
+   * This metric measures the impact to integrity of a successfully exploited
+   * vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact integrity_impact = 11; + * + * @return The integrityImpact. + */ + com.google.cloud.osconfig.v1.CVSSv3.Impact getIntegrityImpact(); + + /** + * + * + *
+   * This metric measures the impact to the availability of the impacted
+   * component resulting from a successfully exploited vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return The enum numeric value on the wire for availabilityImpact. + */ + int getAvailabilityImpactValue(); + /** + * + * + *
+   * This metric measures the impact to the availability of the impacted
+   * component resulting from a successfully exploited vulnerability.
+   * 
+ * + * .google.cloud.osconfig.v1.CVSSv3.Impact availability_impact = 12; + * + * @return The availabilityImpact. + */ + com.google.cloud.osconfig.v1.CVSSv3.Impact getAvailabilityImpact(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequest.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequest.java new file mode 100644 index 00000000..1d5d1274 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequest.java @@ -0,0 +1,843 @@ +/* + * 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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * A request message for getting inventory data for the specified VM.
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.GetInventoryRequest} + */ +public final class GetInventoryRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.GetInventoryRequest) + GetInventoryRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInventoryRequest.newBuilder() to construct. + private GetInventoryRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInventoryRequest() { + name_ = ""; + view_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInventoryRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetInventoryRequest( + 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 16: + { + int rawValue = input.readEnum(); + + view_ = 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.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_GetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_GetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.GetInventoryRequest.class, + com.google.cloud.osconfig.v1.GetInventoryRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. API resource name for inventory resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for inventory resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.InventoryView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.InventoryView result = + com.google.cloud.osconfig.v1.InventoryView.valueOf(view_); + return result == null ? com.google.cloud.osconfig.v1.InventoryView.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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (view_ + != com.google.cloud.osconfig.v1.InventoryView.INVENTORY_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + 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 (view_ + != com.google.cloud.osconfig.v1.InventoryView.INVENTORY_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + 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.osconfig.v1.GetInventoryRequest)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.GetInventoryRequest other = + (com.google.cloud.osconfig.v1.GetInventoryRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (view_ != other.view_) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest 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.osconfig.v1.GetInventoryRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest 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.osconfig.v1.GetInventoryRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest 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.osconfig.v1.GetInventoryRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest 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.osconfig.v1.GetInventoryRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest 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.osconfig.v1.GetInventoryRequest 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 request message for getting inventory data for the specified VM.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.GetInventoryRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.GetInventoryRequest) + com.google.cloud.osconfig.v1.GetInventoryRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_GetInventoryRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_GetInventoryRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.GetInventoryRequest.class, + com.google.cloud.osconfig.v1.GetInventoryRequest.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.GetInventoryRequest.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_ = ""; + + view_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_GetInventoryRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.GetInventoryRequest getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.GetInventoryRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.GetInventoryRequest build() { + com.google.cloud.osconfig.v1.GetInventoryRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.GetInventoryRequest buildPartial() { + com.google.cloud.osconfig.v1.GetInventoryRequest result = + new com.google.cloud.osconfig.v1.GetInventoryRequest(this); + result.name_ = name_; + result.view_ = view_; + 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.osconfig.v1.GetInventoryRequest) { + return mergeFrom((com.google.cloud.osconfig.v1.GetInventoryRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.GetInventoryRequest other) { + if (other == com.google.cloud.osconfig.v1.GetInventoryRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + 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.osconfig.v1.GetInventoryRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.osconfig.v1.GetInventoryRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. API resource name for inventory resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for inventory resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for inventory resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for inventory resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. API resource name for inventory resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 view_ = 0; + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.InventoryView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.InventoryView result = + com.google.cloud.osconfig.v1.InventoryView.valueOf(view_); + return result == null ? com.google.cloud.osconfig.v1.InventoryView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.osconfig.v1.InventoryView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 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.osconfig.v1.GetInventoryRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.GetInventoryRequest) + private static final com.google.cloud.osconfig.v1.GetInventoryRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.GetInventoryRequest(); + } + + public static com.google.cloud.osconfig.v1.GetInventoryRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInventoryRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetInventoryRequest(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.osconfig.v1.GetInventoryRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequestOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequestOrBuilder.java new file mode 100644 index 00000000..7fbdd652 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetInventoryRequestOrBuilder.java @@ -0,0 +1,91 @@ +/* + * 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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +public interface GetInventoryRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.GetInventoryRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. API resource name for inventory resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. API resource name for inventory resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/inventory`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine  `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The view. + */ + com.google.cloud.osconfig.v1.InventoryView getView(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequest.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequest.java new file mode 100644 index 00000000..f01e8916 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequest.java @@ -0,0 +1,686 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * A request message for getting the vulnerability report for the specified VM.
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.GetVulnerabilityReportRequest} + */ +public final class GetVulnerabilityReportRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.GetVulnerabilityReportRequest) + GetVulnerabilityReportRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetVulnerabilityReportRequest.newBuilder() to construct. + private GetVulnerabilityReportRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetVulnerabilityReportRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetVulnerabilityReportRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetVulnerabilityReportRequest( + 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.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_GetVulnerabilityReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_GetVulnerabilityReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.class, + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. API resource name for vulnerability resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for vulnerability resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.osconfig.v1.GetVulnerabilityReportRequest)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest other = + (com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest) 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.osconfig.v1.GetVulnerabilityReportRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest 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.osconfig.v1.GetVulnerabilityReportRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest 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.osconfig.v1.GetVulnerabilityReportRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest 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.osconfig.v1.GetVulnerabilityReportRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest 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.osconfig.v1.GetVulnerabilityReportRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest 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.osconfig.v1.GetVulnerabilityReportRequest 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 request message for getting the vulnerability report for the specified VM.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.GetVulnerabilityReportRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.GetVulnerabilityReportRequest) + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_GetVulnerabilityReportRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_GetVulnerabilityReportRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.class, + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.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.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_GetVulnerabilityReportRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest build() { + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest buildPartial() { + com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest result = + new com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest(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.osconfig.v1.GetVulnerabilityReportRequest) { + return mergeFrom((com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest other) { + if (other == com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest.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.osconfig.v1.GetVulnerabilityReportRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. API resource name for vulnerability resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for vulnerability resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for vulnerability resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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. API resource name for vulnerability resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. API resource name for vulnerability resource.
+     * Format:
+     * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+     * can be provided.
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.osconfig.v1.GetVulnerabilityReportRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.GetVulnerabilityReportRequest) + private static final com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest(); + } + + public static com.google.cloud.osconfig.v1.GetVulnerabilityReportRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetVulnerabilityReportRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetVulnerabilityReportRequest(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.osconfig.v1.GetVulnerabilityReportRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequestOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequestOrBuilder.java new file mode 100644 index 00000000..4449d800 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/GetVulnerabilityReportRequestOrBuilder.java @@ -0,0 +1,64 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +public interface GetVulnerabilityReportRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.GetVulnerabilityReportRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. API resource name for vulnerability resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. API resource name for vulnerability resource.
+   * Format:
+   * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * For `{instance}`, either Compute Engine `instance-id` or `instance-name`
+   * can be provided.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InstanceName.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InstanceName.java new file mode 100644 index 00000000..04c2279b --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InstanceName.java @@ -0,0 +1,340 @@ +/* + * Copyright 2021 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.osconfig.v1; + +import com.google.api.core.BetaApi; +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.pathtemplate.ValidationException; +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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class InstanceName implements ResourceName { + private static final PathTemplate PROJECT_ZONE_INSTANCE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/zones/{zone}/instances/{instance}"); + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}"); + private volatile Map fieldValuesMap; + private PathTemplate pathTemplate; + private String fixedValue; + private final String project; + private final String zone; + private final String instance; + private final String location; + + @Deprecated + protected InstanceName() { + project = null; + zone = null; + instance = null; + location = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + zone = Preconditions.checkNotNull(builder.getZone()); + instance = Preconditions.checkNotNull(builder.getInstance()); + location = null; + pathTemplate = PROJECT_ZONE_INSTANCE; + } + + private InstanceName(ProjectLocationInstanceBuilder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + zone = null; + pathTemplate = PROJECT_LOCATION_INSTANCE; + } + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + public String getInstance() { + return instance; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static Builder newProjectZoneInstanceBuilder() { + return new Builder(); + } + + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static ProjectLocationInstanceBuilder newProjectLocationInstanceBuilder() { + return new ProjectLocationInstanceBuilder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String zone, String instance) { + return newBuilder().setProject(project).setZone(zone).setInstance(instance).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static InstanceName ofProjectZoneInstanceName( + String project, String zone, String instance) { + return newBuilder().setProject(project).setZone(zone).setInstance(instance).build(); + } + + @BetaApi("The static create methods are not stable yet and may be changed in the future.") + public static InstanceName ofProjectLocationInstanceName( + String project, String location, String instance) { + return newProjectLocationInstanceBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build(); + } + + public static String format(String project, String zone, String instance) { + return newBuilder().setProject(project).setZone(zone).setInstance(instance).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectZoneInstanceName(String project, String zone, String instance) { + return newBuilder().setProject(project).setZone(zone).setInstance(instance).build().toString(); + } + + @BetaApi("The static format methods are not stable yet and may be changed in the future.") + public static String formatProjectLocationInstanceName( + String project, String location, String instance) { + return newProjectLocationInstanceBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + if (PROJECT_ZONE_INSTANCE.matches(formattedString)) { + Map matchMap = PROJECT_ZONE_INSTANCE.match(formattedString); + return ofProjectZoneInstanceName( + matchMap.get("project"), matchMap.get("zone"), matchMap.get("instance")); + } else if (PROJECT_LOCATION_INSTANCE.matches(formattedString)) { + Map matchMap = PROJECT_LOCATION_INSTANCE.match(formattedString); + return ofProjectLocationInstanceName( + matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + throw new ValidationException("InstanceName.parse: formattedString not in valid format"); + } + + 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 (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_ZONE_INSTANCE.matches(formattedString) + || PROJECT_LOCATION_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (zone != null) { + fieldMapBuilder.put("zone", zone); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return fixedValue != null ? fixedValue : pathTemplate.instantiate(getFieldValuesMap()); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.zone, that.zone) + && Objects.equals(this.instance, that.instance) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(fixedValue); + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(zone); + h *= 1000003; + h ^= Objects.hashCode(instance); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/zones/{zone}/instances/{instance}. */ + public static class Builder { + private String project; + private String zone; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getZone() { + return zone; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setZone(String zone) { + this.zone = zone; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + Preconditions.checkArgument( + Objects.equals(instanceName.pathTemplate, PROJECT_ZONE_INSTANCE), + "toBuilder is only supported when InstanceName has the pattern of projects/{project}/zones/{zone}/instances/{instance}"); + this.project = instanceName.project; + this.zone = instanceName.zone; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}. */ + @BetaApi("The per-pattern Builders are not stable yet and may be changed in the future.") + public static class ProjectLocationInstanceBuilder { + private String project; + private String location; + private String instance; + + protected ProjectLocationInstanceBuilder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public ProjectLocationInstanceBuilder setProject(String project) { + this.project = project; + return this; + } + + public ProjectLocationInstanceBuilder setLocation(String location) { + this.location = location; + return this; + } + + public ProjectLocationInstanceBuilder setInstance(String instance) { + this.instance = instance; + return this; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventories.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventories.java index ede15fcf..df1ca18c 100644 --- a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventories.java +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventories.java @@ -47,6 +47,10 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_osconfig_v1_Inventory_VersionedPackage_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_osconfig_v1_Inventory_VersionedPackage_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -55,10 +59,6 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_fieldAccessorTable; - static final com.google.protobuf.Descriptors.Descriptor - internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_google_cloud_osconfig_v1_Inventory_WindowsQuickFixEngineeringPackage_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable @@ -71,6 +71,18 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_osconfig_v1_Inventory_ItemsEntry_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_osconfig_v1_Inventory_ItemsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_osconfig_v1_GetInventoryRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_osconfig_v1_GetInventoryRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -81,84 +93,104 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { static { java.lang.String[] descriptorData = { "\n(google/cloud/osconfig/v1/inventory.pro" - + "to\022\030google.cloud.osconfig.v1\032\037google/pro" - + "tobuf/timestamp.proto\032\026google/type/date." - + "proto\"\237\024\n\tInventory\022;\n\007os_info\030\001 \001(\0132*.g" - + "oogle.cloud.osconfig.v1.Inventory.OsInfo" - + "\022=\n\005items\030\002 \003(\0132..google.cloud.osconfig." - + "v1.Inventory.ItemsEntry\032\270\001\n\006OsInfo\022\020\n\010ho" - + "stname\030\t \001(\t\022\021\n\tlong_name\030\002 \001(\t\022\022\n\nshort" - + "_name\030\003 \001(\t\022\017\n\007version\030\004 \001(\t\022\024\n\014architec" - + "ture\030\005 \001(\t\022\026\n\016kernel_version\030\006 \001(\t\022\026\n\016ke" - + "rnel_release\030\007 \001(\t\022\036\n\026osconfig_agent_ver" - + "sion\030\010 \001(\t\032\267\004\n\004Item\022\n\n\002id\030\001 \001(\t\022H\n\013origi" - + "n_type\030\002 \001(\01623.google.cloud.osconfig.v1." - + "Inventory.Item.OriginType\022/\n\013create_time" - + "\030\010 \001(\0132\032.google.protobuf.Timestamp\022/\n\013up" - + "date_time\030\t \001(\0132\032.google.protobuf.Timest" - + "amp\022;\n\004type\030\005 \001(\0162-.google.cloud.osconfi" - + "g.v1.Inventory.Item.Type\022P\n\021installed_pa" - + "ckage\030\006 \001(\01323.google.cloud.osconfig.v1.I" - + "nventory.SoftwarePackageH\000\022P\n\021available_" - + "package\030\007 \001(\01323.google.cloud.osconfig.v1" - + ".Inventory.SoftwarePackageH\000\"?\n\nOriginTy" - + "pe\022\033\n\027ORIGIN_TYPE_UNSPECIFIED\020\000\022\024\n\020INVEN" - + "TORY_REPORT\020\001\"J\n\004Type\022\024\n\020TYPE_UNSPECIFIE" - + "D\020\000\022\025\n\021INSTALLED_PACKAGE\020\001\022\025\n\021AVAILABLE_" - + "PACKAGE\020\002B\t\n\007details\032\362\005\n\017SoftwarePackage" - + "\022K\n\013yum_package\030\001 \001(\01324.google.cloud.osc" - + "onfig.v1.Inventory.VersionedPackageH\000\022K\n" - + "\013apt_package\030\002 \001(\01324.google.cloud.osconf" - + "ig.v1.Inventory.VersionedPackageH\000\022N\n\016zy" - + "pper_package\030\003 \001(\01324.google.cloud.osconf" - + "ig.v1.Inventory.VersionedPackageH\000\022N\n\016go" - + "oget_package\030\004 \001(\01324.google.cloud.osconf" - + "ig.v1.Inventory.VersionedPackageH\000\022G\n\014zy" - + "pper_patch\030\005 \001(\0132/.google.cloud.osconfig" - + ".v1.Inventory.ZypperPatchH\000\022O\n\013wua_packa" - + "ge\030\006 \001(\01328.google.cloud.osconfig.v1.Inve" - + "ntory.WindowsUpdatePackageH\000\022\\\n\013qfe_pack" - + "age\030\007 \001(\0132E.google.cloud.osconfig.v1.Inv" - + "entory.WindowsQuickFixEngineeringPackage" - + "H\000\022K\n\013cos_package\030\010 \001(\01324.google.cloud.o" - + "sconfig.v1.Inventory.VersionedPackageH\000\022" - + "U\n\023windows_application\030\t \001(\01326.google.cl" - + "oud.osconfig.v1.Inventory.WindowsApplica" - + "tionH\000B\t\n\007details\032O\n\020VersionedPackage\022\024\n" - + "\014package_name\030\004 \001(\t\022\024\n\014architecture\030\002 \001(" - + "\t\022\017\n\007version\030\003 \001(\t\032\203\003\n\024WindowsUpdatePack" - + "age\022\r\n\005title\030\001 \001(\t\022\023\n\013description\030\002 \001(\t\022" - + "b\n\ncategories\030\003 \003(\0132N.google.cloud.oscon" - + "fig.v1.Inventory.WindowsUpdatePackage.Wi" - + "ndowsUpdateCategory\022\026\n\016kb_article_ids\030\004 " - + "\003(\t\022\023\n\013support_url\030\013 \001(\t\022\026\n\016more_info_ur" - + "ls\030\005 \003(\t\022\021\n\tupdate_id\030\006 \001(\t\022\027\n\017revision_" - + "number\030\007 \001(\005\022?\n\033last_deployment_change_t" - + "ime\030\n \001(\0132\032.google.protobuf.Timestamp\0321\n" - + "\025WindowsUpdateCategory\022\n\n\002id\030\001 \001(\t\022\014\n\004na" - + "me\030\002 \001(\t\032V\n\013ZypperPatch\022\022\n\npatch_name\030\005 " - + "\001(\t\022\020\n\010category\030\002 \001(\t\022\020\n\010severity\030\003 \001(\t\022" - + "\017\n\007summary\030\004 \001(\t\032\217\001\n!WindowsQuickFixEngi" - + "neeringPackage\022\017\n\007caption\030\001 \001(\t\022\023\n\013descr" - + "iption\030\002 \001(\t\022\022\n\nhot_fix_id\030\003 \001(\t\0220\n\014inst" - + "all_time\030\005 \001(\0132\032.google.protobuf.Timesta" - + "mp\032\222\001\n\022WindowsApplication\022\024\n\014display_nam" - + "e\030\001 \001(\t\022\027\n\017display_version\030\002 \001(\t\022\021\n\tpubl" - + "isher\030\003 \001(\t\022\'\n\014install_date\030\004 \001(\0132\021.goog" - + "le.type.Date\022\021\n\thelp_link\030\005 \001(\t\032V\n\nItems" - + "Entry\022\013\n\003key\030\001 \001(\t\0227\n\005value\030\002 \001(\0132(.goog" - + "le.cloud.osconfig.v1.Inventory.Item:\0028\001B" - + "\303\001\n\034com.google.cloud.osconfig.v1B\013Invent" - + "oriesP\001Z@google.golang.org/genproto/goog" - + "leapis/cloud/osconfig/v1;osconfig\252\002\030Goog" - + "le.Cloud.OsConfig.V1\312\002\030Google\\Cloud\\OsCo" - + "nfig\\V1\352\002\033Google::Cloud::OsConfig::V1b\006p" - + "roto3" + + "to\022\030google.cloud.osconfig.v1\032\037google/api" + + "/field_behavior.proto\032\031google/api/resour" + + "ce.proto\032\037google/protobuf/timestamp.prot" + + "o\032\026google/type/date.proto\"\330\025\n\tInventory\022" + + "\021\n\004name\030\003 \001(\tB\003\340A\003\022;\n\007os_info\030\001 \001(\0132*.go" + + "ogle.cloud.osconfig.v1.Inventory.OsInfo\022" + + "=\n\005items\030\002 \003(\0132..google.cloud.osconfig.v" + + "1.Inventory.ItemsEntry\0224\n\013update_time\030\004 " + + "\001(\0132\032.google.protobuf.TimestampB\003\340A\003\032\270\001\n" + + "\006OsInfo\022\020\n\010hostname\030\t \001(\t\022\021\n\tlong_name\030\002" + + " \001(\t\022\022\n\nshort_name\030\003 \001(\t\022\017\n\007version\030\004 \001(" + + "\t\022\024\n\014architecture\030\005 \001(\t\022\026\n\016kernel_versio" + + "n\030\006 \001(\t\022\026\n\016kernel_release\030\007 \001(\t\022\036\n\026oscon" + + "fig_agent_version\030\010 \001(\t\032\267\004\n\004Item\022\n\n\002id\030\001" + + " \001(\t\022H\n\013origin_type\030\002 \001(\01623.google.cloud" + + ".osconfig.v1.Inventory.Item.OriginType\022/" + + "\n\013create_time\030\010 \001(\0132\032.google.protobuf.Ti" + + "mestamp\022/\n\013update_time\030\t \001(\0132\032.google.pr" + + "otobuf.Timestamp\022;\n\004type\030\005 \001(\0162-.google." + + "cloud.osconfig.v1.Inventory.Item.Type\022P\n" + + "\021installed_package\030\006 \001(\01323.google.cloud." + + "osconfig.v1.Inventory.SoftwarePackageH\000\022" + + "P\n\021available_package\030\007 \001(\01323.google.clou" + + "d.osconfig.v1.Inventory.SoftwarePackageH" + + "\000\"?\n\nOriginType\022\033\n\027ORIGIN_TYPE_UNSPECIFI" + + "ED\020\000\022\024\n\020INVENTORY_REPORT\020\001\"J\n\004Type\022\024\n\020TY" + + "PE_UNSPECIFIED\020\000\022\025\n\021INSTALLED_PACKAGE\020\001\022" + + "\025\n\021AVAILABLE_PACKAGE\020\002B\t\n\007details\032\362\005\n\017So" + + "ftwarePackage\022K\n\013yum_package\030\001 \001(\01324.goo" + + "gle.cloud.osconfig.v1.Inventory.Versione" + + "dPackageH\000\022K\n\013apt_package\030\002 \001(\01324.google" + + ".cloud.osconfig.v1.Inventory.VersionedPa" + + "ckageH\000\022N\n\016zypper_package\030\003 \001(\01324.google" + + ".cloud.osconfig.v1.Inventory.VersionedPa" + + "ckageH\000\022N\n\016googet_package\030\004 \001(\01324.google" + + ".cloud.osconfig.v1.Inventory.VersionedPa" + + "ckageH\000\022G\n\014zypper_patch\030\005 \001(\0132/.google.c" + + "loud.osconfig.v1.Inventory.ZypperPatchH\000" + + "\022O\n\013wua_package\030\006 \001(\01328.google.cloud.osc" + + "onfig.v1.Inventory.WindowsUpdatePackageH" + + "\000\022\\\n\013qfe_package\030\007 \001(\0132E.google.cloud.os" + + "config.v1.Inventory.WindowsQuickFixEngin" + + "eeringPackageH\000\022K\n\013cos_package\030\010 \001(\01324.g" + + "oogle.cloud.osconfig.v1.Inventory.Versio" + + "nedPackageH\000\022U\n\023windows_application\030\t \001(" + + "\01326.google.cloud.osconfig.v1.Inventory.W" + + "indowsApplicationH\000B\t\n\007details\032O\n\020Versio" + + "nedPackage\022\024\n\014package_name\030\004 \001(\t\022\024\n\014arch" + + "itecture\030\002 \001(\t\022\017\n\007version\030\003 \001(\t\032V\n\013Zyppe" + + "rPatch\022\022\n\npatch_name\030\005 \001(\t\022\020\n\010category\030\002" + + " \001(\t\022\020\n\010severity\030\003 \001(\t\022\017\n\007summary\030\004 \001(\t\032" + + "\203\003\n\024WindowsUpdatePackage\022\r\n\005title\030\001 \001(\t\022" + + "\023\n\013description\030\002 \001(\t\022b\n\ncategories\030\003 \003(\013" + + "2N.google.cloud.osconfig.v1.Inventory.Wi" + + "ndowsUpdatePackage.WindowsUpdateCategory" + + "\022\026\n\016kb_article_ids\030\004 \003(\t\022\023\n\013support_url\030" + + "\013 \001(\t\022\026\n\016more_info_urls\030\005 \003(\t\022\021\n\tupdate_" + + "id\030\006 \001(\t\022\027\n\017revision_number\030\007 \001(\005\022?\n\033las" + + "t_deployment_change_time\030\n \001(\0132\032.google." + + "protobuf.Timestamp\0321\n\025WindowsUpdateCateg" + + "ory\022\n\n\002id\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\032\217\001\n!Window" + + "sQuickFixEngineeringPackage\022\017\n\007caption\030\001" + + " \001(\t\022\023\n\013description\030\002 \001(\t\022\022\n\nhot_fix_id\030" + + "\003 \001(\t\0220\n\014install_time\030\005 \001(\0132\032.google.pro" + + "tobuf.Timestamp\032\222\001\n\022WindowsApplication\022\024" + + "\n\014display_name\030\001 \001(\t\022\027\n\017display_version\030" + + "\002 \001(\t\022\021\n\tpublisher\030\003 \001(\t\022\'\n\014install_date" + + "\030\004 \001(\0132\021.google.type.Date\022\021\n\thelp_link\030\005" + + " \001(\t\032V\n\nItemsEntry\022\013\n\003key\030\001 \001(\t\0227\n\005value" + + "\030\002 \001(\0132(.google.cloud.osconfig.v1.Invent" + + "ory.Item:\0028\001:n\352Ak\n!osconfig.googleapis.c" + + "om/Inventory\022Fprojects/{project}/locatio" + + "ns/{location}/instances/{instance}/inven" + + "tory\"\205\001\n\023GetInventoryRequest\0227\n\004name\030\001 \001" + + "(\tB)\340A\002\372A#\n!osconfig.googleapis.com/Inve" + + "ntory\0225\n\004view\030\002 \001(\0162\'.google.cloud.oscon" + + "fig.v1.InventoryView\"\277\001\n\026ListInventories" + + "Request\0227\n\006parent\030\001 \001(\tB\'\340A\002\372A!\n\037compute" + + ".googleapis.com/Instance\0225\n\004view\030\002 \001(\0162\'" + + ".google.cloud.osconfig.v1.InventoryView\022" + + "\021\n\tpage_size\030\003 \001(\005\022\022\n\npage_token\030\004 \001(\t\022\016" + + "\n\006filter\030\005 \001(\t\"l\n\027ListInventoriesRespons" + + "e\0228\n\013inventories\030\001 \003(\0132#.google.cloud.os" + + "config.v1.Inventory\022\027\n\017next_page_token\030\002" + + " \001(\t*D\n\rInventoryView\022\036\n\032INVENTORY_VIEW_" + + "UNSPECIFIED\020\000\022\t\n\005BASIC\020\001\022\010\n\004FULL\020\002B\303\001\n\034c" + + "om.google.cloud.osconfig.v1B\013Inventories" + + "P\001Z@google.golang.org/genproto/googleapi" + + "s/cloud/osconfig/v1;osconfig\252\002\030Google.Cl" + + "oud.OsConfig.V1\312\002\030Google\\Cloud\\OsConfig\\" + + "V1\352\002\033Google::Cloud::OsConfig::V1b\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.protobuf.TimestampProto.getDescriptor(), com.google.type.DateProto.getDescriptor(), }); @@ -168,7 +200,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_osconfig_v1_Inventory_descriptor, new java.lang.String[] { - "OsInfo", "Items", + "Name", "OsInfo", "Items", "UpdateTime", }); internal_static_google_cloud_osconfig_v1_Inventory_OsInfo_descriptor = internal_static_google_cloud_osconfig_v1_Inventory_descriptor.getNestedTypes().get(0); @@ -225,8 +257,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "PackageName", "Architecture", "Version", }); - internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor = + internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor = internal_static_google_cloud_osconfig_v1_Inventory_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor, + new java.lang.String[] { + "PatchName", "Category", "Severity", "Summary", + }); + internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor = + internal_static_google_cloud_osconfig_v1_Inventory_descriptor.getNestedTypes().get(5); internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor, @@ -251,14 +291,6 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Id", "Name", }); - internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor = - internal_static_google_cloud_osconfig_v1_Inventory_descriptor.getNestedTypes().get(5); - internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable = - new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( - internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor, - new java.lang.String[] { - "PatchName", "Category", "Severity", "Summary", - }); internal_static_google_cloud_osconfig_v1_Inventory_WindowsQuickFixEngineeringPackage_descriptor = internal_static_google_cloud_osconfig_v1_Inventory_descriptor.getNestedTypes().get(6); internal_static_google_cloud_osconfig_v1_Inventory_WindowsQuickFixEngineeringPackage_fieldAccessorTable = @@ -283,6 +315,39 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { new java.lang.String[] { "Key", "Value", }); + internal_static_google_cloud_osconfig_v1_GetInventoryRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_osconfig_v1_GetInventoryRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_osconfig_v1_GetInventoryRequest_descriptor, + new java.lang.String[] { + "Name", "View", + }); + internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_descriptor, + new java.lang.String[] { + "Parent", "View", "PageSize", "PageToken", "Filter", + }); + internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_descriptor, + new java.lang.String[] { + "Inventories", "NextPageToken", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.ResourceProto.resource); + registry.add(com.google.api.ResourceProto.resourceReference); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); com.google.type.DateProto.getDescriptor(); } diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventory.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventory.java index 78537de7..e4e51366 100644 --- a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventory.java +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/Inventory.java @@ -22,7 +22,11 @@ * * *
- * The inventory details of a VM.
+ * This API resource represents the available inventory data for a
+ * Compute Engine virtual machine (VM) instance at a given point in time.
+ * You can use this API resource to determine the inventory data of your VM.
+ * For more information, see [Information provided by OS inventory
+ * management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected).
  * 
* * Protobuf type {@code google.cloud.osconfig.v1.Inventory} @@ -37,7 +41,9 @@ private Inventory(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } - private Inventory() {} + private Inventory() { + name_ = ""; + } @java.lang.Override @SuppressWarnings({"unused"}) @@ -99,6 +105,28 @@ private Inventory( ItemsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); items_.getMutableMap().put(items__.getKey(), items__.getValue()); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = subBuilder.buildPartial(); + } + break; } default: @@ -5291,7 +5319,7 @@ public interface SoftwarePackageOrBuilder * * *
-     * Details of a Windows Application
+     * Details of Windows Application.
      * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -5303,7 +5331,7 @@ public interface SoftwarePackageOrBuilder * * *
-     * Details of a Windows Application
+     * Details of Windows Application.
      * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -5315,7 +5343,7 @@ public interface SoftwarePackageOrBuilder * * *
-     * Details of a Windows Application
+     * Details of Windows Application.
      * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -6132,7 +6160,7 @@ public com.google.cloud.osconfig.v1.Inventory.VersionedPackage getCosPackage() { * * *
-     * Details of a Windows Application
+     * Details of Windows Application.
      * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -6147,7 +6175,7 @@ public boolean hasWindowsApplication() { * * *
-     * Details of a Windows Application
+     * Details of Windows Application.
      * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -6165,7 +6193,7 @@ public com.google.cloud.osconfig.v1.Inventory.WindowsApplication getWindowsAppli * * *
-     * Details of a Windows Application
+     * Details of Windows Application.
      * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8648,7 +8676,7 @@ public Builder clearCosPackage() { * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8664,7 +8692,7 @@ public boolean hasWindowsApplication() { * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8690,7 +8718,7 @@ public com.google.cloud.osconfig.v1.Inventory.WindowsApplication getWindowsAppli * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8714,7 +8742,7 @@ public Builder setWindowsApplication( * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8735,7 +8763,7 @@ public Builder setWindowsApplication( * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8770,7 +8798,7 @@ public Builder mergeWindowsApplication( * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8796,7 +8824,7 @@ public Builder clearWindowsApplication() { * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8810,7 +8838,7 @@ public Builder clearWindowsApplication() { * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -8832,7 +8860,7 @@ public Builder clearWindowsApplication() { * * *
-       * Details of a Windows Application
+       * Details of Windows Application.
        * 
* * .google.cloud.osconfig.v1.Inventory.WindowsApplication windows_application = 9; @@ -9979,4827 +10007,4774 @@ public com.google.cloud.osconfig.v1.Inventory.VersionedPackage getDefaultInstanc } } - public interface WindowsUpdatePackageOrBuilder + public interface ZypperPatchOrBuilder extends - // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory.ZypperPatch) com.google.protobuf.MessageOrBuilder { /** * * *
-     * The localized title of the update package.
+     * The name of the patch.
      * 
* - * string title = 1; + * string patch_name = 5; * - * @return The title. + * @return The patchName. */ - java.lang.String getTitle(); + java.lang.String getPatchName(); /** * * *
-     * The localized title of the update package.
+     * The name of the patch.
      * 
* - * string title = 1; + * string patch_name = 5; * - * @return The bytes for title. + * @return The bytes for patchName. */ - com.google.protobuf.ByteString getTitleBytes(); + com.google.protobuf.ByteString getPatchNameBytes(); /** * * *
-     * The localized description of the update package.
+     * The category of the patch.
      * 
* - * string description = 2; + * string category = 2; * - * @return The description. + * @return The category. */ - java.lang.String getDescription(); + java.lang.String getCategory(); /** * * *
-     * The localized description of the update package.
+     * The category of the patch.
      * 
* - * string description = 2; + * string category = 2; * - * @return The bytes for description. + * @return The bytes for category. */ - com.google.protobuf.ByteString getDescriptionBytes(); + com.google.protobuf.ByteString getCategoryBytes(); /** * * *
-     * The categories that are associated with this update package.
+     * The severity specified for this patch
      * 
* - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - java.util.List< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> - getCategoriesList(); - /** - * - * - *
-     * The categories that are associated with this update package.
-     * 
+ * string severity = 3; * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * + * @return The severity. */ - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory getCategories( - int index); + java.lang.String getSeverity(); /** * * *
-     * The categories that are associated with this update package.
+     * The severity specified for this patch
      * 
* - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * + * string severity = 3; + * + * @return The bytes for severity. */ - int getCategoriesCount(); + com.google.protobuf.ByteString getSeverityBytes(); + /** * * *
-     * The categories that are associated with this update package.
+     * Any summary information provided about this patch.
      * 
* - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * + * string summary = 4; + * + * @return The summary. */ - java.util.List< - ? extends - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder> - getCategoriesOrBuilderList(); + java.lang.String getSummary(); /** * * *
-     * The categories that are associated with this update package.
+     * Any summary information provided about this patch.
      * 
* - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * + * string summary = 4; + * + * @return The bytes for summary. */ - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategoryOrBuilder - getCategoriesOrBuilder(int index); + com.google.protobuf.ByteString getSummaryBytes(); + } + /** + * + * + *
+   * Details related to a Zypper Patch.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.Inventory.ZypperPatch} + */ + public static final class ZypperPatch extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.Inventory.ZypperPatch) + ZypperPatchOrBuilder { + private static final long serialVersionUID = 0L; + // Use ZypperPatch.newBuilder() to construct. + private ZypperPatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ZypperPatch() { + patchName_ = ""; + category_ = ""; + severity_ = ""; + summary_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ZypperPatch(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ZypperPatch( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + category_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + severity_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + summary_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + patchName_ = 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.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.Inventory.ZypperPatch.class, + com.google.cloud.osconfig.v1.Inventory.ZypperPatch.Builder.class); + } + public static final int PATCH_NAME_FIELD_NUMBER = 5; + private volatile java.lang.Object patchName_; /** * * *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
+     * The name of the patch.
      * 
* - * repeated string kb_article_ids = 4; + * string patch_name = 5; * - * @return A list containing the kbArticleIds. + * @return The patchName. */ - java.util.List getKbArticleIdsList(); + @java.lang.Override + public java.lang.String getPatchName() { + java.lang.Object ref = patchName_; + 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(); + patchName_ = s; + return s; + } + } /** * * *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
+     * The name of the patch.
      * 
* - * repeated string kb_article_ids = 4; + * string patch_name = 5; * - * @return The count of kbArticleIds. + * @return The bytes for patchName. */ - int getKbArticleIdsCount(); - /** - * - * - *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
-     * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index of the element to return. - * @return The kbArticleIds at the given index. - */ - java.lang.String getKbArticleIds(int index); - /** - * - * - *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
-     * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the kbArticleIds at the given index. - */ - com.google.protobuf.ByteString getKbArticleIdsBytes(int index); + @java.lang.Override + public com.google.protobuf.ByteString getPatchNameBytes() { + java.lang.Object ref = patchName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + patchName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int CATEGORY_FIELD_NUMBER = 2; + private volatile java.lang.Object category_; /** * * *
-     * A hyperlink to the language-specific support information for the update.
+     * The category of the patch.
      * 
* - * string support_url = 11; + * string category = 2; * - * @return The supportUrl. + * @return The category. */ - java.lang.String getSupportUrl(); + @java.lang.Override + public java.lang.String getCategory() { + java.lang.Object ref = category_; + 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(); + category_ = s; + return s; + } + } /** * * *
-     * A hyperlink to the language-specific support information for the update.
+     * The category of the patch.
      * 
* - * string support_url = 11; + * string category = 2; * - * @return The bytes for supportUrl. + * @return The bytes for category. */ - com.google.protobuf.ByteString getSupportUrlBytes(); + @java.lang.Override + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + category_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int SEVERITY_FIELD_NUMBER = 3; + private volatile java.lang.Object severity_; /** * * *
-     * A collection of URLs that provide more information about the update
-     * package.
-     * 
- * - * repeated string more_info_urls = 5; - * - * @return A list containing the moreInfoUrls. - */ - java.util.List getMoreInfoUrlsList(); - /** - * - * - *
-     * A collection of URLs that provide more information about the update
-     * package.
-     * 
- * - * repeated string more_info_urls = 5; - * - * @return The count of moreInfoUrls. - */ - int getMoreInfoUrlsCount(); - /** - * - * - *
-     * A collection of URLs that provide more information about the update
-     * package.
+     * The severity specified for this patch
      * 
* - * repeated string more_info_urls = 5; + * string severity = 3; * - * @param index The index of the element to return. - * @return The moreInfoUrls at the given index. + * @return The severity. */ - java.lang.String getMoreInfoUrls(int index); + @java.lang.Override + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + 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(); + severity_ = s; + return s; + } + } /** * * *
-     * A collection of URLs that provide more information about the update
-     * package.
+     * The severity specified for this patch
      * 
* - * repeated string more_info_urls = 5; + * string severity = 3; * - * @param index The index of the value to return. - * @return The bytes of the moreInfoUrls at the given index. + * @return The bytes for severity. */ - com.google.protobuf.ByteString getMoreInfoUrlsBytes(int index); + @java.lang.Override + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + public static final int SUMMARY_FIELD_NUMBER = 4; + private volatile java.lang.Object summary_; /** * * *
-     * Gets the identifier of an update package.  Stays the same across
-     * revisions.
+     * Any summary information provided about this patch.
      * 
* - * string update_id = 6; + * string summary = 4; * - * @return The updateId. + * @return The summary. */ - java.lang.String getUpdateId(); + @java.lang.Override + public java.lang.String getSummary() { + java.lang.Object ref = summary_; + 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(); + summary_ = s; + return s; + } + } /** * * *
-     * Gets the identifier of an update package.  Stays the same across
-     * revisions.
+     * Any summary information provided about this patch.
      * 
* - * string update_id = 6; + * string summary = 4; * - * @return The bytes for updateId. + * @return The bytes for summary. */ - com.google.protobuf.ByteString getUpdateIdBytes(); + @java.lang.Override + public com.google.protobuf.ByteString getSummaryBytes() { + java.lang.Object ref = summary_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summary_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } - /** - * - * - *
-     * The revision number of this update package.
-     * 
- * - * int32 revision_number = 7; - * - * @return The revisionNumber. - */ - int getRevisionNumber(); + private byte memoizedIsInitialized = -1; - /** - * - * - *
-     * The last published date of the update, in (UTC) date and time.
-     * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - * - * @return Whether the lastDeploymentChangeTime field is set. - */ - boolean hasLastDeploymentChangeTime(); - /** - * - * - *
-     * The last published date of the update, in (UTC) date and time.
-     * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - * - * @return The lastDeploymentChangeTime. - */ - com.google.protobuf.Timestamp getLastDeploymentChangeTime(); - /** - * - * - *
-     * The last published date of the update, in (UTC) date and time.
-     * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - com.google.protobuf.TimestampOrBuilder getLastDeploymentChangeTimeOrBuilder(); - } - /** - * - * - *
-   * Details related to a Windows Update package.
-   * Field data and names are taken from Windows Update API IUpdate Interface:
-   * https://docs.microsoft.com/en-us/windows/win32/api/_wua/
-   * Descriptive fields like title, and description are localized based on
-   * the locale of the VM being updated.
-   * 
- * - * Protobuf type {@code google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} - */ - public static final class WindowsUpdatePackage extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) - WindowsUpdatePackageOrBuilder { - private static final long serialVersionUID = 0L; - // Use WindowsUpdatePackage.newBuilder() to construct. - private WindowsUpdatePackage(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; - private WindowsUpdatePackage() { - title_ = ""; - description_ = ""; - categories_ = java.util.Collections.emptyList(); - kbArticleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - supportUrl_ = ""; - moreInfoUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - updateId_ = ""; + memoizedIsInitialized = 1; + return true; } @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WindowsUpdatePackage(); + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getCategoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, category_); + } + if (!getSeverityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, severity_); + } + if (!getSummaryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, summary_); + } + if (!getPatchNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, patchName_); + } + unknownFields.writeTo(output); } @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - private WindowsUpdatePackage( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + size = 0; + if (!getCategoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, category_); } - 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 (!getSeverityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, severity_); + } + if (!getSummaryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, summary_); + } + if (!getPatchNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, patchName_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - title_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.osconfig.v1.Inventory.ZypperPatch)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.Inventory.ZypperPatch other = + (com.google.cloud.osconfig.v1.Inventory.ZypperPatch) obj; - description_ = s; - break; - } - case 26: - { - if (!((mutable_bitField0_ & 0x00000001) != 0)) { - categories_ = - new java.util.ArrayList< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory>(); - mutable_bitField0_ |= 0x00000001; - } - categories_.add( - input.readMessage( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory.parser(), - extensionRegistry)); - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000002) != 0)) { - kbArticleIds_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000002; - } - kbArticleIds_.add(s); - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); - if (!((mutable_bitField0_ & 0x00000004) != 0)) { - moreInfoUrls_ = new com.google.protobuf.LazyStringArrayList(); - mutable_bitField0_ |= 0x00000004; - } - moreInfoUrls_.add(s); - break; - } - case 50: - { - java.lang.String s = input.readStringRequireUtf8(); + if (!getPatchName().equals(other.getPatchName())) return false; + if (!getCategory().equals(other.getCategory())) return false; + if (!getSeverity().equals(other.getSeverity())) return false; + if (!getSummary().equals(other.getSummary())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - updateId_ = s; - break; - } - case 56: - { - revisionNumber_ = input.readInt32(); - break; - } - case 82: - { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (lastDeploymentChangeTime_ != null) { - subBuilder = lastDeploymentChangeTime_.toBuilder(); - } - lastDeploymentChangeTime_ = - input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(lastDeploymentChangeTime_); - lastDeploymentChangeTime_ = subBuilder.buildPartial(); - } + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PATCH_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPatchName().hashCode(); + hash = (37 * hash) + CATEGORY_FIELD_NUMBER; + hash = (53 * hash) + getCategory().hashCode(); + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + getSeverity().hashCode(); + hash = (37 * hash) + SUMMARY_FIELD_NUMBER; + hash = (53 * hash) + getSummary().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } - break; - } - case 90: - { - java.lang.String s = input.readStringRequireUtf8(); + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - supportUrl_ = 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)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - } - if (((mutable_bitField0_ & 0x00000002) != 0)) { - kbArticleIds_ = kbArticleIds_.getUnmodifiableView(); - } - if (((mutable_bitField0_ & 0x00000004) != 0)) { - moreInfoUrls_ = moreInfoUrls_.getUnmodifiableView(); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.class, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.Builder.class); + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - public interface WindowsUpdateCategoryOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - com.google.protobuf.MessageOrBuilder { + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - /** - * - * - *
-       * The identifier of the windows update category.
-       * 
- * - * string id = 1; - * - * @return The id. - */ - java.lang.String getId(); - /** - * - * - *
-       * The identifier of the windows update category.
-       * 
- * - * string id = 1; - * - * @return The bytes for id. - */ - com.google.protobuf.ByteString getIdBytes(); + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } - /** - * - * - *
-       * The name of the windows update category.
-       * 
- * - * string name = 2; - * - * @return The name. - */ - java.lang.String getName(); - /** - * - * - *
-       * The name of the windows update category.
-       * 
- * - * string name = 2; - * - * @return The bytes for name. - */ - com.google.protobuf.ByteString getNameBytes(); + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch 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; } /** * * *
-     * Categories specified by the Windows Update.
+     * Details related to a Zypper Patch.
      * 
* - * Protobuf type {@code - * google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} + * Protobuf type {@code google.cloud.osconfig.v1.Inventory.ZypperPatch} */ - public static final class WindowsUpdateCategory extends com.google.protobuf.GeneratedMessageV3 + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder implements - // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - WindowsUpdateCategoryOrBuilder { - private static final long serialVersionUID = 0L; - // Use WindowsUpdateCategory.newBuilder() to construct. - private WindowsUpdateCategory(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.Inventory.ZypperPatch) + com.google.cloud.osconfig.v1.Inventory.ZypperPatchOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; } - private WindowsUpdateCategory() { - id_ = ""; - name_ = ""; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.Inventory.ZypperPatch.class, + com.google.cloud.osconfig.v1.Inventory.ZypperPatch.Builder.class); } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new WindowsUpdateCategory(); + // Construct using com.google.cloud.osconfig.v1.Inventory.ZypperPatch.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); } - private WindowsUpdateCategory( - 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(); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } - id_ = s; - break; - } - case 18: - { - java.lang.String s = input.readStringRequireUtf8(); + @java.lang.Override + public Builder clear() { + super.clear(); + patchName_ = ""; - 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(); - } - } + category_ = ""; - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; + severity_ = ""; + + summary_ = ""; + + return this; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .class, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder.class); + .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; } - public static final int ID_FIELD_NUMBER = 1; - private volatile java.lang.Object id_; - /** - * - * - *
-       * The identifier of the windows update category.
-       * 
- * - * string id = 1; - * - * @return The id. - */ @java.lang.Override - public java.lang.String getId() { - java.lang.Object ref = id_; - 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(); - id_ = s; - return s; - } + public com.google.cloud.osconfig.v1.Inventory.ZypperPatch getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.Inventory.ZypperPatch.getDefaultInstance(); } - /** - * - * + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.ZypperPatch build() { + com.google.cloud.osconfig.v1.Inventory.ZypperPatch result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.ZypperPatch buildPartial() { + com.google.cloud.osconfig.v1.Inventory.ZypperPatch result = + new com.google.cloud.osconfig.v1.Inventory.ZypperPatch(this); + result.patchName_ = patchName_; + result.category_ = category_; + result.severity_ = severity_; + result.summary_ = summary_; + 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.osconfig.v1.Inventory.ZypperPatch) { + return mergeFrom((com.google.cloud.osconfig.v1.Inventory.ZypperPatch) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.Inventory.ZypperPatch other) { + if (other == com.google.cloud.osconfig.v1.Inventory.ZypperPatch.getDefaultInstance()) + return this; + if (!other.getPatchName().isEmpty()) { + patchName_ = other.patchName_; + onChanged(); + } + if (!other.getCategory().isEmpty()) { + category_ = other.category_; + onChanged(); + } + if (!other.getSeverity().isEmpty()) { + severity_ = other.severity_; + onChanged(); + } + if (!other.getSummary().isEmpty()) { + summary_ = other.summary_; + 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.osconfig.v1.Inventory.ZypperPatch parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.Inventory.ZypperPatch) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object patchName_ = ""; + /** + * + * *
-       * The identifier of the windows update category.
+       * The name of the patch.
        * 
* - * string id = 1; + * string patch_name = 5; * - * @return The bytes for id. + * @return The patchName. */ - @java.lang.Override - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof java.lang.String) { + public java.lang.String getPatchName() { + java.lang.Object ref = patchName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + patchName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+       * The name of the patch.
+       * 
+ * + * string patch_name = 5; + * + * @return The bytes for patchName. + */ + public com.google.protobuf.ByteString getPatchNameBytes() { + java.lang.Object ref = patchName_; + if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; + patchName_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } + /** + * + * + *
+       * The name of the patch.
+       * 
+ * + * string patch_name = 5; + * + * @param value The patchName to set. + * @return This builder for chaining. + */ + public Builder setPatchName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - public static final int NAME_FIELD_NUMBER = 2; - private volatile java.lang.Object name_; + patchName_ = value; + onChanged(); + return this; + } /** * * *
-       * The name of the windows update category.
+       * The name of the patch.
        * 
* - * string name = 2; + * string patch_name = 5; * - * @return The name. + * @return This builder for chaining. */ - @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 { + public Builder clearPatchName() { + + patchName_ = getDefaultInstance().getPatchName(); + onChanged(); + return this; + } + /** + * + * + *
+       * The name of the patch.
+       * 
+ * + * string patch_name = 5; + * + * @param value The bytes for patchName to set. + * @return This builder for chaining. + */ + public Builder setPatchNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + patchName_ = value; + onChanged(); + return this; + } + + private java.lang.Object category_ = ""; + /** + * + * + *
+       * The category of the patch.
+       * 
+ * + * string category = 2; + * + * @return The category. + */ + public java.lang.String getCategory() { + java.lang.Object ref = category_; + if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - name_ = s; + category_ = s; return s; + } else { + return (java.lang.String) ref; } } /** * * *
-       * The name of the windows update category.
+       * The category of the patch.
        * 
* - * string name = 2; + * string category = 2; * - * @return The bytes for name. + * @return The bytes for category. */ - @java.lang.Override - public com.google.protobuf.ByteString getNameBytes() { - java.lang.Object ref = name_; - if (ref instanceof java.lang.String) { + public com.google.protobuf.ByteString getCategoryBytes() { + java.lang.Object ref = category_; + if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - name_ = b; + category_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } + /** + * + * + *
+       * The category of the patch.
+       * 
+ * + * string category = 2; + * + * @param value The category to set. + * @return This builder for chaining. + */ + public Builder setCategory(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - 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; + category_ = value; + onChanged(); + return this; } + /** + * + * + *
+       * The category of the patch.
+       * 
+ * + * string category = 2; + * + * @return This builder for chaining. + */ + public Builder clearCategory() { - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); - } - if (!getNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); - } - unknownFields.writeTo(output); + category_ = getDefaultInstance().getCategory(); + onChanged(); + return this; } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); - } - if (!getNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + /** + * + * + *
+       * The category of the patch.
+       * 
+ * + * string category = 2; + * + * @param value The bytes for category to set. + * @return This builder for chaining. + */ + public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; + checkByteStringIsUtf8(value); + + category_ = value; + onChanged(); + return this; } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; - } - if (!(obj - instanceof - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory)) { - return super.equals(obj); + private java.lang.Object severity_ = ""; + /** + * + * + *
+       * The severity specified for this patch
+       * 
+ * + * string severity = 3; + * + * @return The severity. + */ + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severity_ = s; + return s; + } else { + return (java.lang.String) ref; } - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory other = - (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) obj; - - if (!getId().equals(other.getId())) return false; - 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; + /** + * + * + *
+       * The severity specified for this patch
+       * 
+ * + * string severity = 3; + * + * @return The bytes for severity. + */ + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + ID_FIELD_NUMBER; - hash = (53 * hash) + getId().hashCode(); - hash = (37 * hash) + NAME_FIELD_NUMBER; - hash = (53 * hash) + getName().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; } + /** + * + * + *
+       * The severity specified for this patch
+       * 
+ * + * string severity = 3; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom(java.nio.ByteBuffer data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + severity_ = value; + onChanged(); + return this; } + /** + * + * + *
+       * The severity specified for this patch
+       * 
+ * + * string severity = 3; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom( - java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + severity_ = getDefaultInstance().getSeverity(); + onChanged(); + return this; } + /** + * + * + *
+       * The severity specified for this patch
+       * 
+ * + * string severity = 3; + * + * @param value The bytes for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom(com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); + severity_ = value; + onChanged(); + return this; } - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom( - com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); + private java.lang.Object summary_ = ""; + /** + * + * + *
+       * Any summary information provided about this patch.
+       * 
+ * + * string summary = 4; + * + * @return The summary. + */ + public java.lang.String getSummary() { + java.lang.Object ref = summary_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + summary_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - 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.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - 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.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - 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.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + /** + * + * + *
+       * Any summary information provided about this patch.
+       * 
+ * + * string summary = 4; + * + * @return The bytes for summary. + */ + public com.google.protobuf.ByteString getSummaryBytes() { + java.lang.Object ref = summary_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + summary_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } + /** + * + * + *
+       * Any summary information provided about this patch.
+       * 
+ * + * string summary = 4; + * + * @param value The summary to set. + * @return This builder for chaining. + */ + public Builder setSummary(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + summary_ = value; + onChanged(); + return this; } + /** + * + * + *
+       * Any summary information provided about this patch.
+       * 
+ * + * string summary = 4; + * + * @return This builder for chaining. + */ + public Builder clearSummary() { - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; + summary_ = getDefaultInstance().getSummary(); + onChanged(); + return this; } /** * * *
-       * Categories specified by the Windows Update.
+       * Any summary information provided about this patch.
        * 
* - * Protobuf type {@code - * google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} + * string summary = 4; + * + * @param value The bytes for summary to set. + * @return This builder for chaining. */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; + public Builder setSummaryBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } + checkByteStringIsUtf8(value); - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .class, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder.class); - } + summary_ = value; + onChanged(); + return this; + } - // Construct using - // com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); - } + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} - } + // @@protoc_insertion_point(builder_scope:google.cloud.osconfig.v1.Inventory.ZypperPatch) + } - @java.lang.Override - public Builder clear() { - super.clear(); - id_ = ""; + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.Inventory.ZypperPatch) + private static final com.google.cloud.osconfig.v1.Inventory.ZypperPatch DEFAULT_INSTANCE; - name_ = ""; + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + } - return this; - } + public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch getDefaultInstance() { + return DEFAULT_INSTANCE; + } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; - } + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ZypperPatch parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ZypperPatch(input, extensionRegistry); + } + }; - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - getDefaultInstanceForType() { - return com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .getDefaultInstance(); - } + public static com.google.protobuf.Parser parser() { + return PARSER; + } - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - build() { - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory result = - buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - buildPartial() { - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory result = - new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory( - this); - result.id_ = id_; - result.name_ = name_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return super.clone(); - } + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.ZypperPatch getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } - @java.lang.Override - public Builder setField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.setField(field, value); - } + public interface WindowsUpdatePackageOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + com.google.protobuf.MessageOrBuilder { - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return super.clearField(field); - } + /** + * + * + *
+     * The localized title of the update package.
+     * 
+ * + * string title = 1; + * + * @return The title. + */ + java.lang.String getTitle(); + /** + * + * + *
+     * The localized title of the update package.
+     * 
+ * + * string title = 1; + * + * @return The bytes for title. + */ + com.google.protobuf.ByteString getTitleBytes(); - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return super.clearOneof(oneof); - } + /** + * + * + *
+     * The localized description of the update package.
+     * 
+ * + * string description = 2; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+     * The localized description of the update package.
+     * 
+ * + * string description = 2; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); - @java.lang.Override - public Builder setRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, - int index, - java.lang.Object value) { - return super.setRepeatedField(field, index, value); - } + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + java.util.List< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> + getCategoriesList(); + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory getCategories( + int index); + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + int getCategoriesCount(); + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + java.util.List< + ? extends + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder> + getCategoriesOrBuilderList(); + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategoryOrBuilder + getCategoriesOrBuilder(int index); - @java.lang.Override - public Builder addRepeatedField( - com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return super.addRepeatedField(field, value); - } + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @return A list containing the kbArticleIds. + */ + java.util.List getKbArticleIdsList(); + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @return The count of kbArticleIds. + */ + int getKbArticleIdsCount(); + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index of the element to return. + * @return The kbArticleIds at the given index. + */ + java.lang.String getKbArticleIds(int index); + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the kbArticleIds at the given index. + */ + com.google.protobuf.ByteString getKbArticleIdsBytes(int index); - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other - instanceof - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) { - return mergeFrom( - (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - other); - } else { - super.mergeFrom(other); - return this; - } - } + /** + * + * + *
+     * A hyperlink to the language-specific support information for the update.
+     * 
+ * + * string support_url = 11; + * + * @return The supportUrl. + */ + java.lang.String getSupportUrl(); + /** + * + * + *
+     * A hyperlink to the language-specific support information for the update.
+     * 
+ * + * string support_url = 11; + * + * @return The bytes for supportUrl. + */ + com.google.protobuf.ByteString getSupportUrlBytes(); - public Builder mergeFrom( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - other) { - if (other - == com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .getDefaultInstance()) return this; - if (!other.getId().isEmpty()) { - id_ = other.id_; - onChanged(); - } - if (!other.getName().isEmpty()) { - name_ = other.name_; - onChanged(); - } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @return A list containing the moreInfoUrls. + */ + java.util.List getMoreInfoUrlsList(); + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @return The count of moreInfoUrls. + */ + int getMoreInfoUrlsCount(); + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index of the element to return. + * @return The moreInfoUrls at the given index. + */ + java.lang.String getMoreInfoUrls(int index); + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index of the value to return. + * @return The bytes of the moreInfoUrls at the given index. + */ + com.google.protobuf.ByteString getMoreInfoUrlsBytes(int index); - @java.lang.Override - public final boolean isInitialized() { - return true; - } + /** + * + * + *
+     * Gets the identifier of an update package.  Stays the same across
+     * revisions.
+     * 
+ * + * string update_id = 6; + * + * @return The updateId. + */ + java.lang.String getUpdateId(); + /** + * + * + *
+     * Gets the identifier of an update package.  Stays the same across
+     * revisions.
+     * 
+ * + * string update_id = 6; + * + * @return The bytes for updateId. + */ + com.google.protobuf.ByteString getUpdateIdBytes(); - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } + /** + * + * + *
+     * The revision number of this update package.
+     * 
+ * + * int32 revision_number = 7; + * + * @return The revisionNumber. + */ + int getRevisionNumber(); - private java.lang.Object id_ = ""; - /** - * - * - *
-         * The identifier of the windows update category.
-         * 
- * - * string id = 1; - * - * @return The id. - */ - public java.lang.String getId() { - java.lang.Object ref = id_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - id_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-         * The identifier of the windows update category.
-         * 
- * - * string id = 1; - * - * @return The bytes for id. - */ - public com.google.protobuf.ByteString getIdBytes() { - java.lang.Object ref = id_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - id_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-         * The identifier of the windows update category.
-         * 
- * - * string id = 1; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + /** + * + * + *
+     * The last published date of the update, in (UTC) date and time.
+     * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; + * + * @return Whether the lastDeploymentChangeTime field is set. + */ + boolean hasLastDeploymentChangeTime(); + /** + * + * + *
+     * The last published date of the update, in (UTC) date and time.
+     * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; + * + * @return The lastDeploymentChangeTime. + */ + com.google.protobuf.Timestamp getLastDeploymentChangeTime(); + /** + * + * + *
+     * The last published date of the update, in (UTC) date and time.
+     * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; + */ + com.google.protobuf.TimestampOrBuilder getLastDeploymentChangeTimeOrBuilder(); + } + /** + * + * + *
+   * Details related to a Windows Update package.
+   * Field data and names are taken from Windows Update API IUpdate Interface:
+   * https://docs.microsoft.com/en-us/windows/win32/api/_wua/
+   * Descriptive fields like title, and description are localized based on
+   * the locale of the VM being updated.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} + */ + public static final class WindowsUpdatePackage extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + WindowsUpdatePackageOrBuilder { + private static final long serialVersionUID = 0L; + // Use WindowsUpdatePackage.newBuilder() to construct. + private WindowsUpdatePackage(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } - id_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * The identifier of the windows update category.
-         * 
- * - * string id = 1; - * - * @return This builder for chaining. - */ - public Builder clearId() { + private WindowsUpdatePackage() { + title_ = ""; + description_ = ""; + categories_ = java.util.Collections.emptyList(); + kbArticleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + supportUrl_ = ""; + moreInfoUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + updateId_ = ""; + } - id_ = getDefaultInstance().getId(); - onChanged(); - return this; - } - /** - * - * - *
-         * The identifier of the windows update category.
-         * 
- * - * string id = 1; - * - * @param value The bytes for id to set. - * @return This builder for chaining. - */ - public Builder setIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WindowsUpdatePackage(); + } - id_ = value; - onChanged(); - return this; - } + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } - private java.lang.Object name_ = ""; - /** - * - * - *
-         * The name of the windows update category.
-         * 
- * - * string name = 2; - * - * @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 name of the windows update category.
-         * 
- * - * string name = 2; - * - * @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 name of the windows update category.
-         * 
- * - * string name = 2; - * - * @param value The name to set. - * @return This builder for chaining. - */ - public Builder setName(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + private WindowsUpdatePackage( + 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_ = value; - onChanged(); - return this; - } - /** - * - * - *
-         * The name of the windows update category.
-         * 
- * - * string name = 2; - * - * @return This builder for chaining. - */ - public Builder clearName() { + title_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); - name_ = getDefaultInstance().getName(); - onChanged(); - return this; - } - /** - * - * - *
-         * The name of the windows update category.
-         * 
- * - * string name = 2; - * - * @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); + description_ = s; + break; + } + case 26: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + categories_ = + new java.util.ArrayList< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory>(); + mutable_bitField0_ |= 0x00000001; + } + categories_.add( + input.readMessage( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory.parser(), + extensionRegistry)); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + kbArticleIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + kbArticleIds_.add(s); + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000004) != 0)) { + moreInfoUrls_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000004; + } + moreInfoUrls_.add(s); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); - name_ = value; - onChanged(); - return this; - } + updateId_ = s; + break; + } + case 56: + { + revisionNumber_ = input.readInt32(); + break; + } + case 82: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (lastDeploymentChangeTime_ != null) { + subBuilder = lastDeploymentChangeTime_.toBuilder(); + } + lastDeploymentChangeTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(lastDeploymentChangeTime_); + lastDeploymentChangeTime_ = subBuilder.buildPartial(); + } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); - } + break; + } + case 90: + { + java.lang.String s = input.readStringRequireUtf8(); - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + supportUrl_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } } - - // @@protoc_insertion_point(builder_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - } - - // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) - private static final com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = - new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); + } 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)) { + categories_ = java.util.Collections.unmodifiableList(categories_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + kbArticleIds_ = kbArticleIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000004) != 0)) { + moreInfoUrls_ = moreInfoUrls_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); } + } - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory - getDefaultInstance() { - return DEFAULT_INSTANCE; - } + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; + } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WindowsUpdateCategory parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WindowsUpdateCategory(input, extensionRegistry); - } - }; + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.class, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.Builder.class); + } - public static com.google.protobuf.Parser parser() { - return PARSER; - } + public interface WindowsUpdateCategoryOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + com.google.protobuf.MessageOrBuilder { - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; - } + /** + * + * + *
+       * The identifier of the windows update category.
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + java.lang.String getId(); + /** + * + * + *
+       * The identifier of the windows update category.
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + com.google.protobuf.ByteString getIdBytes(); - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - getDefaultInstanceForType() { - return DEFAULT_INSTANCE; - } + /** + * + * + *
+       * The name of the windows update category.
+       * 
+ * + * string name = 2; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+       * The name of the windows update category.
+       * 
+ * + * string name = 2; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); } - - public static final int TITLE_FIELD_NUMBER = 1; - private volatile java.lang.Object title_; /** * * *
-     * The localized title of the update package.
+     * Categories specified by the Windows Update.
      * 
* - * string title = 1; - * - * @return The title. + * Protobuf type {@code + * google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} */ - @java.lang.Override - public java.lang.String getTitle() { - java.lang.Object ref = title_; - 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(); - title_ = s; - return s; + public static final class WindowsUpdateCategory extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + WindowsUpdateCategoryOrBuilder { + private static final long serialVersionUID = 0L; + // Use WindowsUpdateCategory.newBuilder() to construct. + private WindowsUpdateCategory(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); } - } - /** - * - * - *
-     * The localized title of the update package.
-     * 
- * - * string title = 1; - * - * @return The bytes for title. - */ - @java.lang.Override - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + + private WindowsUpdateCategory() { + id_ = ""; + name_ = ""; } - } - public static final int DESCRIPTION_FIELD_NUMBER = 2; - private volatile java.lang.Object description_; - /** - * - * - *
-     * The localized description of the update package.
-     * 
- * - * string description = 2; - * - * @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; + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new WindowsUpdateCategory(); } - } - /** - * - * - *
-     * The localized description of the update package.
-     * 
- * - * string description = 2; - * - * @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; + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; } - } - public static final int CATEGORIES_FIELD_NUMBER = 3; - private java.util.List< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> - categories_; - /** - * - * - *
-     * The categories that are associated with this update package.
-     * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - @java.lang.Override - public java.util.List< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> - getCategoriesList() { - return categories_; - } - /** - * - * - *
-     * The categories that are associated with this update package.
-     * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - @java.lang.Override - public java.util.List< - ? extends - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder> - getCategoriesOrBuilderList() { - return categories_; - } - /** - * - * - *
-     * The categories that are associated with this update package.
-     * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - @java.lang.Override - public int getCategoriesCount() { - return categories_.size(); - } - /** - * - * - *
-     * The categories that are associated with this update package.
-     * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - getCategories(int index) { - return categories_.get(index); - } - /** - * - * - *
-     * The categories that are associated with this update package.
-     * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder - getCategoriesOrBuilder(int index) { - return categories_.get(index); - } + private WindowsUpdateCategory( + 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(); - public static final int KB_ARTICLE_IDS_FIELD_NUMBER = 4; - private com.google.protobuf.LazyStringList kbArticleIds_; - /** - * - * - *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
-     * 
- * - * repeated string kb_article_ids = 4; - * - * @return A list containing the kbArticleIds. - */ - public com.google.protobuf.ProtocolStringList getKbArticleIdsList() { - return kbArticleIds_; - } - /** - * - * - *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
-     * 
- * - * repeated string kb_article_ids = 4; - * - * @return The count of kbArticleIds. - */ - public int getKbArticleIdsCount() { - return kbArticleIds_.size(); - } - /** - * - * - *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
-     * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index of the element to return. - * @return The kbArticleIds at the given index. - */ - public java.lang.String getKbArticleIds(int index) { - return kbArticleIds_.get(index); - } - /** - * - * - *
-     * A collection of Microsoft Knowledge Base article IDs that are associated
-     * with the update package.
-     * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the kbArticleIds at the given index. - */ - public com.google.protobuf.ByteString getKbArticleIdsBytes(int index) { - return kbArticleIds_.getByteString(index); - } + id_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); - public static final int SUPPORT_URL_FIELD_NUMBER = 11; - private volatile java.lang.Object supportUrl_; - /** - * - * - *
-     * A hyperlink to the language-specific support information for the update.
-     * 
- * - * string support_url = 11; - * - * @return The supportUrl. - */ - @java.lang.Override - public java.lang.String getSupportUrl() { - java.lang.Object ref = supportUrl_; - 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(); - supportUrl_ = s; - return s; + 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(); + } } - } - /** - * - * - *
-     * A hyperlink to the language-specific support information for the update.
-     * 
- * - * string support_url = 11; - * - * @return The bytes for supportUrl. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSupportUrlBytes() { - java.lang.Object ref = supportUrl_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - supportUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; } - } - public static final int MORE_INFO_URLS_FIELD_NUMBER = 5; - private com.google.protobuf.LazyStringList moreInfoUrls_; - /** - * - * - *
-     * A collection of URLs that provide more information about the update
-     * package.
-     * 
- * - * repeated string more_info_urls = 5; - * - * @return A list containing the moreInfoUrls. - */ - public com.google.protobuf.ProtocolStringList getMoreInfoUrlsList() { - return moreInfoUrls_; - } - /** - * - * - *
-     * A collection of URLs that provide more information about the update
-     * package.
-     * 
- * - * repeated string more_info_urls = 5; - * - * @return The count of moreInfoUrls. - */ - public int getMoreInfoUrlsCount() { - return moreInfoUrls_.size(); - } - /** - * - * - *
-     * A collection of URLs that provide more information about the update
-     * package.
-     * 
- * - * repeated string more_info_urls = 5; - * - * @param index The index of the element to return. - * @return The moreInfoUrls at the given index. - */ - public java.lang.String getMoreInfoUrls(int index) { - return moreInfoUrls_.get(index); - } - /** - * - * - *
-     * A collection of URLs that provide more information about the update
-     * package.
-     * 
- * - * repeated string more_info_urls = 5; - * - * @param index The index of the value to return. - * @return The bytes of the moreInfoUrls at the given index. - */ - public com.google.protobuf.ByteString getMoreInfoUrlsBytes(int index) { - return moreInfoUrls_.getByteString(index); - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .class, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder.class); + } - public static final int UPDATE_ID_FIELD_NUMBER = 6; - private volatile java.lang.Object updateId_; - /** - * - * - *
-     * Gets the identifier of an update package.  Stays the same across
-     * revisions.
-     * 
- * - * string update_id = 6; - * - * @return The updateId. - */ - @java.lang.Override - public java.lang.String getUpdateId() { - java.lang.Object ref = updateId_; - 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(); - updateId_ = s; - return s; + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * + * + *
+       * The identifier of the windows update category.
+       * 
+ * + * string id = 1; + * + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } } - } - /** - * - * - *
-     * Gets the identifier of an update package.  Stays the same across
-     * revisions.
-     * 
- * - * string update_id = 6; - * - * @return The bytes for updateId. - */ - @java.lang.Override - public com.google.protobuf.ByteString getUpdateIdBytes() { - java.lang.Object ref = updateId_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - updateId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * + * + *
+       * The identifier of the windows update category.
+       * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } } - } - - public static final int REVISION_NUMBER_FIELD_NUMBER = 7; - private int revisionNumber_; - /** - * - * - *
-     * The revision number of this update package.
-     * 
- * - * int32 revision_number = 7; - * - * @return The revisionNumber. - */ - @java.lang.Override - public int getRevisionNumber() { - return revisionNumber_; - } - - public static final int LAST_DEPLOYMENT_CHANGE_TIME_FIELD_NUMBER = 10; - private com.google.protobuf.Timestamp lastDeploymentChangeTime_; - /** - * - * - *
-     * The last published date of the update, in (UTC) date and time.
-     * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - * - * @return Whether the lastDeploymentChangeTime field is set. - */ - @java.lang.Override - public boolean hasLastDeploymentChangeTime() { - return lastDeploymentChangeTime_ != null; - } - /** - * - * - *
-     * The last published date of the update, in (UTC) date and time.
-     * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - * - * @return The lastDeploymentChangeTime. - */ - @java.lang.Override - public com.google.protobuf.Timestamp getLastDeploymentChangeTime() { - return lastDeploymentChangeTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastDeploymentChangeTime_; - } - /** - * - * - *
-     * The last published date of the update, in (UTC) date and time.
-     * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - @java.lang.Override - public com.google.protobuf.TimestampOrBuilder getLastDeploymentChangeTimeOrBuilder() { - return getLastDeploymentChangeTime(); - } - - 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 (!getTitleBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_); + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + * + * + *
+       * The name of the windows update category.
+       * 
+ * + * string name = 2; + * + * @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; + } } - if (!getDescriptionBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); - } - for (int i = 0; i < categories_.size(); i++) { - output.writeMessage(3, categories_.get(i)); - } - for (int i = 0; i < kbArticleIds_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, kbArticleIds_.getRaw(i)); - } - for (int i = 0; i < moreInfoUrls_.size(); i++) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, moreInfoUrls_.getRaw(i)); - } - if (!getUpdateIdBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 6, updateId_); - } - if (revisionNumber_ != 0) { - output.writeInt32(7, revisionNumber_); - } - if (lastDeploymentChangeTime_ != null) { - output.writeMessage(10, getLastDeploymentChangeTime()); - } - if (!getSupportUrlBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 11, supportUrl_); + /** + * + * + *
+       * The name of the windows update category.
+       * 
+ * + * string name = 2; + * + * @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; + } } - unknownFields.writeTo(output); - } - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; + private byte memoizedIsInitialized = -1; - size = 0; - if (!getTitleBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_); + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; } - if (!getDescriptionBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + unknownFields.writeTo(output); } - for (int i = 0; i < categories_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, categories_.get(i)); + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; } - { - int dataSize = 0; - for (int i = 0; i < kbArticleIds_.size(); i++) { - dataSize += computeStringSizeNoTag(kbArticleIds_.getRaw(i)); + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; } - size += dataSize; - size += 1 * getKbArticleIdsList().size(); + if (!(obj + instanceof + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory other = + (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) obj; + + if (!getId().equals(other.getId())) return false; + if (!getName().equals(other.getName())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; } - { - int dataSize = 0; - for (int i = 0; i < moreInfoUrls_.size(); i++) { - dataSize += computeStringSizeNoTag(moreInfoUrls_.getRaw(i)); + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; } - size += dataSize; - size += 1 * getMoreInfoUrlsList().size(); + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; } - if (!getUpdateIdBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, updateId_); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - if (revisionNumber_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, revisionNumber_); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - if (lastDeploymentChangeTime_ != null) { - size += - com.google.protobuf.CodedOutputStream.computeMessageSize( - 10, getLastDeploymentChangeTime()); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - if (!getSupportUrlBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, supportUrl_); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - if (!(obj instanceof com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage)) { - return super.equals(obj); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage other = - (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) obj; - if (!getTitle().equals(other.getTitle())) return false; - if (!getDescription().equals(other.getDescription())) return false; - if (!getCategoriesList().equals(other.getCategoriesList())) return false; - if (!getKbArticleIdsList().equals(other.getKbArticleIdsList())) return false; - if (!getSupportUrl().equals(other.getSupportUrl())) return false; - if (!getMoreInfoUrlsList().equals(other.getMoreInfoUrlsList())) return false; - if (!getUpdateId().equals(other.getUpdateId())) return false; - if (getRevisionNumber() != other.getRevisionNumber()) return false; - if (hasLastDeploymentChangeTime() != other.hasLastDeploymentChangeTime()) return false; - if (hasLastDeploymentChangeTime()) { - if (!getLastDeploymentChangeTime().equals(other.getLastDeploymentChangeTime())) - return false; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TITLE_FIELD_NUMBER; - hash = (53 * hash) + getTitle().hashCode(); - hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; - hash = (53 * hash) + getDescription().hashCode(); - if (getCategoriesCount() > 0) { - hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; - hash = (53 * hash) + getCategoriesList().hashCode(); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } - if (getKbArticleIdsCount() > 0) { - hash = (37 * hash) + KB_ARTICLE_IDS_FIELD_NUMBER; - hash = (53 * hash) + getKbArticleIdsList().hashCode(); + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); } - hash = (37 * hash) + SUPPORT_URL_FIELD_NUMBER; - hash = (53 * hash) + getSupportUrl().hashCode(); - if (getMoreInfoUrlsCount() > 0) { - hash = (37 * hash) + MORE_INFO_URLS_FIELD_NUMBER; - hash = (53 * hash) + getMoreInfoUrlsList().hashCode(); - } - hash = (37 * hash) + UPDATE_ID_FIELD_NUMBER; - hash = (53 * hash) + getUpdateId().hashCode(); - hash = (37 * hash) + REVISION_NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getRevisionNumber(); - if (hasLastDeploymentChangeTime()) { - hash = (37 * hash) + LAST_DEPLOYMENT_CHANGE_TIME_FIELD_NUMBER; - hash = (53 * hash) + getLastDeploymentChangeTime().hashCode(); - } - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage prototype) { - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - @java.lang.Override - public Builder toBuilder() { - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } - @java.lang.Override - protected Builder newBuilderForType( - com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - Builder builder = new Builder(parent); - return builder; - } - /** - * - * - *
-     * Details related to a Windows Update package.
-     * Field data and names are taken from Windows Update API IUpdate Interface:
-     * https://docs.microsoft.com/en-us/windows/win32/api/_wua/
-     * Descriptive fields like title, and description are localized based on
-     * the locale of the VM being updated.
-     * 
- * - * Protobuf type {@code google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackageOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + 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 - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.class, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.Builder.class); + public Builder newBuilderForType() { + return newBuilder(); } - // Construct using com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + public static Builder newBuilder( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - getCategoriesFieldBuilder(); - } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override - public Builder clear() { - super.clear(); - title_ = ""; - - description_ = ""; + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+       * Categories specified by the Windows Update.
+       * 
+ * + * Protobuf type {@code + * google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; + } - if (categoriesBuilder_ == null) { - categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - } else { - categoriesBuilder_.clear(); + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .class, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder.class); } - kbArticleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - supportUrl_ = ""; - moreInfoUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - updateId_ = ""; + // Construct using + // com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - revisionNumber_ = 0; + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } - if (lastDeploymentChangeTimeBuilder_ == null) { - lastDeploymentChangeTime_ = null; - } else { - lastDeploymentChangeTime_ = null; - lastDeploymentChangeTimeBuilder_ = null; + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } - return this; - } - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; - } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - getDefaultInstanceForType() { - return com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.getDefaultInstance(); - } + name_ = ""; - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage build() { - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + return this; } - return result; - } - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage buildPartial() { - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage result = - new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(this); - int from_bitField0_ = bitField0_; - result.title_ = title_; - result.description_ = description_; - if (categoriesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - categories_ = java.util.Collections.unmodifiableList(categories_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.categories_ = categories_; - } else { - result.categories_ = categoriesBuilder_.build(); + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_WindowsUpdateCategory_descriptor; } - if (((bitField0_ & 0x00000002) != 0)) { - kbArticleIds_ = kbArticleIds_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000002); + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .getDefaultInstance(); } - result.kbArticleIds_ = kbArticleIds_; - result.supportUrl_ = supportUrl_; - if (((bitField0_ & 0x00000004) != 0)) { - moreInfoUrls_ = moreInfoUrls_.getUnmodifiableView(); - bitField0_ = (bitField0_ & ~0x00000004); + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + build() { + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - result.moreInfoUrls_ = moreInfoUrls_; - result.updateId_ = updateId_; - result.revisionNumber_ = revisionNumber_; - if (lastDeploymentChangeTimeBuilder_ == null) { - result.lastDeploymentChangeTime_ = lastDeploymentChangeTime_; - } else { - result.lastDeploymentChangeTime_ = lastDeploymentChangeTimeBuilder_.build(); + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + buildPartial() { + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory result = + new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory( + this); + result.id_ = id_; + result.name_ = name_; + onBuilt(); + return result; } - onBuilt(); - return result; - } - @java.lang.Override - public Builder clone() { - return super.clone(); - } + @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 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 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 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 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 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.osconfig.v1.Inventory.WindowsUpdatePackage) { - return mergeFrom((com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) other); - } else { - super.mergeFrom(other); - return this; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) { + return mergeFrom( + (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + other); + } else { + super.mergeFrom(other); + return this; + } } - } - public Builder mergeFrom(com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage other) { - if (other - == com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.getDefaultInstance()) - return this; - if (!other.getTitle().isEmpty()) { - title_ = other.title_; + public Builder mergeFrom( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + other) { + if (other + == com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); onChanged(); + return this; } - if (!other.getDescription().isEmpty()) { - description_ = other.description_; - onChanged(); + + @java.lang.Override + public final boolean isInitialized() { + return true; } - if (categoriesBuilder_ == null) { - if (!other.categories_.isEmpty()) { - if (categories_.isEmpty()) { - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureCategoriesIsMutable(); - categories_.addAll(other.categories_); - } - onChanged(); - } - } else { - if (!other.categories_.isEmpty()) { - if (categoriesBuilder_.isEmpty()) { - categoriesBuilder_.dispose(); - categoriesBuilder_ = null; - categories_ = other.categories_; - bitField0_ = (bitField0_ & ~0x00000001); - categoriesBuilder_ = - com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getCategoriesFieldBuilder() - : null; - } else { - categoriesBuilder_.addAllMessages(other.categories_); + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); } } + return this; } - if (!other.kbArticleIds_.isEmpty()) { - if (kbArticleIds_.isEmpty()) { - kbArticleIds_ = other.kbArticleIds_; - bitField0_ = (bitField0_ & ~0x00000002); + + private java.lang.Object id_ = ""; + /** + * + * + *
+         * The identifier of the windows update category.
+         * 
+ * + * string id = 1; + * + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; } else { - ensureKbArticleIdsIsMutable(); - kbArticleIds_.addAll(other.kbArticleIds_); + return (java.lang.String) ref; } - onChanged(); - } - if (!other.getSupportUrl().isEmpty()) { - supportUrl_ = other.supportUrl_; - onChanged(); } - if (!other.moreInfoUrls_.isEmpty()) { - if (moreInfoUrls_.isEmpty()) { - moreInfoUrls_ = other.moreInfoUrls_; - bitField0_ = (bitField0_ & ~0x00000004); + /** + * + * + *
+         * The identifier of the windows update category.
+         * 
+ * + * string id = 1; + * + * @return The bytes for id. + */ + public com.google.protobuf.ByteString getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + id_ = b; + return b; } else { - ensureMoreInfoUrlsIsMutable(); - moreInfoUrls_.addAll(other.moreInfoUrls_); + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The identifier of the windows update category.
+         * 
+ * + * string id = 1; + * + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + + id_ = value; onChanged(); + return this; } - if (!other.getUpdateId().isEmpty()) { - updateId_ = other.updateId_; + /** + * + * + *
+         * The identifier of the windows update category.
+         * 
+ * + * string id = 1; + * + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); onChanged(); + return this; } - if (other.getRevisionNumber() != 0) { - setRevisionNumber(other.getRevisionNumber()); + /** + * + * + *
+         * The identifier of the windows update category.
+         * 
+ * + * string id = 1; + * + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; } - if (other.hasLastDeploymentChangeTime()) { - mergeLastDeploymentChangeTime(other.getLastDeploymentChangeTime()); + + private java.lang.Object name_ = ""; + /** + * + * + *
+         * The name of the windows update category.
+         * 
+ * + * string name = 2; + * + * @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; + } } - this.mergeUnknownFields(other.unknownFields); - onChanged(); - return this; - } + /** + * + * + *
+         * The name of the windows update category.
+         * 
+ * + * string name = 2; + * + * @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 name of the windows update category.
+         * 
+ * + * string name = 2; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - @java.lang.Override - public final boolean isInitialized() { - return true; - } + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The name of the windows update category.
+         * 
+ * + * string name = 2; + * + * @return This builder for chaining. + */ + public Builder clearName() { - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) - e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+         * The name of the windows update category.
+         * 
+ * + * string name = 2; + * + * @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; } - return this; - } - private int bitField0_; + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } - private java.lang.Object title_ = ""; - /** - * - * - *
-       * The localized title of the update package.
-       * 
- * - * string title = 1; - * - * @return The title. - */ - public java.lang.String getTitle() { - java.lang.Object ref = title_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - title_ = s; - return s; - } else { - return (java.lang.String) ref; + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); } + + // @@protoc_insertion_point(builder_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) } - /** - * - * - *
-       * The localized title of the update package.
-       * 
- * - * string title = 1; - * - * @return The bytes for title. - */ - public com.google.protobuf.ByteString getTitleBytes() { - java.lang.Object ref = title_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - title_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * The localized title of the update package.
-       * 
- * - * string title = 1; - * - * @param value The title to set. - * @return This builder for chaining. - */ - public Builder setTitle(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - title_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * The localized title of the update package.
-       * 
- * - * string title = 1; - * - * @return This builder for chaining. - */ - public Builder clearTitle() { + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory) + private static final com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + DEFAULT_INSTANCE; - title_ = getDefaultInstance().getTitle(); - onChanged(); - return this; + static { + DEFAULT_INSTANCE = + new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory(); } - /** - * - * - *
-       * The localized title of the update package.
-       * 
- * - * string title = 1; - * - * @param value The bytes for title to set. - * @return This builder for chaining. - */ - public Builder setTitleBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - title_ = value; - onChanged(); - return this; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory + getDefaultInstance() { + return DEFAULT_INSTANCE; } - private java.lang.Object description_ = ""; - /** - * - * - *
-       * The localized description of the update package.
-       * 
- * - * string description = 2; - * - * @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; - } - } - /** - * - * - *
-       * The localized description of the update package.
-       * 
- * - * string description = 2; - * - * @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; - } - } - /** - * - * - *
-       * The localized description of the update package.
-       * 
- * - * string description = 2; - * - * @param value The description to set. - * @return This builder for chaining. - */ - public Builder setDescription(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WindowsUpdateCategory parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WindowsUpdateCategory(input, extensionRegistry); + } + }; - description_ = value; - onChanged(); - return this; + public static com.google.protobuf.Parser parser() { + return PARSER; } - /** - * - * - *
-       * The localized description of the update package.
-       * 
- * - * string description = 2; - * - * @return This builder for chaining. - */ - public Builder clearDescription() { - description_ = getDefaultInstance().getDescription(); - onChanged(); - return this; + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; } - /** - * - * - *
-       * The localized description of the update package.
-       * 
- * - * string description = 2; - * - * @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; + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; } + } - private java.util.List< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> - categories_ = java.util.Collections.emptyList(); - - private void ensureCategoriesIsMutable() { - if (!((bitField0_ & 0x00000001) != 0)) { - categories_ = - new java.util.ArrayList< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory>(categories_); - bitField0_ |= 0x00000001; - } + public static final int TITLE_FIELD_NUMBER = 1; + private volatile java.lang.Object title_; + /** + * + * + *
+     * The localized title of the update package.
+     * 
+ * + * string title = 1; + * + * @return The title. + */ + @java.lang.Override + public java.lang.String getTitle() { + java.lang.Object ref = title_; + 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(); + title_ = s; + return s; + } + } + /** + * + * + *
+     * The localized title of the update package.
+     * 
+ * + * string title = 1; + * + * @return The bytes for title. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder> - categoriesBuilder_; - - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public java.util.List< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> - getCategoriesList() { - if (categoriesBuilder_ == null) { - return java.util.Collections.unmodifiableList(categories_); - } else { - return categoriesBuilder_.getMessageList(); - } - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public int getCategoriesCount() { - if (categoriesBuilder_ == null) { - return categories_.size(); - } else { - return categoriesBuilder_.getCount(); - } - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - getCategories(int index) { - if (categoriesBuilder_ == null) { - return categories_.get(index); - } else { - return categoriesBuilder_.getMessage(index); - } - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder setCategories( - int index, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.set(index, value); - onChanged(); - } else { - categoriesBuilder_.setMessage(index, value); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder setCategories( - int index, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.Builder - builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.set(index, builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder addCategories( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.add(value); - onChanged(); - } else { - categoriesBuilder_.addMessage(value); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder addCategories( - int index, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory value) { - if (categoriesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureCategoriesIsMutable(); - categories_.add(index, value); - onChanged(); - } else { - categoriesBuilder_.addMessage(index, value); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder addCategories( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.Builder - builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder addCategories( - int index, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.Builder - builderForValue) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.add(index, builderForValue.build()); - onChanged(); - } else { - categoriesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder addAllCategories( - java.lang.Iterable< - ? extends - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategory> - values) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); - onChanged(); - } else { - categoriesBuilder_.addAllMessages(values); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder clearCategories() { - if (categoriesBuilder_ == null) { - categories_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - categoriesBuilder_.clear(); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public Builder removeCategories(int index) { - if (categoriesBuilder_ == null) { - ensureCategoriesIsMutable(); - categories_.remove(index); - onChanged(); - } else { - categoriesBuilder_.remove(index); - } - return this; - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder - getCategoriesBuilder(int index) { - return getCategoriesFieldBuilder().getBuilder(index); - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder - getCategoriesOrBuilder(int index) { - if (categoriesBuilder_ == null) { - return categories_.get(index); - } else { - return categoriesBuilder_.getMessageOrBuilder(index); - } - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public java.util.List< - ? extends - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder> - getCategoriesOrBuilderList() { - if (categoriesBuilder_ != null) { - return categoriesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(categories_); - } - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder - addCategoriesBuilder() { - return getCategoriesFieldBuilder() - .addBuilder( - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .getDefaultInstance()); - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder - addCategoriesBuilder(int index) { - return getCategoriesFieldBuilder() - .addBuilder( - index, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .getDefaultInstance()); - } - /** - * - * - *
-       * The categories that are associated with this update package.
-       * 
- * - * - * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; - * - */ - public java.util.List< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder> - getCategoriesBuilderList() { - return getCategoriesFieldBuilder().getBuilderList(); - } - - private com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder> - getCategoriesFieldBuilder() { - if (categoriesBuilder_ == null) { - categoriesBuilder_ = - new com.google.protobuf.RepeatedFieldBuilderV3< - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory - .Builder, - com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - .WindowsUpdateCategoryOrBuilder>( - categories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); - categories_ = null; - } - return categoriesBuilder_; - } - - private com.google.protobuf.LazyStringList kbArticleIds_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureKbArticleIdsIsMutable() { - if (!((bitField0_ & 0x00000002) != 0)) { - kbArticleIds_ = new com.google.protobuf.LazyStringArrayList(kbArticleIds_); - bitField0_ |= 0x00000002; - } - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @return A list containing the kbArticleIds. - */ - public com.google.protobuf.ProtocolStringList getKbArticleIdsList() { - return kbArticleIds_.getUnmodifiableView(); - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @return The count of kbArticleIds. - */ - public int getKbArticleIdsCount() { - return kbArticleIds_.size(); - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index of the element to return. - * @return The kbArticleIds at the given index. - */ - public java.lang.String getKbArticleIds(int index) { - return kbArticleIds_.get(index); - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index of the value to return. - * @return The bytes of the kbArticleIds at the given index. - */ - public com.google.protobuf.ByteString getKbArticleIdsBytes(int index) { - return kbArticleIds_.getByteString(index); - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @param index The index to set the value at. - * @param value The kbArticleIds to set. - * @return This builder for chaining. - */ - public Builder setKbArticleIds(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureKbArticleIdsIsMutable(); - kbArticleIds_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @param value The kbArticleIds to add. - * @return This builder for chaining. - */ - public Builder addKbArticleIds(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureKbArticleIdsIsMutable(); - kbArticleIds_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @param values The kbArticleIds to add. - * @return This builder for chaining. - */ - public Builder addAllKbArticleIds(java.lang.Iterable values) { - ensureKbArticleIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, kbArticleIds_); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @return This builder for chaining. - */ - public Builder clearKbArticleIds() { - kbArticleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of Microsoft Knowledge Base article IDs that are associated
-       * with the update package.
-       * 
- * - * repeated string kb_article_ids = 4; - * - * @param value The bytes of the kbArticleIds to add. - * @return This builder for chaining. - */ - public Builder addKbArticleIdsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureKbArticleIdsIsMutable(); - kbArticleIds_.add(value); - onChanged(); - return this; - } - - private java.lang.Object supportUrl_ = ""; - /** - * - * - *
-       * A hyperlink to the language-specific support information for the update.
-       * 
- * - * string support_url = 11; - * - * @return The supportUrl. - */ - public java.lang.String getSupportUrl() { - java.lang.Object ref = supportUrl_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - supportUrl_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } - /** - * - * - *
-       * A hyperlink to the language-specific support information for the update.
-       * 
- * - * string support_url = 11; - * - * @return The bytes for supportUrl. - */ - public com.google.protobuf.ByteString getSupportUrlBytes() { - java.lang.Object ref = supportUrl_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - supportUrl_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - /** - * - * - *
-       * A hyperlink to the language-specific support information for the update.
-       * 
- * - * string support_url = 11; - * - * @param value The supportUrl to set. - * @return This builder for chaining. - */ - public Builder setSupportUrl(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - - supportUrl_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * A hyperlink to the language-specific support information for the update.
-       * 
- * - * string support_url = 11; - * - * @return This builder for chaining. - */ - public Builder clearSupportUrl() { - - supportUrl_ = getDefaultInstance().getSupportUrl(); - onChanged(); - return this; + public static final int DESCRIPTION_FIELD_NUMBER = 2; + private volatile java.lang.Object description_; + /** + * + * + *
+     * The localized description of the update package.
+     * 
+ * + * string description = 2; + * + * @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; } - /** - * - * - *
-       * A hyperlink to the language-specific support information for the update.
-       * 
- * - * string support_url = 11; - * - * @param value The bytes for supportUrl to set. - * @return This builder for chaining. - */ - public Builder setSupportUrlBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - supportUrl_ = value; - onChanged(); - return this; + } + /** + * + * + *
+     * The localized description of the update package.
+     * 
+ * + * string description = 2; + * + * @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; } + } - private com.google.protobuf.LazyStringList moreInfoUrls_ = - com.google.protobuf.LazyStringArrayList.EMPTY; - - private void ensureMoreInfoUrlsIsMutable() { - if (!((bitField0_ & 0x00000004) != 0)) { - moreInfoUrls_ = new com.google.protobuf.LazyStringArrayList(moreInfoUrls_); - bitField0_ |= 0x00000004; - } - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @return A list containing the moreInfoUrls. - */ - public com.google.protobuf.ProtocolStringList getMoreInfoUrlsList() { - return moreInfoUrls_.getUnmodifiableView(); - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @return The count of moreInfoUrls. - */ - public int getMoreInfoUrlsCount() { - return moreInfoUrls_.size(); - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @param index The index of the element to return. - * @return The moreInfoUrls at the given index. - */ - public java.lang.String getMoreInfoUrls(int index) { - return moreInfoUrls_.get(index); - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @param index The index of the value to return. - * @return The bytes of the moreInfoUrls at the given index. - */ - public com.google.protobuf.ByteString getMoreInfoUrlsBytes(int index) { - return moreInfoUrls_.getByteString(index); - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @param index The index to set the value at. - * @param value The moreInfoUrls to set. - * @return This builder for chaining. - */ - public Builder setMoreInfoUrls(int index, java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMoreInfoUrlsIsMutable(); - moreInfoUrls_.set(index, value); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @param value The moreInfoUrls to add. - * @return This builder for chaining. - */ - public Builder addMoreInfoUrls(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - ensureMoreInfoUrlsIsMutable(); - moreInfoUrls_.add(value); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @param values The moreInfoUrls to add. - * @return This builder for chaining. - */ - public Builder addAllMoreInfoUrls(java.lang.Iterable values) { - ensureMoreInfoUrlsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, moreInfoUrls_); - onChanged(); - return this; - } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @return This builder for chaining. - */ - public Builder clearMoreInfoUrls() { - moreInfoUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; + public static final int CATEGORIES_FIELD_NUMBER = 3; + private java.util.List< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> + categories_; + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> + getCategoriesList() { + return categories_; + } + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder> + getCategoriesOrBuilderList() { + return categories_; + } + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + @java.lang.Override + public int getCategoriesCount() { + return categories_.size(); + } + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + getCategories(int index) { + return categories_.get(index); + } + /** + * + * + *
+     * The categories that are associated with this update package.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder + getCategoriesOrBuilder(int index) { + return categories_.get(index); + } + + public static final int KB_ARTICLE_IDS_FIELD_NUMBER = 4; + private com.google.protobuf.LazyStringList kbArticleIds_; + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @return A list containing the kbArticleIds. + */ + public com.google.protobuf.ProtocolStringList getKbArticleIdsList() { + return kbArticleIds_; + } + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @return The count of kbArticleIds. + */ + public int getKbArticleIdsCount() { + return kbArticleIds_.size(); + } + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index of the element to return. + * @return The kbArticleIds at the given index. + */ + public java.lang.String getKbArticleIds(int index) { + return kbArticleIds_.get(index); + } + /** + * + * + *
+     * A collection of Microsoft Knowledge Base article IDs that are associated
+     * with the update package.
+     * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the kbArticleIds at the given index. + */ + public com.google.protobuf.ByteString getKbArticleIdsBytes(int index) { + return kbArticleIds_.getByteString(index); + } + + public static final int SUPPORT_URL_FIELD_NUMBER = 11; + private volatile java.lang.Object supportUrl_; + /** + * + * + *
+     * A hyperlink to the language-specific support information for the update.
+     * 
+ * + * string support_url = 11; + * + * @return The supportUrl. + */ + @java.lang.Override + public java.lang.String getSupportUrl() { + java.lang.Object ref = supportUrl_; + 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(); + supportUrl_ = s; + return s; } - /** - * - * - *
-       * A collection of URLs that provide more information about the update
-       * package.
-       * 
- * - * repeated string more_info_urls = 5; - * - * @param value The bytes of the moreInfoUrls to add. - * @return This builder for chaining. - */ - public Builder addMoreInfoUrlsBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - ensureMoreInfoUrlsIsMutable(); - moreInfoUrls_.add(value); - onChanged(); - return this; + } + /** + * + * + *
+     * A hyperlink to the language-specific support information for the update.
+     * 
+ * + * string support_url = 11; + * + * @return The bytes for supportUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSupportUrlBytes() { + java.lang.Object ref = supportUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + supportUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } + + public static final int MORE_INFO_URLS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList moreInfoUrls_; + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @return A list containing the moreInfoUrls. + */ + public com.google.protobuf.ProtocolStringList getMoreInfoUrlsList() { + return moreInfoUrls_; + } + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @return The count of moreInfoUrls. + */ + public int getMoreInfoUrlsCount() { + return moreInfoUrls_.size(); + } + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index of the element to return. + * @return The moreInfoUrls at the given index. + */ + public java.lang.String getMoreInfoUrls(int index) { + return moreInfoUrls_.get(index); + } + /** + * + * + *
+     * A collection of URLs that provide more information about the update
+     * package.
+     * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index of the value to return. + * @return The bytes of the moreInfoUrls at the given index. + */ + public com.google.protobuf.ByteString getMoreInfoUrlsBytes(int index) { + return moreInfoUrls_.getByteString(index); + } - private java.lang.Object updateId_ = ""; - /** - * - * - *
-       * Gets the identifier of an update package.  Stays the same across
-       * revisions.
-       * 
- * - * string update_id = 6; - * - * @return The updateId. - */ - public java.lang.String getUpdateId() { - java.lang.Object ref = updateId_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - updateId_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public static final int UPDATE_ID_FIELD_NUMBER = 6; + private volatile java.lang.Object updateId_; + /** + * + * + *
+     * Gets the identifier of an update package.  Stays the same across
+     * revisions.
+     * 
+ * + * string update_id = 6; + * + * @return The updateId. + */ + @java.lang.Override + public java.lang.String getUpdateId() { + java.lang.Object ref = updateId_; + 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(); + updateId_ = s; + return s; } - /** - * - * - *
-       * Gets the identifier of an update package.  Stays the same across
-       * revisions.
-       * 
- * - * string update_id = 6; - * - * @return The bytes for updateId. - */ - public com.google.protobuf.ByteString getUpdateIdBytes() { - java.lang.Object ref = updateId_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - updateId_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + } + /** + * + * + *
+     * Gets the identifier of an update package.  Stays the same across
+     * revisions.
+     * 
+ * + * string update_id = 6; + * + * @return The bytes for updateId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUpdateIdBytes() { + java.lang.Object ref = updateId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + updateId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - /** - * - * - *
-       * Gets the identifier of an update package.  Stays the same across
-       * revisions.
-       * 
- * - * string update_id = 6; - * - * @param value The updateId to set. - * @return This builder for chaining. - */ - public Builder setUpdateId(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + } - updateId_ = value; - onChanged(); - return this; - } - /** - * - * - *
-       * Gets the identifier of an update package.  Stays the same across
-       * revisions.
-       * 
- * - * string update_id = 6; - * - * @return This builder for chaining. - */ - public Builder clearUpdateId() { + public static final int REVISION_NUMBER_FIELD_NUMBER = 7; + private int revisionNumber_; + /** + * + * + *
+     * The revision number of this update package.
+     * 
+ * + * int32 revision_number = 7; + * + * @return The revisionNumber. + */ + @java.lang.Override + public int getRevisionNumber() { + return revisionNumber_; + } - updateId_ = getDefaultInstance().getUpdateId(); - onChanged(); - return this; - } - /** - * - * - *
-       * Gets the identifier of an update package.  Stays the same across
-       * revisions.
-       * 
- * - * string update_id = 6; - * - * @param value The bytes for updateId to set. - * @return This builder for chaining. - */ - public Builder setUpdateIdBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); + public static final int LAST_DEPLOYMENT_CHANGE_TIME_FIELD_NUMBER = 10; + private com.google.protobuf.Timestamp lastDeploymentChangeTime_; + /** + * + * + *
+     * The last published date of the update, in (UTC) date and time.
+     * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; + * + * @return Whether the lastDeploymentChangeTime field is set. + */ + @java.lang.Override + public boolean hasLastDeploymentChangeTime() { + return lastDeploymentChangeTime_ != null; + } + /** + * + * + *
+     * The last published date of the update, in (UTC) date and time.
+     * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; + * + * @return The lastDeploymentChangeTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getLastDeploymentChangeTime() { + return lastDeploymentChangeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastDeploymentChangeTime_; + } + /** + * + * + *
+     * The last published date of the update, in (UTC) date and time.
+     * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getLastDeploymentChangeTimeOrBuilder() { + return getLastDeploymentChangeTime(); + } - updateId_ = value; - onChanged(); - return this; + 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 (!getTitleBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, title_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, description_); } - - private int revisionNumber_; - /** - * - * - *
-       * The revision number of this update package.
-       * 
- * - * int32 revision_number = 7; - * - * @return The revisionNumber. - */ - @java.lang.Override - public int getRevisionNumber() { - return revisionNumber_; + for (int i = 0; i < categories_.size(); i++) { + output.writeMessage(3, categories_.get(i)); } - /** - * - * - *
-       * The revision number of this update package.
-       * 
- * - * int32 revision_number = 7; - * - * @param value The revisionNumber to set. - * @return This builder for chaining. - */ - public Builder setRevisionNumber(int value) { - - revisionNumber_ = value; - onChanged(); - return this; + for (int i = 0; i < kbArticleIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, kbArticleIds_.getRaw(i)); } - /** - * - * - *
-       * The revision number of this update package.
-       * 
- * - * int32 revision_number = 7; - * - * @return This builder for chaining. - */ - public Builder clearRevisionNumber() { - - revisionNumber_ = 0; - onChanged(); - return this; + for (int i = 0; i < moreInfoUrls_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, moreInfoUrls_.getRaw(i)); } - - private com.google.protobuf.Timestamp lastDeploymentChangeTime_; - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - lastDeploymentChangeTimeBuilder_; - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - * - * @return Whether the lastDeploymentChangeTime field is set. - */ - public boolean hasLastDeploymentChangeTime() { - return lastDeploymentChangeTimeBuilder_ != null || lastDeploymentChangeTime_ != null; + if (!getUpdateIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, updateId_); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - * - * @return The lastDeploymentChangeTime. - */ - public com.google.protobuf.Timestamp getLastDeploymentChangeTime() { - if (lastDeploymentChangeTimeBuilder_ == null) { - return lastDeploymentChangeTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastDeploymentChangeTime_; - } else { - return lastDeploymentChangeTimeBuilder_.getMessage(); - } + if (revisionNumber_ != 0) { + output.writeInt32(7, revisionNumber_); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - public Builder setLastDeploymentChangeTime(com.google.protobuf.Timestamp value) { - if (lastDeploymentChangeTimeBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - lastDeploymentChangeTime_ = value; - onChanged(); - } else { - lastDeploymentChangeTimeBuilder_.setMessage(value); - } - - return this; + if (lastDeploymentChangeTime_ != null) { + output.writeMessage(10, getLastDeploymentChangeTime()); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - public Builder setLastDeploymentChangeTime( - com.google.protobuf.Timestamp.Builder builderForValue) { - if (lastDeploymentChangeTimeBuilder_ == null) { - lastDeploymentChangeTime_ = builderForValue.build(); - onChanged(); - } else { - lastDeploymentChangeTimeBuilder_.setMessage(builderForValue.build()); - } - - return this; + if (!getSupportUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, supportUrl_); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - public Builder mergeLastDeploymentChangeTime(com.google.protobuf.Timestamp value) { - if (lastDeploymentChangeTimeBuilder_ == null) { - if (lastDeploymentChangeTime_ != null) { - lastDeploymentChangeTime_ = - com.google.protobuf.Timestamp.newBuilder(lastDeploymentChangeTime_) - .mergeFrom(value) - .buildPartial(); - } else { - lastDeploymentChangeTime_ = value; - } - onChanged(); - } else { - lastDeploymentChangeTimeBuilder_.mergeFrom(value); - } + unknownFields.writeTo(output); + } - return this; - } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - public Builder clearLastDeploymentChangeTime() { - if (lastDeploymentChangeTimeBuilder_ == null) { - lastDeploymentChangeTime_ = null; - onChanged(); - } else { - lastDeploymentChangeTime_ = null; - lastDeploymentChangeTimeBuilder_ = null; - } + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; - return this; + size = 0; + if (!getTitleBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, title_); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - public com.google.protobuf.Timestamp.Builder getLastDeploymentChangeTimeBuilder() { - - onChanged(); - return getLastDeploymentChangeTimeFieldBuilder().getBuilder(); + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, description_); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - public com.google.protobuf.TimestampOrBuilder getLastDeploymentChangeTimeOrBuilder() { - if (lastDeploymentChangeTimeBuilder_ != null) { - return lastDeploymentChangeTimeBuilder_.getMessageOrBuilder(); - } else { - return lastDeploymentChangeTime_ == null - ? com.google.protobuf.Timestamp.getDefaultInstance() - : lastDeploymentChangeTime_; + for (int i = 0; i < categories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, categories_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < kbArticleIds_.size(); i++) { + dataSize += computeStringSizeNoTag(kbArticleIds_.getRaw(i)); } + size += dataSize; + size += 1 * getKbArticleIdsList().size(); } - /** - * - * - *
-       * The last published date of the update, in (UTC) date and time.
-       * 
- * - * .google.protobuf.Timestamp last_deployment_change_time = 10; - */ - private com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder> - getLastDeploymentChangeTimeFieldBuilder() { - if (lastDeploymentChangeTimeBuilder_ == null) { - lastDeploymentChangeTimeBuilder_ = - new com.google.protobuf.SingleFieldBuilderV3< - com.google.protobuf.Timestamp, - com.google.protobuf.Timestamp.Builder, - com.google.protobuf.TimestampOrBuilder>( - getLastDeploymentChangeTime(), getParentForChildren(), isClean()); - lastDeploymentChangeTime_ = null; + { + int dataSize = 0; + for (int i = 0; i < moreInfoUrls_.size(); i++) { + dataSize += computeStringSizeNoTag(moreInfoUrls_.getRaw(i)); } - return lastDeploymentChangeTimeBuilder_; + size += dataSize; + size += 1 * getMoreInfoUrlsList().size(); + } + if (!getUpdateIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, updateId_); + } + if (revisionNumber_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(7, revisionNumber_); + } + if (lastDeploymentChangeTime_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 10, getLastDeploymentChangeTime()); + } + if (!getSupportUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, supportUrl_); } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } - @java.lang.Override - public final Builder setUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.setUnknownFields(unknownFields); + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage)) { + return super.equals(obj); } + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage other = + (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) obj; - @java.lang.Override - public final Builder mergeUnknownFields( - final com.google.protobuf.UnknownFieldSet unknownFields) { - return super.mergeUnknownFields(unknownFields); + if (!getTitle().equals(other.getTitle())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getCategoriesList().equals(other.getCategoriesList())) return false; + if (!getKbArticleIdsList().equals(other.getKbArticleIdsList())) return false; + if (!getSupportUrl().equals(other.getSupportUrl())) return false; + if (!getMoreInfoUrlsList().equals(other.getMoreInfoUrlsList())) return false; + if (!getUpdateId().equals(other.getUpdateId())) return false; + if (getRevisionNumber() != other.getRevisionNumber()) return false; + if (hasLastDeploymentChangeTime() != other.hasLastDeploymentChangeTime()) return false; + if (hasLastDeploymentChangeTime()) { + if (!getLastDeploymentChangeTime().equals(other.getLastDeploymentChangeTime())) + return false; } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } - // @@protoc_insertion_point(builder_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TITLE_FIELD_NUMBER; + hash = (53 * hash) + getTitle().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getCategoriesCount() > 0) { + hash = (37 * hash) + CATEGORIES_FIELD_NUMBER; + hash = (53 * hash) + getCategoriesList().hashCode(); + } + if (getKbArticleIdsCount() > 0) { + hash = (37 * hash) + KB_ARTICLE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getKbArticleIdsList().hashCode(); + } + hash = (37 * hash) + SUPPORT_URL_FIELD_NUMBER; + hash = (53 * hash) + getSupportUrl().hashCode(); + if (getMoreInfoUrlsCount() > 0) { + hash = (37 * hash) + MORE_INFO_URLS_FIELD_NUMBER; + hash = (53 * hash) + getMoreInfoUrlsList().hashCode(); + } + hash = (37 * hash) + UPDATE_ID_FIELD_NUMBER; + hash = (53 * hash) + getUpdateId().hashCode(); + hash = (37 * hash) + REVISION_NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getRevisionNumber(); + if (hasLastDeploymentChangeTime()) { + hash = (37 * hash) + LAST_DEPLOYMENT_CHANGE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getLastDeploymentChangeTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; } - // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) - private static final com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage - DEFAULT_INSTANCE; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } - static { - DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage getDefaultInstance() { - return DEFAULT_INSTANCE; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { - @java.lang.Override - public WindowsUpdatePackage parsePartialFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return new WindowsUpdatePackage(input, extensionRegistry); - } - }; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.protobuf.Parser parser() { - return PARSER; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - return PARSER; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); } - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage getDefaultInstanceForType() { - return DEFAULT_INSTANCE; + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } - } - public interface ZypperPatchOrBuilder - extends - // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory.ZypperPatch) - com.google.protobuf.MessageOrBuilder { + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } - /** - * - * - *
-     * The name of the patch.
-     * 
- * - * string patch_name = 5; - * - * @return The patchName. - */ - java.lang.String getPatchName(); - /** - * - * - *
-     * The name of the patch.
-     * 
- * - * string patch_name = 5; - * - * @return The bytes for patchName. - */ - com.google.protobuf.ByteString getPatchNameBytes(); + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } - /** - * - * - *
-     * The category of the patch.
-     * 
- * - * string category = 2; - * - * @return The category. - */ - java.lang.String getCategory(); - /** - * - * - *
-     * The category of the patch.
-     * 
- * - * string category = 2; - * - * @return The bytes for category. - */ - com.google.protobuf.ByteString getCategoryBytes(); + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } - /** - * - * - *
-     * The severity specified for this patch
-     * 
- * - * string severity = 3; - * - * @return The severity. - */ - java.lang.String getSeverity(); - /** - * - * - *
-     * The severity specified for this patch
-     * 
- * - * string severity = 3; - * - * @return The bytes for severity. - */ - com.google.protobuf.ByteString getSeverityBytes(); + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage 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.osconfig.v1.Inventory.WindowsUpdatePackage 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; + } /** * * *
-     * Any summary information provided about this patch.
-     * 
- * - * string summary = 4; - * - * @return The summary. - */ - java.lang.String getSummary(); - /** - * - * - *
-     * Any summary information provided about this patch.
+     * Details related to a Windows Update package.
+     * Field data and names are taken from Windows Update API IUpdate Interface:
+     * https://docs.microsoft.com/en-us/windows/win32/api/_wua/
+     * Descriptive fields like title, and description are localized based on
+     * the locale of the VM being updated.
      * 
* - * string summary = 4; - * - * @return The bytes for summary. + * Protobuf type {@code google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage} */ - com.google.protobuf.ByteString getSummaryBytes(); - } - /** - * - * - *
-   * Details related to a Zypper Patch.
-   * 
- * - * Protobuf type {@code google.cloud.osconfig.v1.Inventory.ZypperPatch} - */ - public static final class ZypperPatch extends com.google.protobuf.GeneratedMessageV3 - implements - // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.Inventory.ZypperPatch) - ZypperPatchOrBuilder { - private static final long serialVersionUID = 0L; - // Use ZypperPatch.newBuilder() to construct. - private ZypperPatch(com.google.protobuf.GeneratedMessageV3.Builder builder) { - super(builder); - } + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; + } - private ZypperPatch() { - patchName_ = ""; - category_ = ""; - severity_ = ""; - summary_ = ""; - } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.class, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.Builder.class); + } - @java.lang.Override - @SuppressWarnings({"unused"}) - protected java.lang.Object newInstance(UnusedPrivateParameter unused) { - return new ZypperPatch(); - } + // Construct using com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } - private ZypperPatch( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - this(); - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCategoriesFieldBuilder(); + } } - 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: - { - java.lang.String s = input.readStringRequireUtf8(); - category_ = s; - break; - } - case 26: - { - java.lang.String s = input.readStringRequireUtf8(); + @java.lang.Override + public Builder clear() { + super.clear(); + title_ = ""; - severity_ = s; - break; - } - case 34: - { - java.lang.String s = input.readStringRequireUtf8(); + description_ = ""; + + if (categoriesBuilder_ == null) { + categories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + categoriesBuilder_.clear(); + } + kbArticleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + supportUrl_ = ""; + + moreInfoUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + updateId_ = ""; + + revisionNumber_ = 0; + + if (lastDeploymentChangeTimeBuilder_ == null) { + lastDeploymentChangeTime_ = null; + } else { + lastDeploymentChangeTime_ = null; + lastDeploymentChangeTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_Inventory_WindowsUpdatePackage_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage build() { + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage buildPartial() { + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage result = + new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(this); + int from_bitField0_ = bitField0_; + result.title_ = title_; + result.description_ = description_; + if (categoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + categories_ = java.util.Collections.unmodifiableList(categories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.categories_ = categories_; + } else { + result.categories_ = categoriesBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + kbArticleIds_ = kbArticleIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.kbArticleIds_ = kbArticleIds_; + result.supportUrl_ = supportUrl_; + if (((bitField0_ & 0x00000004) != 0)) { + moreInfoUrls_ = moreInfoUrls_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000004); + } + result.moreInfoUrls_ = moreInfoUrls_; + result.updateId_ = updateId_; + result.revisionNumber_ = revisionNumber_; + if (lastDeploymentChangeTimeBuilder_ == null) { + result.lastDeploymentChangeTime_ = lastDeploymentChangeTime_; + } else { + result.lastDeploymentChangeTime_ = lastDeploymentChangeTimeBuilder_.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); + } - summary_ = s; - break; - } - case 42: - { - java.lang.String s = input.readStringRequireUtf8(); + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } - patchName_ = s; - break; - } - default: - { - if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { - done = true; - } - break; - } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) { + return mergeFrom((com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage other) { + if (other + == com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.getDefaultInstance()) + return this; + if (!other.getTitle().isEmpty()) { + title_ = other.title_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (categoriesBuilder_ == null) { + if (!other.categories_.isEmpty()) { + if (categories_.isEmpty()) { + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCategoriesIsMutable(); + categories_.addAll(other.categories_); + } + onChanged(); + } + } else { + if (!other.categories_.isEmpty()) { + if (categoriesBuilder_.isEmpty()) { + categoriesBuilder_.dispose(); + categoriesBuilder_ = null; + categories_ = other.categories_; + bitField0_ = (bitField0_ & ~0x00000001); + categoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCategoriesFieldBuilder() + : null; + } else { + categoriesBuilder_.addAllMessages(other.categories_); + } } } - } 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(); + if (!other.kbArticleIds_.isEmpty()) { + if (kbArticleIds_.isEmpty()) { + kbArticleIds_ = other.kbArticleIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureKbArticleIdsIsMutable(); + kbArticleIds_.addAll(other.kbArticleIds_); + } + onChanged(); + } + if (!other.getSupportUrl().isEmpty()) { + supportUrl_ = other.supportUrl_; + onChanged(); + } + if (!other.moreInfoUrls_.isEmpty()) { + if (moreInfoUrls_.isEmpty()) { + moreInfoUrls_ = other.moreInfoUrls_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensureMoreInfoUrlsIsMutable(); + moreInfoUrls_.addAll(other.moreInfoUrls_); + } + onChanged(); + } + if (!other.getUpdateId().isEmpty()) { + updateId_ = other.updateId_; + onChanged(); + } + if (other.getRevisionNumber() != 0) { + setRevisionNumber(other.getRevisionNumber()); + } + if (other.hasLastDeploymentChangeTime()) { + mergeLastDeploymentChangeTime(other.getLastDeploymentChangeTime()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; - } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.osconfig.v1.Inventory.ZypperPatch.class, - com.google.cloud.osconfig.v1.Inventory.ZypperPatch.Builder.class); - } + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } - public static final int PATCH_NAME_FIELD_NUMBER = 5; - private volatile java.lang.Object patchName_; - /** - * - * - *
-     * The name of the patch.
-     * 
- * - * string patch_name = 5; - * - * @return The patchName. - */ - @java.lang.Override - public java.lang.String getPatchName() { - java.lang.Object ref = patchName_; - 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(); - patchName_ = s; - return s; + private int bitField0_; + + private java.lang.Object title_ = ""; + /** + * + * + *
+       * The localized title of the update package.
+       * 
+ * + * string title = 1; + * + * @return The title. + */ + public java.lang.String getTitle() { + java.lang.Object ref = title_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + title_ = s; + return s; + } else { + return (java.lang.String) ref; + } } - } - /** - * - * - *
-     * The name of the patch.
-     * 
- * - * string patch_name = 5; - * - * @return The bytes for patchName. - */ - @java.lang.Override - public com.google.protobuf.ByteString getPatchNameBytes() { - java.lang.Object ref = patchName_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - patchName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * + * + *
+       * The localized title of the update package.
+       * 
+ * + * string title = 1; + * + * @return The bytes for title. + */ + public com.google.protobuf.ByteString getTitleBytes() { + java.lang.Object ref = title_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + title_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+       * The localized title of the update package.
+       * 
+ * + * string title = 1; + * + * @param value The title to set. + * @return This builder for chaining. + */ + public Builder setTitle(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + title_ = value; + onChanged(); + return this; } - } + /** + * + * + *
+       * The localized title of the update package.
+       * 
+ * + * string title = 1; + * + * @return This builder for chaining. + */ + public Builder clearTitle() { - public static final int CATEGORY_FIELD_NUMBER = 2; - private volatile java.lang.Object category_; - /** - * - * - *
-     * The category of the patch.
-     * 
- * - * string category = 2; - * - * @return The category. - */ - @java.lang.Override - public java.lang.String getCategory() { - java.lang.Object ref = category_; - 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(); - category_ = s; - return s; + title_ = getDefaultInstance().getTitle(); + onChanged(); + return this; } - } - /** - * - * - *
-     * The category of the patch.
-     * 
- * - * string category = 2; - * - * @return The bytes for category. - */ - @java.lang.Override - public com.google.protobuf.ByteString getCategoryBytes() { - java.lang.Object ref = category_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - category_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * + * + *
+       * The localized title of the update package.
+       * 
+ * + * string title = 1; + * + * @param value The bytes for title to set. + * @return This builder for chaining. + */ + public Builder setTitleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + title_ = value; + onChanged(); + return this; } - } - public static final int SEVERITY_FIELD_NUMBER = 3; - private volatile java.lang.Object severity_; - /** - * - * - *
-     * The severity specified for this patch
-     * 
- * - * string severity = 3; - * - * @return The severity. - */ - @java.lang.Override - public java.lang.String getSeverity() { - java.lang.Object ref = severity_; - 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(); - severity_ = s; - return s; + private java.lang.Object description_ = ""; + /** + * + * + *
+       * The localized description of the update package.
+       * 
+ * + * string description = 2; + * + * @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; + } } - } - /** - * - * - *
-     * The severity specified for this patch
-     * 
- * - * string severity = 3; - * - * @return The bytes for severity. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSeverityBytes() { - java.lang.Object ref = severity_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - severity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * + * + *
+       * The localized description of the update package.
+       * 
+ * + * string description = 2; + * + * @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; + } } - } + /** + * + * + *
+       * The localized description of the update package.
+       * 
+ * + * string description = 2; + * + * @param value The description to set. + * @return This builder for chaining. + */ + public Builder setDescription(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } - public static final int SUMMARY_FIELD_NUMBER = 4; - private volatile java.lang.Object summary_; - /** - * - * - *
-     * Any summary information provided about this patch.
-     * 
- * - * string summary = 4; - * - * @return The summary. - */ - @java.lang.Override - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - 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(); - summary_ = s; - return s; + description_ = value; + onChanged(); + return this; } - } - /** - * - * - *
-     * Any summary information provided about this patch.
-     * 
- * - * string summary = 4; - * - * @return The bytes for summary. - */ - @java.lang.Override - public com.google.protobuf.ByteString getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof java.lang.String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - summary_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + /** + * + * + *
+       * The localized description of the update package.
+       * 
+ * + * string description = 2; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; } - } + /** + * + * + *
+       * The localized description of the update package.
+       * 
+ * + * string description = 2; + * + * @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); - private byte memoizedIsInitialized = -1; + description_ = value; + onChanged(); + return this; + } - @java.lang.Override - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; + private java.util.List< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> + categories_ = java.util.Collections.emptyList(); - memoizedIsInitialized = 1; - return true; - } + private void ensureCategoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + categories_ = + new java.util.ArrayList< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory>(categories_); + bitField0_ |= 0x00000001; + } + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (!getCategoryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 2, category_); + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder> + categoriesBuilder_; + + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public java.util.List< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory> + getCategoriesList() { + if (categoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(categories_); + } else { + return categoriesBuilder_.getMessageList(); + } } - if (!getSeverityBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 3, severity_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public int getCategoriesCount() { + if (categoriesBuilder_ == null) { + return categories_.size(); + } else { + return categoriesBuilder_.getCount(); + } } - if (!getSummaryBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 4, summary_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + getCategories(int index) { + if (categoriesBuilder_ == null) { + return categories_.get(index); + } else { + return categoriesBuilder_.getMessage(index); + } } - if (!getPatchNameBytes().isEmpty()) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 5, patchName_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder setCategories( + int index, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory value) { + if (categoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.set(index, value); + onChanged(); + } else { + categoriesBuilder_.setMessage(index, value); + } + return this; } - unknownFields.writeTo(output); - } - - @java.lang.Override - public int getSerializedSize() { - int size = memoizedSize; - if (size != -1) return size; - - size = 0; - if (!getCategoryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, category_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder setCategories( + int index, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.Builder + builderForValue) { + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.set(index, builderForValue.build()); + onChanged(); + } else { + categoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; } - if (!getSeverityBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, severity_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder addCategories( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory value) { + if (categoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(value); + onChanged(); + } else { + categoriesBuilder_.addMessage(value); + } + return this; } - if (!getSummaryBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, summary_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder addCategories( + int index, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory value) { + if (categoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCategoriesIsMutable(); + categories_.add(index, value); + onChanged(); + } else { + categoriesBuilder_.addMessage(index, value); + } + return this; } - if (!getPatchNameBytes().isEmpty()) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, patchName_); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder addCategories( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.Builder + builderForValue) { + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.add(builderForValue.build()); + onChanged(); + } else { + categoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder addCategories( + int index, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory.Builder + builderForValue) { + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.add(index, builderForValue.build()); + onChanged(); + } else { + categoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; } - size += unknownFields.getSerializedSize(); - memoizedSize = size; - return size; - } - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - if (obj == this) { - return true; + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder addAllCategories( + java.lang.Iterable< + ? extends + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategory> + values) { + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, categories_); + onChanged(); + } else { + categoriesBuilder_.addAllMessages(values); + } + return this; } - if (!(obj instanceof com.google.cloud.osconfig.v1.Inventory.ZypperPatch)) { - return super.equals(obj); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder clearCategories() { + if (categoriesBuilder_ == null) { + categories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + categoriesBuilder_.clear(); + } + return this; } - com.google.cloud.osconfig.v1.Inventory.ZypperPatch other = - (com.google.cloud.osconfig.v1.Inventory.ZypperPatch) obj; - - if (!getPatchName().equals(other.getPatchName())) return false; - if (!getCategory().equals(other.getCategory())) return false; - if (!getSeverity().equals(other.getSeverity())) return false; - if (!getSummary().equals(other.getSummary())) return false; - if (!unknownFields.equals(other.unknownFields)) return false; - return true; - } - - @java.lang.Override - public int hashCode() { - if (memoizedHashCode != 0) { - return memoizedHashCode; + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public Builder removeCategories(int index) { + if (categoriesBuilder_ == null) { + ensureCategoriesIsMutable(); + categories_.remove(index); + onChanged(); + } else { + categoriesBuilder_.remove(index); + } + return this; } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + PATCH_NAME_FIELD_NUMBER; - hash = (53 * hash) + getPatchName().hashCode(); - hash = (37 * hash) + CATEGORY_FIELD_NUMBER; - hash = (53 * hash) + getCategory().hashCode(); - hash = (37 * hash) + SEVERITY_FIELD_NUMBER; - hash = (53 * hash) + getSeverity().hashCode(); - hash = (37 * hash) + SUMMARY_FIELD_NUMBER; - hash = (53 * hash) + getSummary().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); - memoizedHashCode = hash; - return hash; - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( - java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch parseFrom( - com.google.protobuf.ByteString data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch parseFrom(byte[] data) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( - byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws com.google.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch parseFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch parseDelimitedFrom( - java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch parseFrom( - com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); - } - - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch 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.osconfig.v1.Inventory.ZypperPatch 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; - } - /** - * - * - *
-     * Details related to a Zypper Patch.
-     * 
- * - * Protobuf type {@code google.cloud.osconfig.v1.Inventory.ZypperPatch} - */ - public static final class Builder - extends com.google.protobuf.GeneratedMessageV3.Builder - implements - // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.Inventory.ZypperPatch) - com.google.cloud.osconfig.v1.Inventory.ZypperPatchOrBuilder { - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder + getCategoriesBuilder(int index) { + return getCategoriesFieldBuilder().getBuilder(index); } - - @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable - internalGetFieldAccessorTable() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_fieldAccessorTable - .ensureFieldAccessorsInitialized( - com.google.cloud.osconfig.v1.Inventory.ZypperPatch.class, - com.google.cloud.osconfig.v1.Inventory.ZypperPatch.Builder.class); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder + getCategoriesOrBuilder(int index) { + if (categoriesBuilder_ == null) { + return categories_.get(index); + } else { + return categoriesBuilder_.getMessageOrBuilder(index); + } } - - // Construct using com.google.cloud.osconfig.v1.Inventory.ZypperPatch.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public java.util.List< + ? extends + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder> + getCategoriesOrBuilderList() { + if (categoriesBuilder_ != null) { + return categoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(categories_); + } } - - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { - super(parent); - maybeForceBuilderInitialization(); + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder + addCategoriesBuilder() { + return getCategoriesFieldBuilder() + .addBuilder( + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .getDefaultInstance()); } - - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder + addCategoriesBuilder(int index) { + return getCategoriesFieldBuilder() + .addBuilder( + index, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .getDefaultInstance()); + } + /** + * + * + *
+       * The categories that are associated with this update package.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory categories = 3; + * + */ + public java.util.List< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder> + getCategoriesBuilderList() { + return getCategoriesFieldBuilder().getBuilderList(); } - @java.lang.Override - public Builder clear() { - super.clear(); - patchName_ = ""; - - category_ = ""; - - severity_ = ""; + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder> + getCategoriesFieldBuilder() { + if (categoriesBuilder_ == null) { + categoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage.WindowsUpdateCategory + .Builder, + com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + .WindowsUpdateCategoryOrBuilder>( + categories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + categories_ = null; + } + return categoriesBuilder_; + } - summary_ = ""; + private com.google.protobuf.LazyStringList kbArticleIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureKbArticleIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + kbArticleIds_ = new com.google.protobuf.LazyStringArrayList(kbArticleIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @return A list containing the kbArticleIds. + */ + public com.google.protobuf.ProtocolStringList getKbArticleIdsList() { + return kbArticleIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @return The count of kbArticleIds. + */ + public int getKbArticleIdsCount() { + return kbArticleIds_.size(); + } + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index of the element to return. + * @return The kbArticleIds at the given index. + */ + public java.lang.String getKbArticleIds(int index) { + return kbArticleIds_.get(index); + } + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index of the value to return. + * @return The bytes of the kbArticleIds at the given index. + */ + public com.google.protobuf.ByteString getKbArticleIdsBytes(int index) { + return kbArticleIds_.getByteString(index); + } + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @param index The index to set the value at. + * @param value The kbArticleIds to set. + * @return This builder for chaining. + */ + public Builder setKbArticleIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKbArticleIdsIsMutable(); + kbArticleIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @param value The kbArticleIds to add. + * @return This builder for chaining. + */ + public Builder addKbArticleIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKbArticleIdsIsMutable(); + kbArticleIds_.add(value); + onChanged(); return this; } - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - return com.google.cloud.osconfig.v1.Inventories - .internal_static_google_cloud_osconfig_v1_Inventory_ZypperPatch_descriptor; + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @param values The kbArticleIds to add. + * @return This builder for chaining. + */ + public Builder addAllKbArticleIds(java.lang.Iterable values) { + ensureKbArticleIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, kbArticleIds_); + onChanged(); + return this; } - - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.ZypperPatch getDefaultInstanceForType() { - return com.google.cloud.osconfig.v1.Inventory.ZypperPatch.getDefaultInstance(); + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @return This builder for chaining. + */ + public Builder clearKbArticleIds() { + kbArticleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; } - - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.ZypperPatch build() { - com.google.cloud.osconfig.v1.Inventory.ZypperPatch result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); + /** + * + * + *
+       * A collection of Microsoft Knowledge Base article IDs that are associated
+       * with the update package.
+       * 
+ * + * repeated string kb_article_ids = 4; + * + * @param value The bytes of the kbArticleIds to add. + * @return This builder for chaining. + */ + public Builder addKbArticleIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } - return result; - } - - @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.ZypperPatch buildPartial() { - com.google.cloud.osconfig.v1.Inventory.ZypperPatch result = - new com.google.cloud.osconfig.v1.Inventory.ZypperPatch(this); - result.patchName_ = patchName_; - result.category_ = category_; - result.severity_ = severity_; - result.summary_ = summary_; - 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); + checkByteStringIsUtf8(value); + ensureKbArticleIdsIsMutable(); + kbArticleIds_.add(value); + onChanged(); + return this; } - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - if (other instanceof com.google.cloud.osconfig.v1.Inventory.ZypperPatch) { - return mergeFrom((com.google.cloud.osconfig.v1.Inventory.ZypperPatch) other); + private java.lang.Object supportUrl_ = ""; + /** + * + * + *
+       * A hyperlink to the language-specific support information for the update.
+       * 
+ * + * string support_url = 11; + * + * @return The supportUrl. + */ + public java.lang.String getSupportUrl() { + java.lang.Object ref = supportUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + supportUrl_ = s; + return s; } else { - super.mergeFrom(other); - return this; + return (java.lang.String) ref; } } - - public Builder mergeFrom(com.google.cloud.osconfig.v1.Inventory.ZypperPatch other) { - if (other == com.google.cloud.osconfig.v1.Inventory.ZypperPatch.getDefaultInstance()) - return this; - if (!other.getPatchName().isEmpty()) { - patchName_ = other.patchName_; - onChanged(); - } - if (!other.getCategory().isEmpty()) { - category_ = other.category_; - onChanged(); - } - if (!other.getSeverity().isEmpty()) { - severity_ = other.severity_; - onChanged(); + /** + * + * + *
+       * A hyperlink to the language-specific support information for the update.
+       * 
+ * + * string support_url = 11; + * + * @return The bytes for supportUrl. + */ + public com.google.protobuf.ByteString getSupportUrlBytes() { + java.lang.Object ref = supportUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + supportUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } - if (!other.getSummary().isEmpty()) { - summary_ = other.summary_; - onChanged(); + } + /** + * + * + *
+       * A hyperlink to the language-specific support information for the update.
+       * 
+ * + * string support_url = 11; + * + * @param value The supportUrl to set. + * @return This builder for chaining. + */ + public Builder setSupportUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } - this.mergeUnknownFields(other.unknownFields); + + supportUrl_ = value; onChanged(); return this; } + /** + * + * + *
+       * A hyperlink to the language-specific support information for the update.
+       * 
+ * + * string support_url = 11; + * + * @return This builder for chaining. + */ + public Builder clearSupportUrl() { - @java.lang.Override - public final boolean isInitialized() { - return true; + supportUrl_ = getDefaultInstance().getSupportUrl(); + onChanged(); + return this; } - - @java.lang.Override - public Builder mergeFrom( - com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - com.google.cloud.osconfig.v1.Inventory.ZypperPatch parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - parsedMessage = - (com.google.cloud.osconfig.v1.Inventory.ZypperPatch) e.getUnfinishedMessage(); - throw e.unwrapIOException(); - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } + /** + * + * + *
+       * A hyperlink to the language-specific support information for the update.
+       * 
+ * + * string support_url = 11; + * + * @param value The bytes for supportUrl to set. + * @return This builder for chaining. + */ + public Builder setSupportUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); } + checkByteStringIsUtf8(value); + + supportUrl_ = value; + onChanged(); return this; } - private java.lang.Object patchName_ = ""; + private com.google.protobuf.LazyStringList moreInfoUrls_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureMoreInfoUrlsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + moreInfoUrls_ = new com.google.protobuf.LazyStringArrayList(moreInfoUrls_); + bitField0_ |= 0x00000004; + } + } /** * * *
-       * The name of the patch.
+       * A collection of URLs that provide more information about the update
+       * package.
        * 
* - * string patch_name = 5; + * repeated string more_info_urls = 5; * - * @return The patchName. + * @return A list containing the moreInfoUrls. */ - public java.lang.String getPatchName() { - java.lang.Object ref = patchName_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - patchName_ = s; - return s; - } else { - return (java.lang.String) ref; - } + public com.google.protobuf.ProtocolStringList getMoreInfoUrlsList() { + return moreInfoUrls_.getUnmodifiableView(); } /** * * *
-       * The name of the patch.
+       * A collection of URLs that provide more information about the update
+       * package.
        * 
* - * string patch_name = 5; + * repeated string more_info_urls = 5; * - * @return The bytes for patchName. + * @return The count of moreInfoUrls. */ - public com.google.protobuf.ByteString getPatchNameBytes() { - java.lang.Object ref = patchName_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - patchName_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; + public int getMoreInfoUrlsCount() { + return moreInfoUrls_.size(); + } + /** + * + * + *
+       * A collection of URLs that provide more information about the update
+       * package.
+       * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index of the element to return. + * @return The moreInfoUrls at the given index. + */ + public java.lang.String getMoreInfoUrls(int index) { + return moreInfoUrls_.get(index); + } + /** + * + * + *
+       * A collection of URLs that provide more information about the update
+       * package.
+       * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index of the value to return. + * @return The bytes of the moreInfoUrls at the given index. + */ + public com.google.protobuf.ByteString getMoreInfoUrlsBytes(int index) { + return moreInfoUrls_.getByteString(index); + } + /** + * + * + *
+       * A collection of URLs that provide more information about the update
+       * package.
+       * 
+ * + * repeated string more_info_urls = 5; + * + * @param index The index to set the value at. + * @param value The moreInfoUrls to set. + * @return This builder for chaining. + */ + public Builder setMoreInfoUrls(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); } + ensureMoreInfoUrlsIsMutable(); + moreInfoUrls_.set(index, value); + onChanged(); + return this; } /** * * *
-       * The name of the patch.
+       * A collection of URLs that provide more information about the update
+       * package.
        * 
* - * string patch_name = 5; + * repeated string more_info_urls = 5; * - * @param value The patchName to set. + * @param value The moreInfoUrls to add. * @return This builder for chaining. */ - public Builder setPatchName(java.lang.String value) { + public Builder addMoreInfoUrls(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - - patchName_ = value; + ensureMoreInfoUrlsIsMutable(); + moreInfoUrls_.add(value); onChanged(); return this; } @@ -14807,16 +14782,18 @@ public Builder setPatchName(java.lang.String value) { * * *
-       * The name of the patch.
+       * A collection of URLs that provide more information about the update
+       * package.
        * 
* - * string patch_name = 5; + * repeated string more_info_urls = 5; * + * @param values The moreInfoUrls to add. * @return This builder for chaining. */ - public Builder clearPatchName() { - - patchName_ = getDefaultInstance().getPatchName(); + public Builder addAllMoreInfoUrls(java.lang.Iterable values) { + ensureMoreInfoUrlsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, moreInfoUrls_); onChanged(); return this; } @@ -14824,43 +14801,63 @@ public Builder clearPatchName() { * * *
-       * The name of the patch.
+       * A collection of URLs that provide more information about the update
+       * package.
        * 
* - * string patch_name = 5; + * repeated string more_info_urls = 5; * - * @param value The bytes for patchName to set. * @return This builder for chaining. */ - public Builder setPatchNameBytes(com.google.protobuf.ByteString value) { + public Builder clearMoreInfoUrls() { + moreInfoUrls_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+       * A collection of URLs that provide more information about the update
+       * package.
+       * 
+ * + * repeated string more_info_urls = 5; + * + * @param value The bytes of the moreInfoUrls to add. + * @return This builder for chaining. + */ + public Builder addMoreInfoUrlsBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - - patchName_ = value; + ensureMoreInfoUrlsIsMutable(); + moreInfoUrls_.add(value); onChanged(); return this; } - private java.lang.Object category_ = ""; + private java.lang.Object updateId_ = ""; /** * * *
-       * The category of the patch.
+       * Gets the identifier of an update package.  Stays the same across
+       * revisions.
        * 
* - * string category = 2; + * string update_id = 6; * - * @return The category. + * @return The updateId. */ - public java.lang.String getCategory() { - java.lang.Object ref = category_; + public java.lang.String getUpdateId() { + java.lang.Object ref = updateId_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); - category_ = s; + updateId_ = s; return s; } else { return (java.lang.String) ref; @@ -14870,19 +14867,20 @@ public java.lang.String getCategory() { * * *
-       * The category of the patch.
+       * Gets the identifier of an update package.  Stays the same across
+       * revisions.
        * 
* - * string category = 2; + * string update_id = 6; * - * @return The bytes for category. + * @return The bytes for updateId. */ - public com.google.protobuf.ByteString getCategoryBytes() { - java.lang.Object ref = category_; + public com.google.protobuf.ByteString getUpdateIdBytes() { + java.lang.Object ref = updateId_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - category_ = b; + updateId_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; @@ -14892,20 +14890,21 @@ public com.google.protobuf.ByteString getCategoryBytes() { * * *
-       * The category of the patch.
+       * Gets the identifier of an update package.  Stays the same across
+       * revisions.
        * 
* - * string category = 2; + * string update_id = 6; * - * @param value The category to set. + * @param value The updateId to set. * @return This builder for chaining. */ - public Builder setCategory(java.lang.String value) { + public Builder setUpdateId(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - category_ = value; + updateId_ = value; onChanged(); return this; } @@ -14913,16 +14912,17 @@ public Builder setCategory(java.lang.String value) { * * *
-       * The category of the patch.
+       * Gets the identifier of an update package.  Stays the same across
+       * revisions.
        * 
* - * string category = 2; + * string update_id = 6; * * @return This builder for chaining. */ - public Builder clearCategory() { + public Builder clearUpdateId() { - category_ = getDefaultInstance().getCategory(); + updateId_ = getDefaultInstance().getUpdateId(); onChanged(); return this; } @@ -14930,88 +14930,57 @@ public Builder clearCategory() { * * *
-       * The category of the patch.
+       * Gets the identifier of an update package.  Stays the same across
+       * revisions.
        * 
* - * string category = 2; + * string update_id = 6; * - * @param value The bytes for category to set. + * @param value The bytes for updateId to set. * @return This builder for chaining. */ - public Builder setCategoryBytes(com.google.protobuf.ByteString value) { + public Builder setUpdateIdBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); - category_ = value; + updateId_ = value; onChanged(); return this; } - private java.lang.Object severity_ = ""; - /** - * - * - *
-       * The severity specified for this patch
-       * 
- * - * string severity = 3; - * - * @return The severity. - */ - public java.lang.String getSeverity() { - java.lang.Object ref = severity_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - severity_ = s; - return s; - } else { - return (java.lang.String) ref; - } - } + private int revisionNumber_; /** * * *
-       * The severity specified for this patch
+       * The revision number of this update package.
        * 
* - * string severity = 3; + * int32 revision_number = 7; * - * @return The bytes for severity. - */ - public com.google.protobuf.ByteString getSeverityBytes() { - java.lang.Object ref = severity_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - severity_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + * @return The revisionNumber. + */ + @java.lang.Override + public int getRevisionNumber() { + return revisionNumber_; } /** * * *
-       * The severity specified for this patch
+       * The revision number of this update package.
        * 
* - * string severity = 3; + * int32 revision_number = 7; * - * @param value The severity to set. + * @param value The revisionNumber to set. * @return This builder for chaining. */ - public Builder setSeverity(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } + public Builder setRevisionNumber(int value) { - severity_ = value; + revisionNumber_ = value; onChanged(); return this; } @@ -15019,146 +14988,204 @@ public Builder setSeverity(java.lang.String value) { * * *
-       * The severity specified for this patch
+       * The revision number of this update package.
        * 
* - * string severity = 3; + * int32 revision_number = 7; * * @return This builder for chaining. */ - public Builder clearSeverity() { + public Builder clearRevisionNumber() { - severity_ = getDefaultInstance().getSeverity(); + revisionNumber_ = 0; onChanged(); return this; } + + private com.google.protobuf.Timestamp lastDeploymentChangeTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + lastDeploymentChangeTimeBuilder_; /** * * *
-       * The severity specified for this patch
+       * The last published date of the update, in (UTC) date and time.
        * 
* - * string severity = 3; + * .google.protobuf.Timestamp last_deployment_change_time = 10; * - * @param value The bytes for severity to set. - * @return This builder for chaining. + * @return Whether the lastDeploymentChangeTime field is set. */ - public Builder setSeverityBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - - severity_ = value; - onChanged(); - return this; + public boolean hasLastDeploymentChangeTime() { + return lastDeploymentChangeTimeBuilder_ != null || lastDeploymentChangeTime_ != null; } - - private java.lang.Object summary_ = ""; /** * * *
-       * Any summary information provided about this patch.
+       * The last published date of the update, in (UTC) date and time.
        * 
* - * string summary = 4; + * .google.protobuf.Timestamp last_deployment_change_time = 10; * - * @return The summary. + * @return The lastDeploymentChangeTime. */ - public java.lang.String getSummary() { - java.lang.Object ref = summary_; - if (!(ref instanceof java.lang.String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - summary_ = s; - return s; + public com.google.protobuf.Timestamp getLastDeploymentChangeTime() { + if (lastDeploymentChangeTimeBuilder_ == null) { + return lastDeploymentChangeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastDeploymentChangeTime_; } else { - return (java.lang.String) ref; + return lastDeploymentChangeTimeBuilder_.getMessage(); } } /** * * *
-       * Any summary information provided about this patch.
+       * The last published date of the update, in (UTC) date and time.
        * 
* - * string summary = 4; - * - * @return The bytes for summary. + * .google.protobuf.Timestamp last_deployment_change_time = 10; */ - public com.google.protobuf.ByteString getSummaryBytes() { - java.lang.Object ref = summary_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = - com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); - summary_ = b; - return b; + public Builder setLastDeploymentChangeTime(com.google.protobuf.Timestamp value) { + if (lastDeploymentChangeTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + lastDeploymentChangeTime_ = value; + onChanged(); } else { - return (com.google.protobuf.ByteString) ref; + lastDeploymentChangeTimeBuilder_.setMessage(value); } + + return this; } /** * * *
-       * Any summary information provided about this patch.
+       * The last published date of the update, in (UTC) date and time.
        * 
* - * string summary = 4; + * .google.protobuf.Timestamp last_deployment_change_time = 10; + */ + public Builder setLastDeploymentChangeTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (lastDeploymentChangeTimeBuilder_ == null) { + lastDeploymentChangeTime_ = builderForValue.build(); + onChanged(); + } else { + lastDeploymentChangeTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** * - * @param value The summary to set. - * @return This builder for chaining. + * + *
+       * The last published date of the update, in (UTC) date and time.
+       * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; */ - public Builder setSummary(java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + public Builder mergeLastDeploymentChangeTime(com.google.protobuf.Timestamp value) { + if (lastDeploymentChangeTimeBuilder_ == null) { + if (lastDeploymentChangeTime_ != null) { + lastDeploymentChangeTime_ = + com.google.protobuf.Timestamp.newBuilder(lastDeploymentChangeTime_) + .mergeFrom(value) + .buildPartial(); + } else { + lastDeploymentChangeTime_ = value; + } + onChanged(); + } else { + lastDeploymentChangeTimeBuilder_.mergeFrom(value); } - summary_ = value; - onChanged(); return this; } /** * * *
-       * Any summary information provided about this patch.
+       * The last published date of the update, in (UTC) date and time.
        * 
* - * string summary = 4; + * .google.protobuf.Timestamp last_deployment_change_time = 10; + */ + public Builder clearLastDeploymentChangeTime() { + if (lastDeploymentChangeTimeBuilder_ == null) { + lastDeploymentChangeTime_ = null; + onChanged(); + } else { + lastDeploymentChangeTime_ = null; + lastDeploymentChangeTimeBuilder_ = null; + } + + return this; + } + /** * - * @return This builder for chaining. + * + *
+       * The last published date of the update, in (UTC) date and time.
+       * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; */ - public Builder clearSummary() { + public com.google.protobuf.Timestamp.Builder getLastDeploymentChangeTimeBuilder() { - summary_ = getDefaultInstance().getSummary(); onChanged(); - return this; + return getLastDeploymentChangeTimeFieldBuilder().getBuilder(); } /** * * *
-       * Any summary information provided about this patch.
+       * The last published date of the update, in (UTC) date and time.
        * 
* - * string summary = 4; + * .google.protobuf.Timestamp last_deployment_change_time = 10; + */ + public com.google.protobuf.TimestampOrBuilder getLastDeploymentChangeTimeOrBuilder() { + if (lastDeploymentChangeTimeBuilder_ != null) { + return lastDeploymentChangeTimeBuilder_.getMessageOrBuilder(); + } else { + return lastDeploymentChangeTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : lastDeploymentChangeTime_; + } + } + /** * - * @param value The bytes for summary to set. - * @return This builder for chaining. + * + *
+       * The last published date of the update, in (UTC) date and time.
+       * 
+ * + * .google.protobuf.Timestamp last_deployment_change_time = 10; */ - public Builder setSummaryBytes(com.google.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getLastDeploymentChangeTimeFieldBuilder() { + if (lastDeploymentChangeTimeBuilder_ == null) { + lastDeploymentChangeTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getLastDeploymentChangeTime(), getParentForChildren(), isClean()); + lastDeploymentChangeTime_ = null; } - checkByteStringIsUtf8(value); - - summary_ = value; - onChanged(); - return this; + return lastDeploymentChangeTimeBuilder_; } @java.lang.Override @@ -15173,42 +15200,43 @@ public final Builder mergeUnknownFields( return super.mergeUnknownFields(unknownFields); } - // @@protoc_insertion_point(builder_scope:google.cloud.osconfig.v1.Inventory.ZypperPatch) + // @@protoc_insertion_point(builder_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) } - // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.Inventory.ZypperPatch) - private static final com.google.cloud.osconfig.v1.Inventory.ZypperPatch DEFAULT_INSTANCE; + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage) + private static final com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage + DEFAULT_INSTANCE; static { - DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.Inventory.ZypperPatch(); + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage(); } - public static com.google.cloud.osconfig.v1.Inventory.ZypperPatch getDefaultInstance() { + public static com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage getDefaultInstance() { return DEFAULT_INSTANCE; } - private static final com.google.protobuf.Parser PARSER = - new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { @java.lang.Override - public ZypperPatch parsePartialFrom( + public WindowsUpdatePackage parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new ZypperPatch(input, extensionRegistry); + return new WindowsUpdatePackage(input, extensionRegistry); } }; - public static com.google.protobuf.Parser parser() { + public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + public com.google.protobuf.Parser getParserForType() { return PARSER; } @java.lang.Override - public com.google.cloud.osconfig.v1.Inventory.ZypperPatch getDefaultInstanceForType() { + public com.google.cloud.osconfig.v1.Inventory.WindowsUpdatePackage getDefaultInstanceForType() { return DEFAULT_INSTANCE; } } @@ -18218,6 +18246,59 @@ public com.google.cloud.osconfig.v1.Inventory.WindowsApplication getDefaultInsta } } + public static final int NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The `Inventory` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `Inventory` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 OS_INFO_FIELD_NUMBER = 1; private com.google.cloud.osconfig.v1.Inventory.OsInfo osInfo_; /** @@ -18387,6 +18468,55 @@ public com.google.cloud.osconfig.v1.Inventory.Item getItemsOrThrow(java.lang.Str return map.get(key); } + public static final int UPDATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Timestamp of the last reported inventory for the VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. Timestamp of the last reported inventory for the VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Timestamp of the last reported inventory for the VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -18406,6 +18536,12 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io } com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( output, internalGetItems(), ItemsDefaultEntryHolder.defaultEntry, 2); + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_); + } + if (updateTime_ != null) { + output.writeMessage(4, getUpdateTime()); + } unknownFields.writeTo(output); } @@ -18429,6 +18565,12 @@ public int getSerializedSize() { .build(); size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, items__); } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getUpdateTime()); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -18444,11 +18586,16 @@ public boolean equals(final java.lang.Object obj) { } com.google.cloud.osconfig.v1.Inventory other = (com.google.cloud.osconfig.v1.Inventory) obj; + if (!getName().equals(other.getName())) return false; if (hasOsInfo() != other.hasOsInfo()) return false; if (hasOsInfo()) { if (!getOsInfo().equals(other.getOsInfo())) return false; } if (!internalGetItems().equals(other.internalGetItems())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -18460,6 +18607,8 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); if (hasOsInfo()) { hash = (37 * hash) + OS_INFO_FIELD_NUMBER; hash = (53 * hash) + getOsInfo().hashCode(); @@ -18468,6 +18617,10 @@ public int hashCode() { hash = (37 * hash) + ITEMS_FIELD_NUMBER; hash = (53 * hash) + internalGetItems().hashCode(); } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -18572,7 +18725,11 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * *
-   * The inventory details of a VM.
+   * This API resource represents the available inventory data for a
+   * Compute Engine virtual machine (VM) instance at a given point in time.
+   * You can use this API resource to determine the inventory data of your VM.
+   * For more information, see [Information provided by OS inventory
+   * management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected).
    * 
* * Protobuf type {@code google.cloud.osconfig.v1.Inventory} @@ -18633,6 +18790,8 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + name_ = ""; + if (osInfoBuilder_ == null) { osInfo_ = null; } else { @@ -18640,6 +18799,12 @@ public Builder clear() { osInfoBuilder_ = null; } internalGetMutableItems().clear(); + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } return this; } @@ -18668,6 +18833,7 @@ public com.google.cloud.osconfig.v1.Inventory buildPartial() { com.google.cloud.osconfig.v1.Inventory result = new com.google.cloud.osconfig.v1.Inventory(this); int from_bitField0_ = bitField0_; + result.name_ = name_; if (osInfoBuilder_ == null) { result.osInfo_ = osInfo_; } else { @@ -18675,6 +18841,11 @@ public com.google.cloud.osconfig.v1.Inventory buildPartial() { } result.items_ = internalGetItems(); result.items_.makeImmutable(); + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } onBuilt(); return result; } @@ -18724,10 +18895,17 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(com.google.cloud.osconfig.v1.Inventory other) { if (other == com.google.cloud.osconfig.v1.Inventory.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } if (other.hasOsInfo()) { mergeOsInfo(other.getOsInfo()); } internalGetMutableItems().mergeFrom(other.internalGetItems()); + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -18759,6 +18937,122 @@ public Builder mergeFrom( private int bitField0_; + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The `Inventory` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `Inventory` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `Inventory` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `Inventory` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The `Inventory` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+     * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 com.google.cloud.osconfig.v1.Inventory.OsInfo osInfo_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.osconfig.v1.Inventory.OsInfo, @@ -19134,6 +19428,207 @@ public Builder putAllItems( return this; } + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Timestamp of the last reported inventory for the VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryName.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryName.java new file mode 100644 index 00000000..3d5fc791 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2021 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.osconfig.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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class InventoryName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}/inventory"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + + @Deprecated + protected InventoryName() { + project = null; + location = null; + instance = null; + } + + private InventoryName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InventoryName of(String project, String location, String instance) { + return newBuilder().setProject(project).setLocation(location).setInstance(instance).build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InventoryName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE.validatedMatch( + formattedString, "InventoryName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + 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 (InventoryName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE.instantiate( + "project", project, "location", location, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + InventoryName that = ((InventoryName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}/inventory. */ + public static class Builder { + private String project; + private String location; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InventoryName inventoryName) { + this.project = inventoryName.project; + this.location = inventoryName.location; + this.instance = inventoryName.instance; + } + + public InventoryName build() { + return new InventoryName(this); + } + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryOrBuilder.java index 00848cfd..0f79173c 100644 --- a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryOrBuilder.java +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryOrBuilder.java @@ -23,6 +23,35 @@ public interface InventoryOrBuilder // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.Inventory) com.google.protobuf.MessageOrBuilder { + /** + * + * + *
+   * Output only. The `Inventory` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The `Inventory` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory`
+   * 
+ * + * string name = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + /** * * @@ -127,4 +156,42 @@ com.google.cloud.osconfig.v1.Inventory.Item getItemsOrDefault( * map<string, .google.cloud.osconfig.v1.Inventory.Item> items = 2; */ com.google.cloud.osconfig.v1.Inventory.Item getItemsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Timestamp of the last reported inventory for the VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp of the last reported inventory for the VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Timestamp of the last reported inventory for the VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); } diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryView.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryView.java new file mode 100644 index 00000000..05db91fb --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/InventoryView.java @@ -0,0 +1,178 @@ +/* + * 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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * The view for inventory objects.
+ * 
+ * + * Protobuf enum {@code google.cloud.osconfig.v1.InventoryView} + */ +public enum InventoryView implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * The default value.
+   * The API defaults to the BASIC view.
+   * 
+ * + * INVENTORY_VIEW_UNSPECIFIED = 0; + */ + INVENTORY_VIEW_UNSPECIFIED(0), + /** + * + * + *
+   * Returns the basic inventory information that includes `os_info`.
+   * 
+ * + * BASIC = 1; + */ + BASIC(1), + /** + * + * + *
+   * Returns all fields.
+   * 
+ * + * FULL = 2; + */ + FULL(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * The default value.
+   * The API defaults to the BASIC view.
+   * 
+ * + * INVENTORY_VIEW_UNSPECIFIED = 0; + */ + public static final int INVENTORY_VIEW_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Returns the basic inventory information that includes `os_info`.
+   * 
+ * + * BASIC = 1; + */ + public static final int BASIC_VALUE = 1; + /** + * + * + *
+   * Returns all fields.
+   * 
+ * + * FULL = 2; + */ + public static final int FULL_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 InventoryView 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 InventoryView forNumber(int value) { + switch (value) { + case 0: + return INVENTORY_VIEW_UNSPECIFIED; + case 1: + return BASIC; + case 2: + return FULL; + 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 InventoryView findValueByNumber(int number) { + return InventoryView.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.osconfig.v1.Inventories.getDescriptor().getEnumTypes().get(0); + } + + private static final InventoryView[] VALUES = values(); + + public static InventoryView 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 InventoryView(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.osconfig.v1.InventoryView) +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequest.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequest.java new file mode 100644 index 00000000..fdaa5a8e --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequest.java @@ -0,0 +1,1294 @@ +/* + * 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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * A request message for listing inventory data for all VMs in the specified
+ * location.
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListInventoriesRequest} + */ +public final class ListInventoriesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.ListInventoriesRequest) + ListInventoriesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInventoriesRequest.newBuilder() to construct. + private ListInventoriesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInventoriesRequest() { + parent_ = ""; + view_ = 0; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInventoriesRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListInventoriesRequest( + 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 16: + { + int rawValue = input.readEnum(); + + view_ = rawValue; + break; + } + case 24: + { + pageSize_ = input.readInt32(); + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = 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.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListInventoriesRequest.class, + com.google.cloud.osconfig.v1.ListInventoriesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 VIEW_FIELD_NUMBER = 2; + private int view_; + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.InventoryView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.InventoryView result = + com.google.cloud.osconfig.v1.InventoryView.valueOf(view_); + return result == null ? com.google.cloud.osconfig.v1.InventoryView.UNRECOGNIZED : result; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 3; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 4; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to
+   * `ListInventories` that indicates where this listing
+   * should continue from.
+   * 
+ * + * string page_token = 4; + * + * @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 pagination token returned from a previous call to
+   * `ListInventories` that indicates where this listing
+   * should continue from.
+   * 
+ * + * string page_token = 4; + * + * @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 FILTER_FIELD_NUMBER = 5; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `Inventory` API resource to be included in the response.
+   * 
+ * + * string filter = 5; + * + * @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; + } + } + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `Inventory` API resource to be included in the response.
+   * 
+ * + * string filter = 5; + * + * @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; + } + } + + 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 (view_ + != com.google.cloud.osconfig.v1.InventoryView.INVENTORY_VIEW_UNSPECIFIED.getNumber()) { + output.writeEnum(2, view_); + } + if (pageSize_ != 0) { + output.writeInt32(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, filter_); + } + 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 (view_ + != com.google.cloud.osconfig.v1.InventoryView.INVENTORY_VIEW_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, view_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, filter_); + } + 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.osconfig.v1.ListInventoriesRequest)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.ListInventoriesRequest other = + (com.google.cloud.osconfig.v1.ListInventoriesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (view_ != other.view_) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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) + VIEW_FIELD_NUMBER; + hash = (53 * hash) + view_; + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest 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.osconfig.v1.ListInventoriesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest 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.osconfig.v1.ListInventoriesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest 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.osconfig.v1.ListInventoriesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest 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.osconfig.v1.ListInventoriesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest 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.osconfig.v1.ListInventoriesRequest 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 request message for listing inventory data for all VMs in the specified
+   * location.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListInventoriesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.ListInventoriesRequest) + com.google.cloud.osconfig.v1.ListInventoriesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListInventoriesRequest.class, + com.google.cloud.osconfig.v1.ListInventoriesRequest.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.ListInventoriesRequest.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_ = ""; + + view_ = 0; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListInventoriesRequest getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.ListInventoriesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListInventoriesRequest build() { + com.google.cloud.osconfig.v1.ListInventoriesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListInventoriesRequest buildPartial() { + com.google.cloud.osconfig.v1.ListInventoriesRequest result = + new com.google.cloud.osconfig.v1.ListInventoriesRequest(this); + result.parent_ = parent_; + result.view_ = view_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.osconfig.v1.ListInventoriesRequest) { + return mergeFrom((com.google.cloud.osconfig.v1.ListInventoriesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.ListInventoriesRequest other) { + if (other == com.google.cloud.osconfig.v1.ListInventoriesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.view_ != 0) { + setViewValue(other.getViewValue()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.osconfig.v1.ListInventoriesRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.ListInventoriesRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 int view_ = 0; + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + @java.lang.Override + public int getViewValue() { + return view_; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @param value The enum numeric value on the wire for view to set. + * @return This builder for chaining. + */ + public Builder setViewValue(int value) { + + view_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The view. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.InventoryView getView() { + @SuppressWarnings("deprecation") + com.google.cloud.osconfig.v1.InventoryView result = + com.google.cloud.osconfig.v1.InventoryView.valueOf(view_); + return result == null ? com.google.cloud.osconfig.v1.InventoryView.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @param value The view to set. + * @return This builder for chaining. + */ + public Builder setView(com.google.cloud.osconfig.v1.InventoryView value) { + if (value == null) { + throw new NullPointerException(); + } + + view_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Inventory view indicating what information should be included in the
+     * inventory resource. If unspecified, the default view is BASIC.
+     * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return This builder for chaining. + */ + public Builder clearView() { + + view_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * 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 results to return.
+     * 
+ * + * int32 page_size = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to
+     * `ListInventories` that indicates where this listing
+     * should continue from.
+     * 
+ * + * string page_token = 4; + * + * @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 pagination token returned from a previous call to
+     * `ListInventories` that indicates where this listing
+     * should continue from.
+     * 
+ * + * string page_token = 4; + * + * @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 pagination token returned from a previous call to
+     * `ListInventories` that indicates where this listing
+     * should continue from.
+     * 
+ * + * string page_token = 4; + * + * @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 pagination token returned from a previous call to
+     * `ListInventories` that indicates where this listing
+     * should continue from.
+     * 
+ * + * string page_token = 4; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to
+     * `ListInventories` that indicates where this listing
+     * should continue from.
+     * 
+ * + * string page_token = 4; + * + * @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 java.lang.Object filter_ = ""; + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `Inventory` API resource to be included in the response.
+     * 
+ * + * string filter = 5; + * + * @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; + } + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `Inventory` API resource to be included in the response.
+     * 
+ * + * string filter = 5; + * + * @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; + } + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `Inventory` API resource to be included in the response.
+     * 
+ * + * string filter = 5; + * + * @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; + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `Inventory` API resource to be included in the response.
+     * 
+ * + * string filter = 5; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `Inventory` API resource to be included in the response.
+     * 
+ * + * string filter = 5; + * + * @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; + } + + @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.osconfig.v1.ListInventoriesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.ListInventoriesRequest) + private static final com.google.cloud.osconfig.v1.ListInventoriesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.ListInventoriesRequest(); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInventoriesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInventoriesRequest(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.osconfig.v1.ListInventoriesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequestOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequestOrBuilder.java new file mode 100644 index 00000000..8d906785 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesRequestOrBuilder.java @@ -0,0 +1,154 @@ +/* + * 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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +public interface ListInventoriesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.ListInventoriesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The enum numeric value on the wire for view. + */ + int getViewValue(); + /** + * + * + *
+   * Inventory view indicating what information should be included in the
+   * inventory resource. If unspecified, the default view is BASIC.
+   * 
+ * + * .google.cloud.osconfig.v1.InventoryView view = 2; + * + * @return The view. + */ + com.google.cloud.osconfig.v1.InventoryView getView(); + + /** + * + * + *
+   * The maximum number of results to return.
+   * 
+ * + * int32 page_size = 3; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A pagination token returned from a previous call to
+   * `ListInventories` that indicates where this listing
+   * should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to
+   * `ListInventories` that indicates where this listing
+   * should continue from.
+   * 
+ * + * string page_token = 4; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `Inventory` API resource to be included in the response.
+   * 
+ * + * string filter = 5; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `Inventory` API resource to be included in the response.
+   * 
+ * + * string filter = 5; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponse.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponse.java new file mode 100644 index 00000000..0ed35071 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponse.java @@ -0,0 +1,1131 @@ +/* + * 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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * A response message for listing inventory data for all VMs in a specified
+ * location.
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListInventoriesResponse} + */ +public final class ListInventoriesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.ListInventoriesResponse) + ListInventoriesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInventoriesResponse.newBuilder() to construct. + private ListInventoriesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInventoriesResponse() { + inventories_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInventoriesResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListInventoriesResponse( + 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)) { + inventories_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + inventories_.add( + input.readMessage( + com.google.cloud.osconfig.v1.Inventory.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)) { + inventories_ = java.util.Collections.unmodifiableList(inventories_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListInventoriesResponse.class, + com.google.cloud.osconfig.v1.ListInventoriesResponse.Builder.class); + } + + public static final int INVENTORIES_FIELD_NUMBER = 1; + private java.util.List inventories_; + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + @java.lang.Override + public java.util.List getInventoriesList() { + return inventories_; + } + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + @java.lang.Override + public java.util.List + getInventoriesOrBuilderList() { + return inventories_; + } + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + @java.lang.Override + public int getInventoriesCount() { + return inventories_.size(); + } + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.Inventory getInventories(int index) { + return inventories_.get(index); + } + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.InventoryOrBuilder getInventoriesOrBuilder(int index) { + return inventories_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The pagination token to retrieve the next page of inventory objects.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The pagination token to retrieve the next page of inventory objects.
+   * 
+ * + * 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 < inventories_.size(); i++) { + output.writeMessage(1, inventories_.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 < inventories_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, inventories_.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.osconfig.v1.ListInventoriesResponse)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.ListInventoriesResponse other = + (com.google.cloud.osconfig.v1.ListInventoriesResponse) obj; + + if (!getInventoriesList().equals(other.getInventoriesList())) 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 (getInventoriesCount() > 0) { + hash = (37 * hash) + INVENTORIES_FIELD_NUMBER; + hash = (53 * hash) + getInventoriesList().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.osconfig.v1.ListInventoriesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse 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.osconfig.v1.ListInventoriesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse 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.osconfig.v1.ListInventoriesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse 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.osconfig.v1.ListInventoriesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse 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.osconfig.v1.ListInventoriesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse 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.osconfig.v1.ListInventoriesResponse 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 response message for listing inventory data for all VMs in a specified
+   * location.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListInventoriesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.ListInventoriesResponse) + com.google.cloud.osconfig.v1.ListInventoriesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListInventoriesResponse.class, + com.google.cloud.osconfig.v1.ListInventoriesResponse.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.ListInventoriesResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInventoriesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (inventoriesBuilder_ == null) { + inventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + inventoriesBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.Inventories + .internal_static_google_cloud_osconfig_v1_ListInventoriesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListInventoriesResponse getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.ListInventoriesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListInventoriesResponse build() { + com.google.cloud.osconfig.v1.ListInventoriesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListInventoriesResponse buildPartial() { + com.google.cloud.osconfig.v1.ListInventoriesResponse result = + new com.google.cloud.osconfig.v1.ListInventoriesResponse(this); + int from_bitField0_ = bitField0_; + if (inventoriesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + inventories_ = java.util.Collections.unmodifiableList(inventories_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.inventories_ = inventories_; + } else { + result.inventories_ = inventoriesBuilder_.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.osconfig.v1.ListInventoriesResponse) { + return mergeFrom((com.google.cloud.osconfig.v1.ListInventoriesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.ListInventoriesResponse other) { + if (other == com.google.cloud.osconfig.v1.ListInventoriesResponse.getDefaultInstance()) + return this; + if (inventoriesBuilder_ == null) { + if (!other.inventories_.isEmpty()) { + if (inventories_.isEmpty()) { + inventories_ = other.inventories_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInventoriesIsMutable(); + inventories_.addAll(other.inventories_); + } + onChanged(); + } + } else { + if (!other.inventories_.isEmpty()) { + if (inventoriesBuilder_.isEmpty()) { + inventoriesBuilder_.dispose(); + inventoriesBuilder_ = null; + inventories_ = other.inventories_; + bitField0_ = (bitField0_ & ~0x00000001); + inventoriesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInventoriesFieldBuilder() + : null; + } else { + inventoriesBuilder_.addAllMessages(other.inventories_); + } + } + } + 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.osconfig.v1.ListInventoriesResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.ListInventoriesResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List inventories_ = + java.util.Collections.emptyList(); + + private void ensureInventoriesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + inventories_ = + new java.util.ArrayList(inventories_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.Inventory, + com.google.cloud.osconfig.v1.Inventory.Builder, + com.google.cloud.osconfig.v1.InventoryOrBuilder> + inventoriesBuilder_; + + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public java.util.List getInventoriesList() { + if (inventoriesBuilder_ == null) { + return java.util.Collections.unmodifiableList(inventories_); + } else { + return inventoriesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public int getInventoriesCount() { + if (inventoriesBuilder_ == null) { + return inventories_.size(); + } else { + return inventoriesBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public com.google.cloud.osconfig.v1.Inventory getInventories(int index) { + if (inventoriesBuilder_ == null) { + return inventories_.get(index); + } else { + return inventoriesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder setInventories(int index, com.google.cloud.osconfig.v1.Inventory value) { + if (inventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInventoriesIsMutable(); + inventories_.set(index, value); + onChanged(); + } else { + inventoriesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder setInventories( + int index, com.google.cloud.osconfig.v1.Inventory.Builder builderForValue) { + if (inventoriesBuilder_ == null) { + ensureInventoriesIsMutable(); + inventories_.set(index, builderForValue.build()); + onChanged(); + } else { + inventoriesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder addInventories(com.google.cloud.osconfig.v1.Inventory value) { + if (inventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInventoriesIsMutable(); + inventories_.add(value); + onChanged(); + } else { + inventoriesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder addInventories(int index, com.google.cloud.osconfig.v1.Inventory value) { + if (inventoriesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInventoriesIsMutable(); + inventories_.add(index, value); + onChanged(); + } else { + inventoriesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder addInventories(com.google.cloud.osconfig.v1.Inventory.Builder builderForValue) { + if (inventoriesBuilder_ == null) { + ensureInventoriesIsMutable(); + inventories_.add(builderForValue.build()); + onChanged(); + } else { + inventoriesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder addInventories( + int index, com.google.cloud.osconfig.v1.Inventory.Builder builderForValue) { + if (inventoriesBuilder_ == null) { + ensureInventoriesIsMutable(); + inventories_.add(index, builderForValue.build()); + onChanged(); + } else { + inventoriesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder addAllInventories( + java.lang.Iterable values) { + if (inventoriesBuilder_ == null) { + ensureInventoriesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, inventories_); + onChanged(); + } else { + inventoriesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder clearInventories() { + if (inventoriesBuilder_ == null) { + inventories_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + inventoriesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public Builder removeInventories(int index) { + if (inventoriesBuilder_ == null) { + ensureInventoriesIsMutable(); + inventories_.remove(index); + onChanged(); + } else { + inventoriesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public com.google.cloud.osconfig.v1.Inventory.Builder getInventoriesBuilder(int index) { + return getInventoriesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public com.google.cloud.osconfig.v1.InventoryOrBuilder getInventoriesOrBuilder(int index) { + if (inventoriesBuilder_ == null) { + return inventories_.get(index); + } else { + return inventoriesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public java.util.List + getInventoriesOrBuilderList() { + if (inventoriesBuilder_ != null) { + return inventoriesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(inventories_); + } + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public com.google.cloud.osconfig.v1.Inventory.Builder addInventoriesBuilder() { + return getInventoriesFieldBuilder() + .addBuilder(com.google.cloud.osconfig.v1.Inventory.getDefaultInstance()); + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public com.google.cloud.osconfig.v1.Inventory.Builder addInventoriesBuilder(int index) { + return getInventoriesFieldBuilder() + .addBuilder(index, com.google.cloud.osconfig.v1.Inventory.getDefaultInstance()); + } + /** + * + * + *
+     * List of inventory objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + public java.util.List + getInventoriesBuilderList() { + return getInventoriesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.Inventory, + com.google.cloud.osconfig.v1.Inventory.Builder, + com.google.cloud.osconfig.v1.InventoryOrBuilder> + getInventoriesFieldBuilder() { + if (inventoriesBuilder_ == null) { + inventoriesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.Inventory, + com.google.cloud.osconfig.v1.Inventory.Builder, + com.google.cloud.osconfig.v1.InventoryOrBuilder>( + inventories_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + inventories_ = null; + } + return inventoriesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The pagination token to retrieve the next page of inventory objects.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The pagination token to retrieve the next page of inventory objects.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The pagination token to retrieve the next page of inventory objects.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The pagination token to retrieve the next page of inventory objects.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The pagination token to retrieve the next page of inventory objects.
+     * 
+ * + * 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.osconfig.v1.ListInventoriesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.ListInventoriesResponse) + private static final com.google.cloud.osconfig.v1.ListInventoriesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.ListInventoriesResponse(); + } + + public static com.google.cloud.osconfig.v1.ListInventoriesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInventoriesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListInventoriesResponse(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.osconfig.v1.ListInventoriesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponseOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponseOrBuilder.java new file mode 100644 index 00000000..29649bec --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListInventoriesResponseOrBuilder.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/osconfig/v1/inventory.proto + +package com.google.cloud.osconfig.v1; + +public interface ListInventoriesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.ListInventoriesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + java.util.List getInventoriesList(); + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + com.google.cloud.osconfig.v1.Inventory getInventories(int index); + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + int getInventoriesCount(); + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + java.util.List + getInventoriesOrBuilderList(); + /** + * + * + *
+   * List of inventory objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.Inventory inventories = 1; + */ + com.google.cloud.osconfig.v1.InventoryOrBuilder getInventoriesOrBuilder(int index); + + /** + * + * + *
+   * The pagination token to retrieve the next page of inventory objects.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The pagination token to retrieve the next page of inventory objects.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequest.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequest.java new file mode 100644 index 00000000..8254ad40 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequest.java @@ -0,0 +1,1140 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * A request message for listing vulnerability reports for all VM instances in
+ * the specified location.
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} + */ +public final class ListVulnerabilityReportsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) + ListVulnerabilityReportsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListVulnerabilityReportsRequest.newBuilder() to construct. + private ListVulnerabilityReportsRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListVulnerabilityReportsRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListVulnerabilityReportsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListVulnerabilityReportsRequest( + 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 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + filter_ = 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.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.class, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The parent resource name.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * The maximum number of results to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * A pagination token returned from a previous call to
+   * `ListVulnerabilityReports` that indicates where this listing
+   * should continue from.
+   * 
+ * + * 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 pagination token returned from a previous call to
+   * `ListVulnerabilityReports` that indicates where this listing
+   * should continue from.
+   * 
+ * + * 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 FILTER_FIELD_NUMBER = 4; + private volatile java.lang.Object filter_; + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `vulnerabilityReport` API resource to be included in the response.
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `vulnerabilityReport` API resource to be included in the response.
+   * 
+ * + * string filter = 4; + * + * @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; + } + } + + 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 (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!getFilterBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + 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.osconfig.v1.ListVulnerabilityReportsRequest)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest other = + (com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) 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_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest 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.osconfig.v1.ListVulnerabilityReportsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest 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.osconfig.v1.ListVulnerabilityReportsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest 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.osconfig.v1.ListVulnerabilityReportsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest 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.osconfig.v1.ListVulnerabilityReportsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest 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.osconfig.v1.ListVulnerabilityReportsRequest 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 request message for listing vulnerability reports for all VM instances in
+   * the specified location.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListVulnerabilityReportsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.class, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + filter_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest build() { + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest buildPartial() { + com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest result = + new com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + result.filter_ = filter_; + 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.osconfig.v1.ListVulnerabilityReportsRequest) { + return mergeFrom((com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest other) { + if (other + == com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + 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.osconfig.v1.ListVulnerabilityReportsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource name.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource name.
+     * Format: `projects/{project}/locations/{location}/instances/-`
+     * For `{project}`, either `project-number` or `project-id` can be provided.
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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 int pageSize_; + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of results to return.
+     * 
+ * + * int32 page_size = 2; + * + * @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 results to return.
+     * 
+ * + * int32 page_size = 2; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * A pagination token returned from a previous call to
+     * `ListVulnerabilityReports` that indicates where this listing
+     * should continue from.
+     * 
+ * + * 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 pagination token returned from a previous call to
+     * `ListVulnerabilityReports` that indicates where this listing
+     * should continue from.
+     * 
+ * + * 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 pagination token returned from a previous call to
+     * `ListVulnerabilityReports` that indicates where this listing
+     * should continue from.
+     * 
+ * + * 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 pagination token returned from a previous call to
+     * `ListVulnerabilityReports` that indicates where this listing
+     * should continue from.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * A pagination token returned from a previous call to
+     * `ListVulnerabilityReports` that indicates where this listing
+     * should continue from.
+     * 
+ * + * 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 java.lang.Object filter_ = ""; + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `vulnerabilityReport` API resource to be included in the response.
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `vulnerabilityReport` API resource to be included in the response.
+     * 
+ * + * string filter = 4; + * + * @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; + } + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `vulnerabilityReport` API resource to be included in the response.
+     * 
+ * + * string filter = 4; + * + * @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; + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `vulnerabilityReport` API resource to be included in the response.
+     * 
+ * + * string filter = 4; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + + filter_ = getDefaultInstance().getFilter(); + onChanged(); + return this; + } + /** + * + * + *
+     * If provided, this field specifies the criteria that must be met by a
+     * `vulnerabilityReport` API resource to be included in the response.
+     * 
+ * + * string filter = 4; + * + * @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; + } + + @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.osconfig.v1.ListVulnerabilityReportsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) + private static final com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest(); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListVulnerabilityReportsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListVulnerabilityReportsRequest(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.osconfig.v1.ListVulnerabilityReportsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequestOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequestOrBuilder.java new file mode 100644 index 00000000..b6f41374 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsRequestOrBuilder.java @@ -0,0 +1,127 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +public interface ListVulnerabilityReportsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.ListVulnerabilityReportsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource name.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource name.
+   * Format: `projects/{project}/locations/{location}/instances/-`
+   * For `{project}`, either `project-number` or `project-id` can be provided.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of results to return.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * A pagination token returned from a previous call to
+   * `ListVulnerabilityReports` that indicates where this listing
+   * should continue from.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * A pagination token returned from a previous call to
+   * `ListVulnerabilityReports` that indicates where this listing
+   * should continue from.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `vulnerabilityReport` API resource to be included in the response.
+   * 
+ * + * string filter = 4; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * If provided, this field specifies the criteria that must be met by a
+   * `vulnerabilityReport` API resource to be included in the response.
+   * 
+ * + * string filter = 4; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponse.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponse.java new file mode 100644 index 00000000..0e6f3ea1 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponse.java @@ -0,0 +1,1179 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +/** + * + * + *
+ * A response message for listing vulnerability reports for all VM instances in
+ * the specified location.
+ * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} + */ +public final class ListVulnerabilityReportsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) + ListVulnerabilityReportsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListVulnerabilityReportsResponse.newBuilder() to construct. + private ListVulnerabilityReportsResponse( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListVulnerabilityReportsResponse() { + vulnerabilityReports_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListVulnerabilityReportsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListVulnerabilityReportsResponse( + 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)) { + vulnerabilityReports_ = + new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + vulnerabilityReports_.add( + input.readMessage( + com.google.cloud.osconfig.v1.VulnerabilityReport.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)) { + vulnerabilityReports_ = java.util.Collections.unmodifiableList(vulnerabilityReports_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.class, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.Builder.class); + } + + public static final int VULNERABILITY_REPORTS_FIELD_NUMBER = 1; + private java.util.List vulnerabilityReports_; + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + @java.lang.Override + public java.util.List + getVulnerabilityReportsList() { + return vulnerabilityReports_; + } + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + @java.lang.Override + public java.util.List + getVulnerabilityReportsOrBuilderList() { + return vulnerabilityReports_; + } + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + @java.lang.Override + public int getVulnerabilityReportsCount() { + return vulnerabilityReports_.size(); + } + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport getVulnerabilityReports(int index) { + return vulnerabilityReports_.get(index); + } + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder getVulnerabilityReportsOrBuilder( + int index) { + return vulnerabilityReports_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * The pagination token to retrieve the next page of vulnerabilityReports
+   * object.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The pagination token to retrieve the next page of vulnerabilityReports
+   * object.
+   * 
+ * + * 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 < vulnerabilityReports_.size(); i++) { + output.writeMessage(1, vulnerabilityReports_.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 < vulnerabilityReports_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, vulnerabilityReports_.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.osconfig.v1.ListVulnerabilityReportsResponse)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse other = + (com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) obj; + + if (!getVulnerabilityReportsList().equals(other.getVulnerabilityReportsList())) 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 (getVulnerabilityReportsCount() > 0) { + hash = (37 * hash) + VULNERABILITY_REPORTS_FIELD_NUMBER; + hash = (53 * hash) + getVulnerabilityReportsList().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.osconfig.v1.ListVulnerabilityReportsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse 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.osconfig.v1.ListVulnerabilityReportsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse 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.osconfig.v1.ListVulnerabilityReportsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse 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.osconfig.v1.ListVulnerabilityReportsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse 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.osconfig.v1.ListVulnerabilityReportsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse 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.osconfig.v1.ListVulnerabilityReportsResponse 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 response message for listing vulnerability reports for all VM instances in
+   * the specified location.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.ListVulnerabilityReportsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.class, + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVulnerabilityReportsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (vulnerabilityReportsBuilder_ == null) { + vulnerabilityReports_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + vulnerabilityReportsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_ListVulnerabilityReportsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse build() { + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse buildPartial() { + com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse result = + new com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse(this); + int from_bitField0_ = bitField0_; + if (vulnerabilityReportsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + vulnerabilityReports_ = java.util.Collections.unmodifiableList(vulnerabilityReports_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vulnerabilityReports_ = vulnerabilityReports_; + } else { + result.vulnerabilityReports_ = vulnerabilityReportsBuilder_.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.osconfig.v1.ListVulnerabilityReportsResponse) { + return mergeFrom((com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse other) { + if (other + == com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse.getDefaultInstance()) + return this; + if (vulnerabilityReportsBuilder_ == null) { + if (!other.vulnerabilityReports_.isEmpty()) { + if (vulnerabilityReports_.isEmpty()) { + vulnerabilityReports_ = other.vulnerabilityReports_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.addAll(other.vulnerabilityReports_); + } + onChanged(); + } + } else { + if (!other.vulnerabilityReports_.isEmpty()) { + if (vulnerabilityReportsBuilder_.isEmpty()) { + vulnerabilityReportsBuilder_.dispose(); + vulnerabilityReportsBuilder_ = null; + vulnerabilityReports_ = other.vulnerabilityReports_; + bitField0_ = (bitField0_ & ~0x00000001); + vulnerabilityReportsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVulnerabilityReportsFieldBuilder() + : null; + } else { + vulnerabilityReportsBuilder_.addAllMessages(other.vulnerabilityReports_); + } + } + } + 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.osconfig.v1.ListVulnerabilityReportsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List vulnerabilityReports_ = + java.util.Collections.emptyList(); + + private void ensureVulnerabilityReportsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + vulnerabilityReports_ = + new java.util.ArrayList( + vulnerabilityReports_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport, + com.google.cloud.osconfig.v1.VulnerabilityReport.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder> + vulnerabilityReportsBuilder_; + + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public java.util.List + getVulnerabilityReportsList() { + if (vulnerabilityReportsBuilder_ == null) { + return java.util.Collections.unmodifiableList(vulnerabilityReports_); + } else { + return vulnerabilityReportsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public int getVulnerabilityReportsCount() { + if (vulnerabilityReportsBuilder_ == null) { + return vulnerabilityReports_.size(); + } else { + return vulnerabilityReportsBuilder_.getCount(); + } + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport getVulnerabilityReports(int index) { + if (vulnerabilityReportsBuilder_ == null) { + return vulnerabilityReports_.get(index); + } else { + return vulnerabilityReportsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder setVulnerabilityReports( + int index, com.google.cloud.osconfig.v1.VulnerabilityReport value) { + if (vulnerabilityReportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.set(index, value); + onChanged(); + } else { + vulnerabilityReportsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder setVulnerabilityReports( + int index, com.google.cloud.osconfig.v1.VulnerabilityReport.Builder builderForValue) { + if (vulnerabilityReportsBuilder_ == null) { + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.set(index, builderForValue.build()); + onChanged(); + } else { + vulnerabilityReportsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder addVulnerabilityReports(com.google.cloud.osconfig.v1.VulnerabilityReport value) { + if (vulnerabilityReportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.add(value); + onChanged(); + } else { + vulnerabilityReportsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder addVulnerabilityReports( + int index, com.google.cloud.osconfig.v1.VulnerabilityReport value) { + if (vulnerabilityReportsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.add(index, value); + onChanged(); + } else { + vulnerabilityReportsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder addVulnerabilityReports( + com.google.cloud.osconfig.v1.VulnerabilityReport.Builder builderForValue) { + if (vulnerabilityReportsBuilder_ == null) { + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.add(builderForValue.build()); + onChanged(); + } else { + vulnerabilityReportsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder addVulnerabilityReports( + int index, com.google.cloud.osconfig.v1.VulnerabilityReport.Builder builderForValue) { + if (vulnerabilityReportsBuilder_ == null) { + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.add(index, builderForValue.build()); + onChanged(); + } else { + vulnerabilityReportsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder addAllVulnerabilityReports( + java.lang.Iterable values) { + if (vulnerabilityReportsBuilder_ == null) { + ensureVulnerabilityReportsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vulnerabilityReports_); + onChanged(); + } else { + vulnerabilityReportsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder clearVulnerabilityReports() { + if (vulnerabilityReportsBuilder_ == null) { + vulnerabilityReports_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + vulnerabilityReportsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public Builder removeVulnerabilityReports(int index) { + if (vulnerabilityReportsBuilder_ == null) { + ensureVulnerabilityReportsIsMutable(); + vulnerabilityReports_.remove(index); + onChanged(); + } else { + vulnerabilityReportsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Builder getVulnerabilityReportsBuilder( + int index) { + return getVulnerabilityReportsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder + getVulnerabilityReportsOrBuilder(int index) { + if (vulnerabilityReportsBuilder_ == null) { + return vulnerabilityReports_.get(index); + } else { + return vulnerabilityReportsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public java.util.List + getVulnerabilityReportsOrBuilderList() { + if (vulnerabilityReportsBuilder_ != null) { + return vulnerabilityReportsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vulnerabilityReports_); + } + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Builder + addVulnerabilityReportsBuilder() { + return getVulnerabilityReportsFieldBuilder() + .addBuilder(com.google.cloud.osconfig.v1.VulnerabilityReport.getDefaultInstance()); + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Builder addVulnerabilityReportsBuilder( + int index) { + return getVulnerabilityReportsFieldBuilder() + .addBuilder(index, com.google.cloud.osconfig.v1.VulnerabilityReport.getDefaultInstance()); + } + /** + * + * + *
+     * List of vulnerabilityReport objects.
+     * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + * + */ + public java.util.List + getVulnerabilityReportsBuilderList() { + return getVulnerabilityReportsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport, + com.google.cloud.osconfig.v1.VulnerabilityReport.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder> + getVulnerabilityReportsFieldBuilder() { + if (vulnerabilityReportsBuilder_ == null) { + vulnerabilityReportsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport, + com.google.cloud.osconfig.v1.VulnerabilityReport.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder>( + vulnerabilityReports_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + vulnerabilityReports_ = null; + } + return vulnerabilityReportsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * The pagination token to retrieve the next page of vulnerabilityReports
+     * object.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The pagination token to retrieve the next page of vulnerabilityReports
+     * object.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The pagination token to retrieve the next page of vulnerabilityReports
+     * object.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The pagination token to retrieve the next page of vulnerabilityReports
+     * object.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The pagination token to retrieve the next page of vulnerabilityReports
+     * object.
+     * 
+ * + * 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.osconfig.v1.ListVulnerabilityReportsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) + private static final com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse(); + } + + public static com.google.cloud.osconfig.v1.ListVulnerabilityReportsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListVulnerabilityReportsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListVulnerabilityReportsResponse(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.osconfig.v1.ListVulnerabilityReportsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponseOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponseOrBuilder.java new file mode 100644 index 00000000..58c34c75 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/ListVulnerabilityReportsResponseOrBuilder.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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +public interface ListVulnerabilityReportsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.ListVulnerabilityReportsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + java.util.List getVulnerabilityReportsList(); + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + com.google.cloud.osconfig.v1.VulnerabilityReport getVulnerabilityReports(int index); + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + int getVulnerabilityReportsCount(); + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + java.util.List + getVulnerabilityReportsOrBuilderList(); + /** + * + * + *
+   * List of vulnerabilityReport objects.
+   * 
+ * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport vulnerability_reports = 1; + */ + com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder getVulnerabilityReportsOrBuilder( + int index); + + /** + * + * + *
+   * The pagination token to retrieve the next page of vulnerabilityReports
+   * object.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * The pagination token to retrieve the next page of vulnerabilityReports
+   * object.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigProto.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigProto.java index b07278e9..8bcabef1 100644 --- a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigProto.java +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/OsConfigProto.java @@ -85,14 +85,16 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\002**(/v1/{name=projects/*/patchDeployment" + "s/*}\332A\004name\032K\312A\027osconfig.googleapis.com\322" + "A.https://www.googleapis.com/auth/cloud-" - + "platformB\235\002\n\034com.google.cloud.osconfig.v" + + "platformB\334\002\n\034com.google.cloud.osconfig.v" + "1B\rOsConfigProtoZ@google.golang.org/genp" + "roto/googleapis/cloud/osconfig/v1;osconf" + "ig\252\002\030Google.Cloud.OsConfig.V1\312\002\030Google\\C" + "loud\\OsConfig\\V1\352\002\033Google::Cloud::OsConf" - + "ig::V1\352AW\n\037compute.googleapis.com/Instan" - + "ce\0224projects/{project}/zones/{zone}/inst" - + "ances/{instance}b\006proto3" + + "ig::V1\352A\225\001\n\037compute.googleapis.com/Insta" + + "nce\0224projects/{project}/zones/{zone}/ins" + + "tances/{instance}\022 + * This API resource represents the vulnerability report for a specified + * Compute Engine virtual machine (VM) instance at a given point in time. + * For more information, see [Vulnerability + * reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). + * + * + * Protobuf type {@code google.cloud.osconfig.v1.VulnerabilityReport} + */ +public final class VulnerabilityReport extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.VulnerabilityReport) + VulnerabilityReportOrBuilder { + private static final long serialVersionUID = 0L; + // Use VulnerabilityReport.newBuilder() to construct. + private VulnerabilityReport(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private VulnerabilityReport() { + name_ = ""; + vulnerabilities_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new VulnerabilityReport(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private VulnerabilityReport( + 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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + vulnerabilities_ = + new java.util.ArrayList< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability>(); + mutable_bitField0_ |= 0x00000001; + } + vulnerabilities_.add( + input.readMessage( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.parser(), + extensionRegistry)); + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + vulnerabilities_ = java.util.Collections.unmodifiableList(vulnerabilities_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Builder.class); + } + + public interface VulnerabilityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Contains metadata as per the upstream feed of the operating system and
+     * NVD.
+     * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + * @return Whether the details field is set. + */ + boolean hasDetails(); + /** + * + * + *
+     * Contains metadata as per the upstream feed of the operating system and
+     * NVD.
+     * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + * @return The details. + */ + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details getDetails(); + /** + * + * + *
+     * Contains metadata as per the upstream feed of the operating system and
+     * NVD.
+     * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + */ + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder + getDetailsOrBuilder(); + + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return A list containing the installedInventoryItemIds. + */ + java.util.List getInstalledInventoryItemIdsList(); + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return The count of installedInventoryItemIds. + */ + int getInstalledInventoryItemIdsCount(); + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index of the element to return. + * @return The installedInventoryItemIds at the given index. + */ + java.lang.String getInstalledInventoryItemIds(int index); + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the installedInventoryItemIds at the given index. + */ + com.google.protobuf.ByteString getInstalledInventoryItemIdsBytes(int index); + + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return A list containing the availableInventoryItemIds. + */ + java.util.List getAvailableInventoryItemIdsList(); + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return The count of availableInventoryItemIds. + */ + int getAvailableInventoryItemIdsCount(); + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index of the element to return. + * @return The availableInventoryItemIds at the given index. + */ + java.lang.String getAvailableInventoryItemIds(int index); + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the availableInventoryItemIds at the given index. + */ + com.google.protobuf.ByteString getAvailableInventoryItemIdsBytes(int index); + + /** + * + * + *
+     * The timestamp for when the vulnerability was first detected.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+     * The timestamp for when the vulnerability was first detected.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+     * The timestamp for when the vulnerability was first detected.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+     * The timestamp for when the vulnerability was last modified.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+     * The timestamp for when the vulnerability was last modified.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+     * The timestamp for when the vulnerability was last modified.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + } + /** + * + * + *
+   * A vulnerability affecting the VM instance.
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability} + */ + public static final class Vulnerability extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) + VulnerabilityOrBuilder { + private static final long serialVersionUID = 0L; + // Use Vulnerability.newBuilder() to construct. + private Vulnerability(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Vulnerability() { + installedInventoryItemIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + availableInventoryItemIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Vulnerability(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Vulnerability( + 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: + { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder + subBuilder = null; + if (details_ != null) { + subBuilder = details_.toBuilder(); + } + details_ = + input.readMessage( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(details_); + details_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + installedInventoryItemIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + installedInventoryItemIds_.add(s); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + availableInventoryItemIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + availableInventoryItemIds_.add(s); + break; + } + case 34: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 42: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (updateTime_ != null) { + subBuilder = updateTime_.toBuilder(); + } + updateTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateTime_); + updateTime_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + installedInventoryItemIds_ = installedInventoryItemIds_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + availableInventoryItemIds_ = availableInventoryItemIds_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder.class); + } + + public interface DetailsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The CVE of the vulnerability. CVE cannot be
+       * empty and the combination of <cve, classification> should be unique
+       * across vulnerabilities for a VM.
+       * 
+ * + * string cve = 1; + * + * @return The cve. + */ + java.lang.String getCve(); + /** + * + * + *
+       * The CVE of the vulnerability. CVE cannot be
+       * empty and the combination of <cve, classification> should be unique
+       * across vulnerabilities for a VM.
+       * 
+ * + * string cve = 1; + * + * @return The bytes for cve. + */ + com.google.protobuf.ByteString getCveBytes(); + + /** + * + * + *
+       * The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of
+       * 0 - 10 where 0 indicates low severity and 10 indicates high severity.
+       * 
+ * + * float cvss_v2_score = 2; + * + * @return The cvssV2Score. + */ + float getCvssV2Score(); + + /** + * + * + *
+       * The full description of the CVSSv3 for this vulnerability from NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + * + * @return Whether the cvssV3 field is set. + */ + boolean hasCvssV3(); + /** + * + * + *
+       * The full description of the CVSSv3 for this vulnerability from NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + * + * @return The cvssV3. + */ + com.google.cloud.osconfig.v1.CVSSv3 getCvssV3(); + /** + * + * + *
+       * The full description of the CVSSv3 for this vulnerability from NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + com.google.cloud.osconfig.v1.CVSSv3OrBuilder getCvssV3OrBuilder(); + + /** + * + * + *
+       * Assigned severity/impact ranking from the distro.
+       * 
+ * + * string severity = 4; + * + * @return The severity. + */ + java.lang.String getSeverity(); + /** + * + * + *
+       * Assigned severity/impact ranking from the distro.
+       * 
+ * + * string severity = 4; + * + * @return The bytes for severity. + */ + com.google.protobuf.ByteString getSeverityBytes(); + + /** + * + * + *
+       * The note or description describing the vulnerability from the distro.
+       * 
+ * + * string description = 5; + * + * @return The description. + */ + java.lang.String getDescription(); + /** + * + * + *
+       * The note or description describing the vulnerability from the distro.
+       * 
+ * + * string description = 5; + * + * @return The bytes for description. + */ + com.google.protobuf.ByteString getDescriptionBytes(); + + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + java.util.List< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference> + getReferencesList(); + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + getReferences(int index); + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + int getReferencesCount(); + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + java.util.List< + ? extends + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder> + getReferencesOrBuilderList(); + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.ReferenceOrBuilder + getReferencesOrBuilder(int index); + } + /** + * + * + *
+     * Contains metadata information for the vulnerability. This information is
+     * collected from the upstream feed of the operating system.
+     * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} + */ + public static final class Details extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + DetailsOrBuilder { + private static final long serialVersionUID = 0L; + // Use Details.newBuilder() to construct. + private Details(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Details() { + cve_ = ""; + severity_ = ""; + description_ = ""; + references_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Details(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Details( + 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(); + + cve_ = s; + break; + } + case 21: + { + cvssV2Score_ = input.readFloat(); + break; + } + case 26: + { + com.google.cloud.osconfig.v1.CVSSv3.Builder subBuilder = null; + if (cvssV3_ != null) { + subBuilder = cvssV3_.toBuilder(); + } + cvssV3_ = + input.readMessage( + com.google.cloud.osconfig.v1.CVSSv3.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(cvssV3_); + cvssV3_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + severity_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + description_ = s; + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + references_ = + new java.util.ArrayList< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference>(); + mutable_bitField0_ |= 0x00000001; + } + references_.add( + input.readMessage( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference.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)) { + references_ = java.util.Collections.unmodifiableList(references_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder + .class); + } + + public interface ReferenceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+         * The url of the reference.
+         * 
+ * + * string url = 1; + * + * @return The url. + */ + java.lang.String getUrl(); + /** + * + * + *
+         * The url of the reference.
+         * 
+ * + * string url = 1; + * + * @return The bytes for url. + */ + com.google.protobuf.ByteString getUrlBytes(); + + /** + * + * + *
+         * The source of the reference e.g. NVD.
+         * 
+ * + * string source = 2; + * + * @return The source. + */ + java.lang.String getSource(); + /** + * + * + *
+         * The source of the reference e.g. NVD.
+         * 
+ * + * string source = 2; + * + * @return The bytes for source. + */ + com.google.protobuf.ByteString getSourceBytes(); + } + /** + * + * + *
+       * A reference for this vulnerability.
+       * 
+ * + * Protobuf type {@code + * google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference} + */ + public static final class Reference extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + ReferenceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Reference.newBuilder() to construct. + private Reference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Reference() { + url_ = ""; + source_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Reference(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Reference( + 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(); + + url_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + source_ = 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.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_Reference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_Reference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder.class); + } + + public static final int URL_FIELD_NUMBER = 1; + private volatile java.lang.Object url_; + /** + * + * + *
+         * The url of the reference.
+         * 
+ * + * string url = 1; + * + * @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; + } + } + /** + * + * + *
+         * The url of the reference.
+         * 
+ * + * string url = 1; + * + * @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 SOURCE_FIELD_NUMBER = 2; + private volatile java.lang.Object source_; + /** + * + * + *
+         * The source of the reference e.g. NVD.
+         * 
+ * + * string source = 2; + * + * @return The source. + */ + @java.lang.Override + public java.lang.String getSource() { + java.lang.Object ref = source_; + 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(); + source_ = s; + return s; + } + } + /** + * + * + *
+         * The source of the reference e.g. NVD.
+         * 
+ * + * string source = 2; + * + * @return The bytes for source. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = 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 (!getUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, url_); + } + if (!getSourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, url_); + } + if (!getSourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_); + } + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference other = + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + obj; + + if (!getUrl().equals(other.getUrl())) return false; + if (!getSource().equals(other.getSource())) 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) + URL_FIELD_NUMBER; + hash = (53 * hash) + getUrl().hashCode(); + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + 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 reference for this vulnerability.
+         * 
+ * + * Protobuf type {@code + * google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_Reference_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_Reference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder.class); + } + + // Construct using + // com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.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(); + url_ = ""; + + source_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_Reference_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + build() { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + buildPartial() { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + result = + new com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference(this); + result.url_ = url_; + result.source_ = source_; + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) { + return mergeFrom( + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + other) { + if (other + == com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .getDefaultInstance()) return this; + if (!other.getUrl().isEmpty()) { + url_ = other.url_; + onChanged(); + } + if (!other.getSource().isEmpty()) { + source_ = other.source_; + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object url_ = ""; + /** + * + * + *
+           * The url of the reference.
+           * 
+ * + * string url = 1; + * + * @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; + } + } + /** + * + * + *
+           * The url of the reference.
+           * 
+ * + * string url = 1; + * + * @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; + } + } + /** + * + * + *
+           * The url of the reference.
+           * 
+ * + * string url = 1; + * + * @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; + } + /** + * + * + *
+           * The url of the reference.
+           * 
+ * + * string url = 1; + * + * @return This builder for chaining. + */ + public Builder clearUrl() { + + url_ = getDefaultInstance().getUrl(); + onChanged(); + return this; + } + /** + * + * + *
+           * The url of the reference.
+           * 
+ * + * string url = 1; + * + * @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 source_ = ""; + /** + * + * + *
+           * The source of the reference e.g. NVD.
+           * 
+ * + * string source = 2; + * + * @return The source. + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + source_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+           * The source of the reference e.g. NVD.
+           * 
+ * + * string source = 2; + * + * @return The bytes for source. + */ + public com.google.protobuf.ByteString getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+           * The source of the reference e.g. NVD.
+           * 
+ * + * string source = 2; + * + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + source_ = value; + onChanged(); + return this; + } + /** + * + * + *
+           * The source of the reference e.g. NVD.
+           * 
+ * + * string source = 2; + * + * @return This builder for chaining. + */ + public Builder clearSource() { + + source_ = getDefaultInstance().getSource(); + onChanged(); + return this; + } + /** + * + * + *
+           * The source of the reference e.g. NVD.
+           * 
+ * + * string source = 2; + * + * @param value The bytes for source to set. + * @return This builder for chaining. + */ + public Builder setSourceBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + source_ = 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference) + private static final com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference(); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Reference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Reference(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.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CVE_FIELD_NUMBER = 1; + private volatile java.lang.Object cve_; + /** + * + * + *
+       * The CVE of the vulnerability. CVE cannot be
+       * empty and the combination of <cve, classification> should be unique
+       * across vulnerabilities for a VM.
+       * 
+ * + * string cve = 1; + * + * @return The cve. + */ + @java.lang.Override + public java.lang.String getCve() { + java.lang.Object ref = cve_; + 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(); + cve_ = s; + return s; + } + } + /** + * + * + *
+       * The CVE of the vulnerability. CVE cannot be
+       * empty and the combination of <cve, classification> should be unique
+       * across vulnerabilities for a VM.
+       * 
+ * + * string cve = 1; + * + * @return The bytes for cve. + */ + @java.lang.Override + public com.google.protobuf.ByteString getCveBytes() { + java.lang.Object ref = cve_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cve_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CVSS_V2_SCORE_FIELD_NUMBER = 2; + private float cvssV2Score_; + /** + * + * + *
+       * The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of
+       * 0 - 10 where 0 indicates low severity and 10 indicates high severity.
+       * 
+ * + * float cvss_v2_score = 2; + * + * @return The cvssV2Score. + */ + @java.lang.Override + public float getCvssV2Score() { + return cvssV2Score_; + } + + public static final int CVSS_V3_FIELD_NUMBER = 3; + private com.google.cloud.osconfig.v1.CVSSv3 cvssV3_; + /** + * + * + *
+       * The full description of the CVSSv3 for this vulnerability from NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + * + * @return Whether the cvssV3 field is set. + */ + @java.lang.Override + public boolean hasCvssV3() { + return cvssV3_ != null; + } + /** + * + * + *
+       * The full description of the CVSSv3 for this vulnerability from NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + * + * @return The cvssV3. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3 getCvssV3() { + return cvssV3_ == null ? com.google.cloud.osconfig.v1.CVSSv3.getDefaultInstance() : cvssV3_; + } + /** + * + * + *
+       * The full description of the CVSSv3 for this vulnerability from NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.CVSSv3OrBuilder getCvssV3OrBuilder() { + return getCvssV3(); + } + + public static final int SEVERITY_FIELD_NUMBER = 4; + private volatile java.lang.Object severity_; + /** + * + * + *
+       * Assigned severity/impact ranking from the distro.
+       * 
+ * + * string severity = 4; + * + * @return The severity. + */ + @java.lang.Override + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + 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(); + severity_ = s; + return s; + } + } + /** + * + * + *
+       * Assigned severity/impact ranking from the distro.
+       * 
+ * + * string severity = 4; + * + * @return The bytes for severity. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DESCRIPTION_FIELD_NUMBER = 5; + private volatile java.lang.Object description_; + /** + * + * + *
+       * The note or description describing the vulnerability from the distro.
+       * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+       * The note or description describing the vulnerability from the distro.
+       * 
+ * + * string description = 5; + * + * @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 REFERENCES_FIELD_NUMBER = 6; + private java.util.List< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference> + references_; + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference> + getReferencesList() { + return references_; + } + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder> + getReferencesOrBuilderList() { + return references_; + } + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + @java.lang.Override + public int getReferencesCount() { + return references_.size(); + } + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + getReferences(int index) { + return references_.get(index); + } + /** + * + * + *
+       * Corresponds to the references attached to the `VulnerabilityDetails`.
+       * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder + getReferencesOrBuilder(int index) { + return references_.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 (!getCveBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, cve_); + } + if (cvssV2Score_ != 0F) { + output.writeFloat(2, cvssV2Score_); + } + if (cvssV3_ != null) { + output.writeMessage(3, getCvssV3()); + } + if (!getSeverityBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, severity_); + } + if (!getDescriptionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, description_); + } + for (int i = 0; i < references_.size(); i++) { + output.writeMessage(6, references_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getCveBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, cve_); + } + if (cvssV2Score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, cvssV2Score_); + } + if (cvssV3_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCvssV3()); + } + if (!getSeverityBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, severity_); + } + if (!getDescriptionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, description_); + } + for (int i = 0; i < references_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, references_.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details other = + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) obj; + + if (!getCve().equals(other.getCve())) return false; + if (java.lang.Float.floatToIntBits(getCvssV2Score()) + != java.lang.Float.floatToIntBits(other.getCvssV2Score())) return false; + if (hasCvssV3() != other.hasCvssV3()) return false; + if (hasCvssV3()) { + if (!getCvssV3().equals(other.getCvssV3())) return false; + } + if (!getSeverity().equals(other.getSeverity())) return false; + if (!getDescription().equals(other.getDescription())) return false; + if (!getReferencesList().equals(other.getReferencesList())) 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) + CVE_FIELD_NUMBER; + hash = (53 * hash) + getCve().hashCode(); + hash = (37 * hash) + CVSS_V2_SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getCvssV2Score()); + if (hasCvssV3()) { + hash = (37 * hash) + CVSS_V3_FIELD_NUMBER; + hash = (53 * hash) + getCvssV3().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + getSeverity().hashCode(); + hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; + hash = (53 * hash) + getDescription().hashCode(); + if (getReferencesCount() > 0) { + hash = (37 * hash) + REFERENCES_FIELD_NUMBER; + hash = (53 * hash) + getReferencesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details 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; + } + /** + * + * + *
+       * Contains metadata information for the vulnerability. This information is
+       * collected from the upstream feed of the operating system.
+       * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder + .class); + } + + // Construct using + // com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getReferencesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + cve_ = ""; + + cvssV2Score_ = 0F; + + if (cvssV3Builder_ == null) { + cvssV3_ = null; + } else { + cvssV3_ = null; + cvssV3Builder_ = null; + } + severity_ = ""; + + description_ = ""; + + if (referencesBuilder_ == null) { + references_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + referencesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_Details_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details build() { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + buildPartial() { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details result = + new com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details(this); + int from_bitField0_ = bitField0_; + result.cve_ = cve_; + result.cvssV2Score_ = cvssV2Score_; + if (cvssV3Builder_ == null) { + result.cvssV3_ = cvssV3_; + } else { + result.cvssV3_ = cvssV3Builder_.build(); + } + result.severity_ = severity_; + result.description_ = description_; + if (referencesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + references_ = java.util.Collections.unmodifiableList(references_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.references_ = references_; + } else { + result.references_ = referencesBuilder_.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.osconfig.v1.VulnerabilityReport.Vulnerability.Details) { + return mergeFrom( + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details other) { + if (other + == com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .getDefaultInstance()) return this; + if (!other.getCve().isEmpty()) { + cve_ = other.cve_; + onChanged(); + } + if (other.getCvssV2Score() != 0F) { + setCvssV2Score(other.getCvssV2Score()); + } + if (other.hasCvssV3()) { + mergeCvssV3(other.getCvssV3()); + } + if (!other.getSeverity().isEmpty()) { + severity_ = other.severity_; + onChanged(); + } + if (!other.getDescription().isEmpty()) { + description_ = other.description_; + onChanged(); + } + if (referencesBuilder_ == null) { + if (!other.references_.isEmpty()) { + if (references_.isEmpty()) { + references_ = other.references_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureReferencesIsMutable(); + references_.addAll(other.references_); + } + onChanged(); + } + } else { + if (!other.references_.isEmpty()) { + if (referencesBuilder_.isEmpty()) { + referencesBuilder_.dispose(); + referencesBuilder_ = null; + references_ = other.references_; + bitField0_ = (bitField0_ & ~0x00000001); + referencesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getReferencesFieldBuilder() + : null; + } else { + referencesBuilder_.addAllMessages(other.references_); + } + } + } + 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.osconfig.v1.VulnerabilityReport.Vulnerability.Details parsedMessage = + null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object cve_ = ""; + /** + * + * + *
+         * The CVE of the vulnerability. CVE cannot be
+         * empty and the combination of <cve, classification> should be unique
+         * across vulnerabilities for a VM.
+         * 
+ * + * string cve = 1; + * + * @return The cve. + */ + public java.lang.String getCve() { + java.lang.Object ref = cve_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + cve_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * The CVE of the vulnerability. CVE cannot be
+         * empty and the combination of <cve, classification> should be unique
+         * across vulnerabilities for a VM.
+         * 
+ * + * string cve = 1; + * + * @return The bytes for cve. + */ + public com.google.protobuf.ByteString getCveBytes() { + java.lang.Object ref = cve_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + cve_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * The CVE of the vulnerability. CVE cannot be
+         * empty and the combination of <cve, classification> should be unique
+         * across vulnerabilities for a VM.
+         * 
+ * + * string cve = 1; + * + * @param value The cve to set. + * @return This builder for chaining. + */ + public Builder setCve(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + cve_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The CVE of the vulnerability. CVE cannot be
+         * empty and the combination of <cve, classification> should be unique
+         * across vulnerabilities for a VM.
+         * 
+ * + * string cve = 1; + * + * @return This builder for chaining. + */ + public Builder clearCve() { + + cve_ = getDefaultInstance().getCve(); + onChanged(); + return this; + } + /** + * + * + *
+         * The CVE of the vulnerability. CVE cannot be
+         * empty and the combination of <cve, classification> should be unique
+         * across vulnerabilities for a VM.
+         * 
+ * + * string cve = 1; + * + * @param value The bytes for cve to set. + * @return This builder for chaining. + */ + public Builder setCveBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + cve_ = value; + onChanged(); + return this; + } + + private float cvssV2Score_; + /** + * + * + *
+         * The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of
+         * 0 - 10 where 0 indicates low severity and 10 indicates high severity.
+         * 
+ * + * float cvss_v2_score = 2; + * + * @return The cvssV2Score. + */ + @java.lang.Override + public float getCvssV2Score() { + return cvssV2Score_; + } + /** + * + * + *
+         * The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of
+         * 0 - 10 where 0 indicates low severity and 10 indicates high severity.
+         * 
+ * + * float cvss_v2_score = 2; + * + * @param value The cvssV2Score to set. + * @return This builder for chaining. + */ + public Builder setCvssV2Score(float value) { + + cvssV2Score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of
+         * 0 - 10 where 0 indicates low severity and 10 indicates high severity.
+         * 
+ * + * float cvss_v2_score = 2; + * + * @return This builder for chaining. + */ + public Builder clearCvssV2Score() { + + cvssV2Score_ = 0F; + onChanged(); + return this; + } + + private com.google.cloud.osconfig.v1.CVSSv3 cvssV3_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.osconfig.v1.CVSSv3, + com.google.cloud.osconfig.v1.CVSSv3.Builder, + com.google.cloud.osconfig.v1.CVSSv3OrBuilder> + cvssV3Builder_; + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + * + * @return Whether the cvssV3 field is set. + */ + public boolean hasCvssV3() { + return cvssV3Builder_ != null || cvssV3_ != null; + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + * + * @return The cvssV3. + */ + public com.google.cloud.osconfig.v1.CVSSv3 getCvssV3() { + if (cvssV3Builder_ == null) { + return cvssV3_ == null + ? com.google.cloud.osconfig.v1.CVSSv3.getDefaultInstance() + : cvssV3_; + } else { + return cvssV3Builder_.getMessage(); + } + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + public Builder setCvssV3(com.google.cloud.osconfig.v1.CVSSv3 value) { + if (cvssV3Builder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cvssV3_ = value; + onChanged(); + } else { + cvssV3Builder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + public Builder setCvssV3(com.google.cloud.osconfig.v1.CVSSv3.Builder builderForValue) { + if (cvssV3Builder_ == null) { + cvssV3_ = builderForValue.build(); + onChanged(); + } else { + cvssV3Builder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + public Builder mergeCvssV3(com.google.cloud.osconfig.v1.CVSSv3 value) { + if (cvssV3Builder_ == null) { + if (cvssV3_ != null) { + cvssV3_ = + com.google.cloud.osconfig.v1.CVSSv3.newBuilder(cvssV3_) + .mergeFrom(value) + .buildPartial(); + } else { + cvssV3_ = value; + } + onChanged(); + } else { + cvssV3Builder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + public Builder clearCvssV3() { + if (cvssV3Builder_ == null) { + cvssV3_ = null; + onChanged(); + } else { + cvssV3_ = null; + cvssV3Builder_ = null; + } + + return this; + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + public com.google.cloud.osconfig.v1.CVSSv3.Builder getCvssV3Builder() { + + onChanged(); + return getCvssV3FieldBuilder().getBuilder(); + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + public com.google.cloud.osconfig.v1.CVSSv3OrBuilder getCvssV3OrBuilder() { + if (cvssV3Builder_ != null) { + return cvssV3Builder_.getMessageOrBuilder(); + } else { + return cvssV3_ == null + ? com.google.cloud.osconfig.v1.CVSSv3.getDefaultInstance() + : cvssV3_; + } + } + /** + * + * + *
+         * The full description of the CVSSv3 for this vulnerability from NVD.
+         * 
+ * + * .google.cloud.osconfig.v1.CVSSv3 cvss_v3 = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.osconfig.v1.CVSSv3, + com.google.cloud.osconfig.v1.CVSSv3.Builder, + com.google.cloud.osconfig.v1.CVSSv3OrBuilder> + getCvssV3FieldBuilder() { + if (cvssV3Builder_ == null) { + cvssV3Builder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.osconfig.v1.CVSSv3, + com.google.cloud.osconfig.v1.CVSSv3.Builder, + com.google.cloud.osconfig.v1.CVSSv3OrBuilder>( + getCvssV3(), getParentForChildren(), isClean()); + cvssV3_ = null; + } + return cvssV3Builder_; + } + + private java.lang.Object severity_ = ""; + /** + * + * + *
+         * Assigned severity/impact ranking from the distro.
+         * 
+ * + * string severity = 4; + * + * @return The severity. + */ + public java.lang.String getSeverity() { + java.lang.Object ref = severity_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + severity_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+         * Assigned severity/impact ranking from the distro.
+         * 
+ * + * string severity = 4; + * + * @return The bytes for severity. + */ + public com.google.protobuf.ByteString getSeverityBytes() { + java.lang.Object ref = severity_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + severity_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+         * Assigned severity/impact ranking from the distro.
+         * 
+ * + * string severity = 4; + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value; + onChanged(); + return this; + } + /** + * + * + *
+         * Assigned severity/impact ranking from the distro.
+         * 
+ * + * string severity = 4; + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + + severity_ = getDefaultInstance().getSeverity(); + onChanged(); + return this; + } + /** + * + * + *
+         * Assigned severity/impact ranking from the distro.
+         * 
+ * + * string severity = 4; + * + * @param value The bytes for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + severity_ = value; + onChanged(); + return this; + } + + private java.lang.Object description_ = ""; + /** + * + * + *
+         * The note or description describing the vulnerability from the distro.
+         * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+         * The note or description describing the vulnerability from the distro.
+         * 
+ * + * string description = 5; + * + * @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; + } + } + /** + * + * + *
+         * The note or description describing the vulnerability from the distro.
+         * 
+ * + * string description = 5; + * + * @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; + } + /** + * + * + *
+         * The note or description describing the vulnerability from the distro.
+         * 
+ * + * string description = 5; + * + * @return This builder for chaining. + */ + public Builder clearDescription() { + + description_ = getDefaultInstance().getDescription(); + onChanged(); + return this; + } + /** + * + * + *
+         * The note or description describing the vulnerability from the distro.
+         * 
+ * + * string description = 5; + * + * @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.util.List< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference> + references_ = java.util.Collections.emptyList(); + + private void ensureReferencesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + references_ = + new java.util.ArrayList< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference>(references_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder> + referencesBuilder_; + + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public java.util.List< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference> + getReferencesList() { + if (referencesBuilder_ == null) { + return java.util.Collections.unmodifiableList(references_); + } else { + return referencesBuilder_.getMessageList(); + } + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public int getReferencesCount() { + if (referencesBuilder_ == null) { + return references_.size(); + } else { + return referencesBuilder_.getCount(); + } + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + getReferences(int index) { + if (referencesBuilder_ == null) { + return references_.get(index); + } else { + return referencesBuilder_.getMessage(index); + } + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder setReferences( + int index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + value) { + if (referencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencesIsMutable(); + references_.set(index, value); + onChanged(); + } else { + referencesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder setReferences( + int index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.Builder + builderForValue) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.set(index, builderForValue.build()); + onChanged(); + } else { + referencesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder addReferences( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + value) { + if (referencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencesIsMutable(); + references_.add(value); + onChanged(); + } else { + referencesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder addReferences( + int index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + value) { + if (referencesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureReferencesIsMutable(); + references_.add(index, value); + onChanged(); + } else { + referencesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder addReferences( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.Builder + builderForValue) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.add(builderForValue.build()); + onChanged(); + } else { + referencesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder addReferences( + int index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference.Builder + builderForValue) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.add(index, builderForValue.build()); + onChanged(); + } else { + referencesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder addAllReferences( + java.lang.Iterable< + ? extends + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference> + values) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, references_); + onChanged(); + } else { + referencesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder clearReferences() { + if (referencesBuilder_ == null) { + references_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + referencesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public Builder removeReferences(int index) { + if (referencesBuilder_ == null) { + ensureReferencesIsMutable(); + references_.remove(index); + onChanged(); + } else { + referencesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder + getReferencesBuilder(int index) { + return getReferencesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder + getReferencesOrBuilder(int index) { + if (referencesBuilder_ == null) { + return references_.get(index); + } else { + return referencesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public java.util.List< + ? extends + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder> + getReferencesOrBuilderList() { + if (referencesBuilder_ != null) { + return referencesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(references_); + } + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder + addReferencesBuilder() { + return getReferencesFieldBuilder() + .addBuilder( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .getDefaultInstance()); + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder + addReferencesBuilder(int index) { + return getReferencesFieldBuilder() + .addBuilder( + index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .getDefaultInstance()); + } + /** + * + * + *
+         * Corresponds to the references attached to the `VulnerabilityDetails`.
+         * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference references = 6; + * + */ + public java.util.List< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder> + getReferencesBuilderList() { + return getReferencesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder> + getReferencesFieldBuilder() { + if (referencesBuilder_ == null) { + referencesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .Reference, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Reference + .Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .ReferenceOrBuilder>( + references_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + references_ = null; + } + return referencesBuilder_; + } + + @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.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details) + private static final com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details(); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser
PARSER = + new com.google.protobuf.AbstractParser
() { + @java.lang.Override + public Details parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Details(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.osconfig.v1.VulnerabilityReport.Vulnerability.Details + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int DETAILS_FIELD_NUMBER = 1; + private com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details_; + /** + * + * + *
+     * Contains metadata as per the upstream feed of the operating system and
+     * NVD.
+     * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + * @return Whether the details field is set. + */ + @java.lang.Override + public boolean hasDetails() { + return details_ != null; + } + /** + * + * + *
+     * Contains metadata as per the upstream feed of the operating system and
+     * NVD.
+     * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + * @return The details. + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details getDetails() { + return details_ == null + ? com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .getDefaultInstance() + : details_; + } + /** + * + * + *
+     * Contains metadata as per the upstream feed of the operating system and
+     * NVD.
+     * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder + getDetailsOrBuilder() { + return getDetails(); + } + + public static final int INSTALLED_INVENTORY_ITEM_IDS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList installedInventoryItemIds_; + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return A list containing the installedInventoryItemIds. + */ + public com.google.protobuf.ProtocolStringList getInstalledInventoryItemIdsList() { + return installedInventoryItemIds_; + } + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return The count of installedInventoryItemIds. + */ + public int getInstalledInventoryItemIdsCount() { + return installedInventoryItemIds_.size(); + } + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index of the element to return. + * @return The installedInventoryItemIds at the given index. + */ + public java.lang.String getInstalledInventoryItemIds(int index) { + return installedInventoryItemIds_.get(index); + } + /** + * + * + *
+     * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+     * This field displays the inventory items affected by this vulnerability.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. For some distros,
+     * this field may be empty.
+     * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the installedInventoryItemIds at the given index. + */ + public com.google.protobuf.ByteString getInstalledInventoryItemIdsBytes(int index) { + return installedInventoryItemIds_.getByteString(index); + } + + public static final int AVAILABLE_INVENTORY_ITEM_IDS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList availableInventoryItemIds_; + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return A list containing the availableInventoryItemIds. + */ + public com.google.protobuf.ProtocolStringList getAvailableInventoryItemIdsList() { + return availableInventoryItemIds_; + } + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return The count of availableInventoryItemIds. + */ + public int getAvailableInventoryItemIdsCount() { + return availableInventoryItemIds_.size(); + } + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index of the element to return. + * @return The availableInventoryItemIds at the given index. + */ + public java.lang.String getAvailableInventoryItemIds(int index) { + return availableInventoryItemIds_.get(index); + } + /** + * + * + *
+     * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+     * If the vulnerability report was not updated after the VM inventory
+     * update, these values might not display in VM inventory. If there is no
+     * available fix, the field is empty. The `inventory_item` value specifies
+     * the latest `SoftwarePackage` available to the VM that fixes the
+     * vulnerability.
+     * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the availableInventoryItemIds at the given index. + */ + public com.google.protobuf.ByteString getAvailableInventoryItemIdsBytes(int index) { + return availableInventoryItemIds_.getByteString(index); + } + + public static final int CREATE_TIME_FIELD_NUMBER = 4; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+     * The timestamp for when the vulnerability was first detected.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+     * The timestamp for when the vulnerability was first detected.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+     * The timestamp for when the vulnerability was first detected.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 5; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+     * The timestamp for when the vulnerability was last modified.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+     * The timestamp for when the vulnerability was last modified.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+     * The timestamp for when the vulnerability was last modified.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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 (details_ != null) { + output.writeMessage(1, getDetails()); + } + for (int i = 0; i < installedInventoryItemIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 2, installedInventoryItemIds_.getRaw(i)); + } + for (int i = 0; i < availableInventoryItemIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString( + output, 3, availableInventoryItemIds_.getRaw(i)); + } + if (createTime_ != null) { + output.writeMessage(4, getCreateTime()); + } + if (updateTime_ != null) { + output.writeMessage(5, getUpdateTime()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (details_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getDetails()); + } + { + int dataSize = 0; + for (int i = 0; i < installedInventoryItemIds_.size(); i++) { + dataSize += computeStringSizeNoTag(installedInventoryItemIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getInstalledInventoryItemIdsList().size(); + } + { + int dataSize = 0; + for (int i = 0; i < availableInventoryItemIds_.size(); i++) { + dataSize += computeStringSizeNoTag(availableInventoryItemIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getAvailableInventoryItemIdsList().size(); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getCreateTime()); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getUpdateTime()); + } + 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.osconfig.v1.VulnerabilityReport.Vulnerability)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability other = + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) obj; + + if (hasDetails() != other.hasDetails()) return false; + if (hasDetails()) { + if (!getDetails().equals(other.getDetails())) return false; + } + if (!getInstalledInventoryItemIdsList().equals(other.getInstalledInventoryItemIdsList())) + return false; + if (!getAvailableInventoryItemIdsList().equals(other.getAvailableInventoryItemIdsList())) + return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) 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 (hasDetails()) { + hash = (37 * hash) + DETAILS_FIELD_NUMBER; + hash = (53 * hash) + getDetails().hashCode(); + } + if (getInstalledInventoryItemIdsCount() > 0) { + hash = (37 * hash) + INSTALLED_INVENTORY_ITEM_IDS_FIELD_NUMBER; + hash = (53 * hash) + getInstalledInventoryItemIdsList().hashCode(); + } + if (getAvailableInventoryItemIdsCount() > 0) { + hash = (37 * hash) + AVAILABLE_INVENTORY_ITEM_IDS_FIELD_NUMBER; + hash = (53 * hash) + getAvailableInventoryItemIdsList().hashCode(); + } + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability 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.osconfig.v1.VulnerabilityReport.Vulnerability parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability 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.osconfig.v1.VulnerabilityReport.Vulnerability parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability 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.osconfig.v1.VulnerabilityReport.Vulnerability parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability 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.osconfig.v1.VulnerabilityReport.Vulnerability parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability 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.osconfig.v1.VulnerabilityReport.Vulnerability 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 vulnerability affecting the VM instance.
+     * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) + com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.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 (detailsBuilder_ == null) { + details_ = null; + } else { + details_ = null; + detailsBuilder_ = null; + } + installedInventoryItemIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + availableInventoryItemIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_Vulnerability_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability build() { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability buildPartial() { + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability result = + new com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability(this); + int from_bitField0_ = bitField0_; + if (detailsBuilder_ == null) { + result.details_ = details_; + } else { + result.details_ = detailsBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + installedInventoryItemIds_ = installedInventoryItemIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.installedInventoryItemIds_ = installedInventoryItemIds_; + if (((bitField0_ & 0x00000002) != 0)) { + availableInventoryItemIds_ = availableInventoryItemIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.availableInventoryItemIds_ = availableInventoryItemIds_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.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.osconfig.v1.VulnerabilityReport.Vulnerability) { + return mergeFrom((com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability other) { + if (other + == com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.getDefaultInstance()) + return this; + if (other.hasDetails()) { + mergeDetails(other.getDetails()); + } + if (!other.installedInventoryItemIds_.isEmpty()) { + if (installedInventoryItemIds_.isEmpty()) { + installedInventoryItemIds_ = other.installedInventoryItemIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstalledInventoryItemIdsIsMutable(); + installedInventoryItemIds_.addAll(other.installedInventoryItemIds_); + } + onChanged(); + } + if (!other.availableInventoryItemIds_.isEmpty()) { + if (availableInventoryItemIds_.isEmpty()) { + availableInventoryItemIds_ = other.availableInventoryItemIds_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAvailableInventoryItemIdsIsMutable(); + availableInventoryItemIds_.addAll(other.availableInventoryItemIds_); + } + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.osconfig.v1.VulnerabilityReport.Vulnerability parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder> + detailsBuilder_; + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + * + * @return Whether the details field is set. + */ + public boolean hasDetails() { + return detailsBuilder_ != null || details_ != null; + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + * + * @return The details. + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details getDetails() { + if (detailsBuilder_ == null) { + return details_ == null + ? com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .getDefaultInstance() + : details_; + } else { + return detailsBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + public Builder setDetails( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details value) { + if (detailsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + details_ = value; + onChanged(); + } else { + detailsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + public Builder setDetails( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder + builderForValue) { + if (detailsBuilder_ == null) { + details_ = builderForValue.build(); + onChanged(); + } else { + detailsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + public Builder mergeDetails( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details value) { + if (detailsBuilder_ == null) { + if (details_ != null) { + details_ = + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.newBuilder( + details_) + .mergeFrom(value) + .buildPartial(); + } else { + details_ = value; + } + onChanged(); + } else { + detailsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + public Builder clearDetails() { + if (detailsBuilder_ == null) { + details_ = null; + onChanged(); + } else { + details_ = null; + detailsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder + getDetailsBuilder() { + + onChanged(); + return getDetailsFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder + getDetailsOrBuilder() { + if (detailsBuilder_ != null) { + return detailsBuilder_.getMessageOrBuilder(); + } else { + return details_ == null + ? com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details + .getDefaultInstance() + : details_; + } + } + /** + * + * + *
+       * Contains metadata as per the upstream feed of the operating system and
+       * NVD.
+       * 
+ * + * .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details details = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder> + getDetailsFieldBuilder() { + if (detailsBuilder_ == null) { + detailsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Details.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.DetailsOrBuilder>( + getDetails(), getParentForChildren(), isClean()); + details_ = null; + } + return detailsBuilder_; + } + + private com.google.protobuf.LazyStringList installedInventoryItemIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureInstalledInventoryItemIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + installedInventoryItemIds_ = + new com.google.protobuf.LazyStringArrayList(installedInventoryItemIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return A list containing the installedInventoryItemIds. + */ + public com.google.protobuf.ProtocolStringList getInstalledInventoryItemIdsList() { + return installedInventoryItemIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return The count of installedInventoryItemIds. + */ + public int getInstalledInventoryItemIdsCount() { + return installedInventoryItemIds_.size(); + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index of the element to return. + * @return The installedInventoryItemIds at the given index. + */ + public java.lang.String getInstalledInventoryItemIds(int index) { + return installedInventoryItemIds_.get(index); + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index of the value to return. + * @return The bytes of the installedInventoryItemIds at the given index. + */ + public com.google.protobuf.ByteString getInstalledInventoryItemIdsBytes(int index) { + return installedInventoryItemIds_.getByteString(index); + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param index The index to set the value at. + * @param value The installedInventoryItemIds to set. + * @return This builder for chaining. + */ + public Builder setInstalledInventoryItemIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstalledInventoryItemIdsIsMutable(); + installedInventoryItemIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param value The installedInventoryItemIds to add. + * @return This builder for chaining. + */ + public Builder addInstalledInventoryItemIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstalledInventoryItemIdsIsMutable(); + installedInventoryItemIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param values The installedInventoryItemIds to add. + * @return This builder for chaining. + */ + public Builder addAllInstalledInventoryItemIds(java.lang.Iterable values) { + ensureInstalledInventoryItemIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, installedInventoryItemIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @return This builder for chaining. + */ + public Builder clearInstalledInventoryItemIds() { + installedInventoryItemIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM.
+       * This field displays the inventory items affected by this vulnerability.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. For some distros,
+       * this field may be empty.
+       * 
+ * + * repeated string installed_inventory_item_ids = 2; + * + * @param value The bytes of the installedInventoryItemIds to add. + * @return This builder for chaining. + */ + public Builder addInstalledInventoryItemIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureInstalledInventoryItemIdsIsMutable(); + installedInventoryItemIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList availableInventoryItemIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAvailableInventoryItemIdsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + availableInventoryItemIds_ = + new com.google.protobuf.LazyStringArrayList(availableInventoryItemIds_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return A list containing the availableInventoryItemIds. + */ + public com.google.protobuf.ProtocolStringList getAvailableInventoryItemIdsList() { + return availableInventoryItemIds_.getUnmodifiableView(); + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return The count of availableInventoryItemIds. + */ + public int getAvailableInventoryItemIdsCount() { + return availableInventoryItemIds_.size(); + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index of the element to return. + * @return The availableInventoryItemIds at the given index. + */ + public java.lang.String getAvailableInventoryItemIds(int index) { + return availableInventoryItemIds_.get(index); + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index of the value to return. + * @return The bytes of the availableInventoryItemIds at the given index. + */ + public com.google.protobuf.ByteString getAvailableInventoryItemIdsBytes(int index) { + return availableInventoryItemIds_.getByteString(index); + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param index The index to set the value at. + * @param value The availableInventoryItemIds to set. + * @return This builder for chaining. + */ + public Builder setAvailableInventoryItemIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableInventoryItemIdsIsMutable(); + availableInventoryItemIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param value The availableInventoryItemIds to add. + * @return This builder for chaining. + */ + public Builder addAvailableInventoryItemIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAvailableInventoryItemIdsIsMutable(); + availableInventoryItemIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param values The availableInventoryItemIds to add. + * @return This builder for chaining. + */ + public Builder addAllAvailableInventoryItemIds(java.lang.Iterable values) { + ensureAvailableInventoryItemIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, availableInventoryItemIds_); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @return This builder for chaining. + */ + public Builder clearAvailableInventoryItemIds() { + availableInventoryItemIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+       * Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM.
+       * If the vulnerability report was not updated after the VM inventory
+       * update, these values might not display in VM inventory. If there is no
+       * available fix, the field is empty. The `inventory_item` value specifies
+       * the latest `SoftwarePackage` available to the VM that fixes the
+       * vulnerability.
+       * 
+ * + * repeated string available_inventory_item_ids = 3; + * + * @param value The bytes of the availableInventoryItemIds to add. + * @return This builder for chaining. + */ + public Builder addAvailableInventoryItemIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAvailableInventoryItemIdsIsMutable(); + availableInventoryItemIds_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + * + * @return The createTime. + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_) + .mergeFrom(value) + .buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+       * The timestamp for when the vulnerability was first detected.
+       * 
+ * + * .google.protobuf.Timestamp create_time = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_) + .mergeFrom(value) + .buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+       * The timestamp for when the vulnerability was last modified.
+       * 
+ * + * .google.protobuf.Timestamp update_time = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @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.osconfig.v1.VulnerabilityReport.Vulnerability) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability) + private static final com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability(); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Vulnerability parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Vulnerability(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.osconfig.v1.VulnerabilityReport.Vulnerability + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The `vulnerabilityReport` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `vulnerabilityReport` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 VULNERABILITIES_FIELD_NUMBER = 2; + private java.util.List + vulnerabilities_; + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getVulnerabilitiesList() { + return vulnerabilities_; + } + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder> + getVulnerabilitiesOrBuilderList() { + return vulnerabilities_; + } + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getVulnerabilitiesCount() { + return vulnerabilities_.size(); + } + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability getVulnerabilities( + int index) { + return vulnerabilities_.get(index); + } + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder + getVulnerabilitiesOrBuilder(int index) { + return vulnerabilities_.get(index); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. The timestamp for when the last vulnerability report was generated for the
+   * VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp for when the last vulnerability report was generated for the
+   * VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. The timestamp for when the last vulnerability report was generated for the
+   * VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + 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_); + } + for (int i = 0; i < vulnerabilities_.size(); i++) { + output.writeMessage(2, vulnerabilities_.get(i)); + } + if (updateTime_ != null) { + output.writeMessage(3, getUpdateTime()); + } + 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_); + } + for (int i = 0; i < vulnerabilities_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, vulnerabilities_.get(i)); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + 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.osconfig.v1.VulnerabilityReport)) { + return super.equals(obj); + } + com.google.cloud.osconfig.v1.VulnerabilityReport other = + (com.google.cloud.osconfig.v1.VulnerabilityReport) obj; + + if (!getName().equals(other.getName())) return false; + if (!getVulnerabilitiesList().equals(other.getVulnerabilitiesList())) return false; + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) 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(); + if (getVulnerabilitiesCount() > 0) { + hash = (37 * hash) + VULNERABILITIES_FIELD_NUMBER; + hash = (53 * hash) + getVulnerabilitiesList().hashCode(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport 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.osconfig.v1.VulnerabilityReport parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport 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.osconfig.v1.VulnerabilityReport parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport 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.osconfig.v1.VulnerabilityReport parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport 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.osconfig.v1.VulnerabilityReport parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport 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.osconfig.v1.VulnerabilityReport 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; + } + /** + * + * + *
+   * This API resource represents the vulnerability report for a specified
+   * Compute Engine virtual machine (VM) instance at a given point in time.
+   * For more information, see [Vulnerability
+   * reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports).
+   * 
+ * + * Protobuf type {@code google.cloud.osconfig.v1.VulnerabilityReport} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.osconfig.v1.VulnerabilityReport) + com.google.cloud.osconfig.v1.VulnerabilityReportOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.osconfig.v1.VulnerabilityReport.class, + com.google.cloud.osconfig.v1.VulnerabilityReport.Builder.class); + } + + // Construct using com.google.cloud.osconfig.v1.VulnerabilityReport.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getVulnerabilitiesFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (vulnerabilitiesBuilder_ == null) { + vulnerabilities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + vulnerabilitiesBuilder_.clear(); + } + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.osconfig.v1.VulnerabilityProto + .internal_static_google_cloud_osconfig_v1_VulnerabilityReport_descriptor; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport getDefaultInstanceForType() { + return com.google.cloud.osconfig.v1.VulnerabilityReport.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport build() { + com.google.cloud.osconfig.v1.VulnerabilityReport result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.osconfig.v1.VulnerabilityReport buildPartial() { + com.google.cloud.osconfig.v1.VulnerabilityReport result = + new com.google.cloud.osconfig.v1.VulnerabilityReport(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + if (vulnerabilitiesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + vulnerabilities_ = java.util.Collections.unmodifiableList(vulnerabilities_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.vulnerabilities_ = vulnerabilities_; + } else { + result.vulnerabilities_ = vulnerabilitiesBuilder_.build(); + } + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.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.osconfig.v1.VulnerabilityReport) { + return mergeFrom((com.google.cloud.osconfig.v1.VulnerabilityReport) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.osconfig.v1.VulnerabilityReport other) { + if (other == com.google.cloud.osconfig.v1.VulnerabilityReport.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (vulnerabilitiesBuilder_ == null) { + if (!other.vulnerabilities_.isEmpty()) { + if (vulnerabilities_.isEmpty()) { + vulnerabilities_ = other.vulnerabilities_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.addAll(other.vulnerabilities_); + } + onChanged(); + } + } else { + if (!other.vulnerabilities_.isEmpty()) { + if (vulnerabilitiesBuilder_.isEmpty()) { + vulnerabilitiesBuilder_.dispose(); + vulnerabilitiesBuilder_ = null; + vulnerabilities_ = other.vulnerabilities_; + bitField0_ = (bitField0_ & ~0x00000001); + vulnerabilitiesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getVulnerabilitiesFieldBuilder() + : null; + } else { + vulnerabilitiesBuilder_.addAllMessages(other.vulnerabilities_); + } + } + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + 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.osconfig.v1.VulnerabilityReport parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.osconfig.v1.VulnerabilityReport) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The `vulnerabilityReport` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `vulnerabilityReport` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `vulnerabilityReport` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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 `vulnerabilityReport` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The `vulnerabilityReport` API resource name.
+     * Format:
+     * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @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.util.List + vulnerabilities_ = java.util.Collections.emptyList(); + + private void ensureVulnerabilitiesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + vulnerabilities_ = + new java.util.ArrayList( + vulnerabilities_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder> + vulnerabilitiesBuilder_; + + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getVulnerabilitiesList() { + if (vulnerabilitiesBuilder_ == null) { + return java.util.Collections.unmodifiableList(vulnerabilities_); + } else { + return vulnerabilitiesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getVulnerabilitiesCount() { + if (vulnerabilitiesBuilder_ == null) { + return vulnerabilities_.size(); + } else { + return vulnerabilitiesBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability getVulnerabilities( + int index) { + if (vulnerabilitiesBuilder_ == null) { + return vulnerabilities_.get(index); + } else { + return vulnerabilitiesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVulnerabilities( + int index, com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability value) { + if (vulnerabilitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.set(index, value); + onChanged(); + } else { + vulnerabilitiesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setVulnerabilities( + int index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder builderForValue) { + if (vulnerabilitiesBuilder_ == null) { + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.set(index, builderForValue.build()); + onChanged(); + } else { + vulnerabilitiesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVulnerabilities( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability value) { + if (vulnerabilitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.add(value); + onChanged(); + } else { + vulnerabilitiesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVulnerabilities( + int index, com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability value) { + if (vulnerabilitiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.add(index, value); + onChanged(); + } else { + vulnerabilitiesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVulnerabilities( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder builderForValue) { + if (vulnerabilitiesBuilder_ == null) { + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.add(builderForValue.build()); + onChanged(); + } else { + vulnerabilitiesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addVulnerabilities( + int index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder builderForValue) { + if (vulnerabilitiesBuilder_ == null) { + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.add(index, builderForValue.build()); + onChanged(); + } else { + vulnerabilitiesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllVulnerabilities( + java.lang.Iterable + values) { + if (vulnerabilitiesBuilder_ == null) { + ensureVulnerabilitiesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, vulnerabilities_); + onChanged(); + } else { + vulnerabilitiesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearVulnerabilities() { + if (vulnerabilitiesBuilder_ == null) { + vulnerabilities_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + vulnerabilitiesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeVulnerabilities(int index) { + if (vulnerabilitiesBuilder_ == null) { + ensureVulnerabilitiesIsMutable(); + vulnerabilities_.remove(index); + onChanged(); + } else { + vulnerabilitiesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder + getVulnerabilitiesBuilder(int index) { + return getVulnerabilitiesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder + getVulnerabilitiesOrBuilder(int index) { + if (vulnerabilitiesBuilder_ == null) { + return vulnerabilities_.get(index); + } else { + return vulnerabilitiesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder> + getVulnerabilitiesOrBuilderList() { + if (vulnerabilitiesBuilder_ != null) { + return vulnerabilitiesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(vulnerabilities_); + } + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder + addVulnerabilitiesBuilder() { + return getVulnerabilitiesFieldBuilder() + .addBuilder( + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder + addVulnerabilitiesBuilder(int index) { + return getVulnerabilitiesFieldBuilder() + .addBuilder( + index, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. List of vulnerabilities affecting the VM.
+     * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getVulnerabilitiesBuilderList() { + return getVulnerabilitiesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder> + getVulnerabilitiesFieldBuilder() { + if (vulnerabilitiesBuilder_ == null) { + vulnerabilitiesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability, + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability.Builder, + com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder>( + vulnerabilities_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + vulnerabilities_ = null; + } + return vulnerabilitiesBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + onChanged(); + } else { + updateTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (updateTime_ != null) { + updateTime_ = + com.google.protobuf.Timestamp.newBuilder(updateTime_).mergeFrom(value).buildPartial(); + } else { + updateTime_ = value; + } + onChanged(); + } else { + updateTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp for when the last vulnerability report was generated for the
+     * VM.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + @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.osconfig.v1.VulnerabilityReport) + } + + // @@protoc_insertion_point(class_scope:google.cloud.osconfig.v1.VulnerabilityReport) + private static final com.google.cloud.osconfig.v1.VulnerabilityReport DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.osconfig.v1.VulnerabilityReport(); + } + + public static com.google.cloud.osconfig.v1.VulnerabilityReport getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public VulnerabilityReport parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new VulnerabilityReport(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.osconfig.v1.VulnerabilityReport getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportName.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportName.java new file mode 100644 index 00000000..db956cba --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportName.java @@ -0,0 +1,225 @@ +/* + * Copyright 2021 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.osconfig.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; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class VulnerabilityReportName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + + @Deprecated + protected VulnerabilityReportName() { + project = null; + location = null; + instance = null; + } + + private VulnerabilityReportName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static VulnerabilityReportName of(String project, String location, String instance) { + return newBuilder().setProject(project).setLocation(location).setInstance(instance).build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static VulnerabilityReportName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE.validatedMatch( + formattedString, "VulnerabilityReportName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + 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 (VulnerabilityReportName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE.instantiate( + "project", project, "location", location, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null || getClass() == o.getClass()) { + VulnerabilityReportName that = ((VulnerabilityReportName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** + * Builder for projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport. + */ + public static class Builder { + private String project; + private String location; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(VulnerabilityReportName vulnerabilityReportName) { + this.project = vulnerabilityReportName.project; + this.location = vulnerabilityReportName.location; + this.instance = vulnerabilityReportName.instance; + } + + public VulnerabilityReportName build() { + return new VulnerabilityReportName(this); + } + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportOrBuilder.java b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportOrBuilder.java new file mode 100644 index 00000000..24a26a35 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/java/com/google/cloud/osconfig/v1/VulnerabilityReportOrBuilder.java @@ -0,0 +1,159 @@ +/* + * 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/osconfig/v1/vulnerability.proto + +package com.google.cloud.osconfig.v1; + +public interface VulnerabilityReportOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.osconfig.v1.VulnerabilityReport) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The `vulnerabilityReport` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The `vulnerabilityReport` API resource name.
+   * Format:
+   * `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getVulnerabilitiesList(); + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability getVulnerabilities(int index); + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getVulnerabilitiesCount(); + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getVulnerabilitiesOrBuilderList(); + /** + * + * + *
+   * Output only. List of vulnerabilities affecting the VM.
+   * 
+ * + * + * repeated .google.cloud.osconfig.v1.VulnerabilityReport.Vulnerability vulnerabilities = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.osconfig.v1.VulnerabilityReport.VulnerabilityOrBuilder + getVulnerabilitiesOrBuilder(int index); + + /** + * + * + *
+   * Output only. The timestamp for when the last vulnerability report was generated for the
+   * VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp for when the last vulnerability report was generated for the
+   * VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. The timestamp for when the last vulnerability report was generated for the
+   * VM.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); +} diff --git a/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/inventory.proto b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/inventory.proto index 11c998ac..8f89d8b8 100644 --- a/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/inventory.proto +++ b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/inventory.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,8 @@ syntax = "proto3"; package google.cloud.osconfig.v1; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; import "google/protobuf/timestamp.proto"; import "google/type/date.proto"; @@ -30,8 +32,19 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; // OS Config Inventory is a service for collecting and reporting operating // system and package information on VM instances. -// The inventory details of a VM. +// This API resource represents the available inventory data for a +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// You can use this API resource to determine the inventory data of your VM. +// +// For more information, see [Information provided by OS inventory +// management](https://cloud.google.com/compute/docs/instances/os-inventory-management#data-collected). message Inventory { + option (google.api.resource) = { + type: "osconfig.googleapis.com/Inventory" + pattern: "projects/{project}/locations/{location}/instances/{instance}/inventory" + }; + // Operating system information for the VM. message OsInfo { // The VM hostname. @@ -154,7 +167,7 @@ message Inventory { // Details of a COS package. VersionedPackage cos_package = 8; - // Details of a Windows Application + // Details of Windows Application. WindowsApplication windows_application = 9; } } @@ -172,6 +185,21 @@ message Inventory { string version = 3; } + // Details related to a Zypper Patch. + message ZypperPatch { + // The name of the patch. + string patch_name = 5; + + // The category of the patch. + string category = 2; + + // The severity specified for this patch + string severity = 3; + + // Any summary information provided about this patch. + string summary = 4; + } + // Details related to a Windows Update package. // Field data and names are taken from Windows Update API IUpdate Interface: // https://docs.microsoft.com/en-us/windows/win32/api/_wua/ @@ -218,21 +246,6 @@ message Inventory { google.protobuf.Timestamp last_deployment_change_time = 10; } - // Details related to a Zypper Patch. - message ZypperPatch { - // The name of the patch. - string patch_name = 5; - - // The category of the patch. - string category = 2; - - // The severity specified for this patch - string severity = 3; - - // Any summary information provided about this patch. - string summary = 4; - } - // Information related to a Quick Fix Engineering package. // Fields are taken from Windows QuickFixEngineering Interface and match // the source names: @@ -276,6 +289,12 @@ message Inventory { string help_link = 5; } + // Output only. The `Inventory` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/inventory` + string name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Base level operating system information for the VM. OsInfo os_info = 1; @@ -284,4 +303,84 @@ message Inventory { // addressable inventory item and will change, when there is a new package // version. map items = 2; + + // Output only. Timestamp of the last reported inventory for the VM. + google.protobuf.Timestamp update_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting inventory data for the specified VM. +message GetInventoryRequest { + // Required. API resource name for inventory resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/inventory` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/Inventory" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; +} + +// A request message for listing inventory data for all VMs in the specified +// location. +message ListInventoriesRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // Inventory view indicating what information should be included in the + // inventory resource. If unspecified, the default view is BASIC. + InventoryView view = 2; + + // The maximum number of results to return. + int32 page_size = 3; + + // A pagination token returned from a previous call to + // `ListInventories` that indicates where this listing + // should continue from. + string page_token = 4; + + // If provided, this field specifies the criteria that must be met by a + // `Inventory` API resource to be included in the response. + string filter = 5; +} + +// A response message for listing inventory data for all VMs in a specified +// location. +message ListInventoriesResponse { + // List of inventory objects. + repeated Inventory inventories = 1; + + // The pagination token to retrieve the next page of inventory objects. + string next_page_token = 2; +} + +// The view for inventory objects. +enum InventoryView { + // The default value. + // The API defaults to the BASIC view. + INVENTORY_VIEW_UNSPECIFIED = 0; + + // Returns the basic inventory information that includes `os_info`. + BASIC = 1; + + // Returns all fields. + FULL = 2; } diff --git a/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_service.proto b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_service.proto index 2a654eaa..88857b26 100644 --- a/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_service.proto +++ b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_service.proto @@ -32,6 +32,7 @@ option ruby_package = "Google::Cloud::OsConfig::V1"; option (google.api.resource_definition) = { type: "compute.googleapis.com/Instance" pattern: "projects/{project}/zones/{zone}/instances/{instance}" + pattern: "projects/{project}/locations/{location}/instances/{instance}" }; // OS Config API diff --git a/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_zonal_service.proto b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_zonal_service.proto new file mode 100644 index 00000000..22219f53 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/osconfig_zonal_service.proto @@ -0,0 +1,74 @@ +// Copyright 2021 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.osconfig.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/resource.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/cloud/osconfig/v1/vulnerability.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "OsConfigZonalServiceProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// Zonal OS Config API +// +// The OS Config service is the server-side component that allows users to +// manage package installations and patch jobs for Compute Engine VM instances. +service OsConfigZonalService { + option (google.api.default_host) = "osconfig.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Get inventory data for the specified VM instance. If the VM has no + // associated inventory, the message `NOT_FOUND` is returned. + rpc GetInventory(GetInventoryRequest) returns (Inventory) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/inventory}" + }; + option (google.api.method_signature) = "name"; + } + + // List inventory data for all VM instances in the specified zone. + rpc ListInventories(ListInventoriesRequest) returns (ListInventoriesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/inventories" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the vulnerability report for the specified VM instance. Only VMs with + // inventory data have vulnerability reports associated with them. + rpc GetVulnerabilityReport(GetVulnerabilityReportRequest) returns (VulnerabilityReport) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*/vulnerabilityReport}" + }; + option (google.api.method_signature) = "name"; + } + + // List vulnerability reports for all VM instances in the specified zone. + rpc ListVulnerabilityReports(ListVulnerabilityReportsRequest) returns (ListVulnerabilityReportsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/instances/*}/vulnerabilityReports" + }; + option (google.api.method_signature) = "parent"; + } +} diff --git a/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/vulnerability.proto b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/vulnerability.proto new file mode 100644 index 00000000..af86fbe0 --- /dev/null +++ b/proto-google-cloud-os-config-v1/src/main/proto/google/cloud/osconfig/v1/vulnerability.proto @@ -0,0 +1,336 @@ +// Copyright 2021 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.osconfig.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.OsConfig.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/osconfig/v1;osconfig"; +option java_multiple_files = true; +option java_outer_classname = "VulnerabilityProto"; +option java_package = "com.google.cloud.osconfig.v1"; +option php_namespace = "Google\\Cloud\\OsConfig\\V1"; +option ruby_package = "Google::Cloud::OsConfig::V1"; + +// This API resource represents the vulnerability report for a specified +// Compute Engine virtual machine (VM) instance at a given point in time. +// +// For more information, see [Vulnerability +// reports](https://cloud.google.com/compute/docs/instances/os-inventory-management#vulnerability-reports). +message VulnerabilityReport { + option (google.api.resource) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + pattern: "projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport" + }; + + // A vulnerability affecting the VM instance. + message Vulnerability { + // Contains metadata information for the vulnerability. This information is + // collected from the upstream feed of the operating system. + message Details { + // A reference for this vulnerability. + message Reference { + // The url of the reference. + string url = 1; + + // The source of the reference e.g. NVD. + string source = 2; + } + + // The CVE of the vulnerability. CVE cannot be + // empty and the combination of should be unique + // across vulnerabilities for a VM. + string cve = 1; + + // The CVSS V2 score of this vulnerability. CVSS V2 score is on a scale of + // 0 - 10 where 0 indicates low severity and 10 indicates high severity. + float cvss_v2_score = 2; + + // The full description of the CVSSv3 for this vulnerability from NVD. + CVSSv3 cvss_v3 = 3; + + // Assigned severity/impact ranking from the distro. + string severity = 4; + + // The note or description describing the vulnerability from the distro. + string description = 5; + + // Corresponds to the references attached to the `VulnerabilityDetails`. + repeated Reference references = 6; + } + + // Contains metadata as per the upstream feed of the operating system and + // NVD. + Details details = 1; + + // Corresponds to the `INSTALLED_PACKAGE` inventory item on the VM. + // This field displays the inventory items affected by this vulnerability. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. For some distros, + // this field may be empty. + repeated string installed_inventory_item_ids = 2; + + // Corresponds to the `AVAILABLE_PACKAGE` inventory item on the VM. + // If the vulnerability report was not updated after the VM inventory + // update, these values might not display in VM inventory. If there is no + // available fix, the field is empty. The `inventory_item` value specifies + // the latest `SoftwarePackage` available to the VM that fixes the + // vulnerability. + repeated string available_inventory_item_ids = 3; + + // The timestamp for when the vulnerability was first detected. + google.protobuf.Timestamp create_time = 4; + + // The timestamp for when the vulnerability was last modified. + google.protobuf.Timestamp update_time = 5; + } + + // Output only. The `vulnerabilityReport` API resource name. + // + // Format: + // `projects/{project_number}/locations/{location}/instances/{instance_id}/vulnerabilityReport` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of vulnerabilities affecting the VM. + repeated Vulnerability vulnerabilities = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The timestamp for when the last vulnerability report was generated for the + // VM. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A request message for getting the vulnerability report for the specified VM. +message GetVulnerabilityReportRequest { + // Required. API resource name for vulnerability resource. + // + // Format: + // `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + // For `{instance}`, either Compute Engine `instance-id` or `instance-name` + // can be provided. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "osconfig.googleapis.com/VulnerabilityReport" + } + ]; +} + +// A request message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsRequest { + // Required. The parent resource name. + // + // Format: `projects/{project}/locations/{location}/instances/-` + // + // For `{project}`, either `project-number` or `project-id` can be provided. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Instance" + } + ]; + + // The maximum number of results to return. + int32 page_size = 2; + + // A pagination token returned from a previous call to + // `ListVulnerabilityReports` that indicates where this listing + // should continue from. + string page_token = 3; + + // If provided, this field specifies the criteria that must be met by a + // `vulnerabilityReport` API resource to be included in the response. + string filter = 4; +} + +// A response message for listing vulnerability reports for all VM instances in +// the specified location. +message ListVulnerabilityReportsResponse { + // List of vulnerabilityReport objects. + repeated VulnerabilityReport vulnerability_reports = 1; + + // The pagination token to retrieve the next page of vulnerabilityReports + // object. + string next_page_token = 2; +} + +// Common Vulnerability Scoring System version 3. +// For details, see https://www.first.org/cvss/specification-document +message CVSSv3 { + // This metric reflects the context by which vulnerability exploitation is + // possible. + enum AttackVector { + // Invalid value. + ATTACK_VECTOR_UNSPECIFIED = 0; + + // The vulnerable component is bound to the network stack and the set of + // possible attackers extends beyond the other options listed below, up to + // and including the entire Internet. + ATTACK_VECTOR_NETWORK = 1; + + // The vulnerable component is bound to the network stack, but the attack is + // limited at the protocol level to a logically adjacent topology. + ATTACK_VECTOR_ADJACENT = 2; + + // The vulnerable component is not bound to the network stack and the + // attacker's path is via read/write/execute capabilities. + ATTACK_VECTOR_LOCAL = 3; + + // The attack requires the attacker to physically touch or manipulate the + // vulnerable component. + ATTACK_VECTOR_PHYSICAL = 4; + } + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + enum AttackComplexity { + // Invalid value. + ATTACK_COMPLEXITY_UNSPECIFIED = 0; + + // Specialized access conditions or extenuating circumstances do not exist. + // An attacker can expect repeatable success when attacking the vulnerable + // component. + ATTACK_COMPLEXITY_LOW = 1; + + // A successful attack depends on conditions beyond the attacker's control. + // That is, a successful attack cannot be accomplished at will, but requires + // the attacker to invest in some measurable amount of effort in preparation + // or execution against the vulnerable component before a successful attack + // can be expected. + ATTACK_COMPLEXITY_HIGH = 2; + } + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + enum PrivilegesRequired { + // Invalid value. + PRIVILEGES_REQUIRED_UNSPECIFIED = 0; + + // The attacker is unauthorized prior to attack, and therefore does not + // require any access to settings or files of the vulnerable system to + // carry out an attack. + PRIVILEGES_REQUIRED_NONE = 1; + + // The attacker requires privileges that provide basic user capabilities + // that could normally affect only settings and files owned by a user. + // Alternatively, an attacker with Low privileges has the ability to access + // only non-sensitive resources. + PRIVILEGES_REQUIRED_LOW = 2; + + // The attacker requires privileges that provide significant (e.g., + // administrative) control over the vulnerable component allowing access to + // component-wide settings and files. + PRIVILEGES_REQUIRED_HIGH = 3; + } + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + enum UserInteraction { + // Invalid value. + USER_INTERACTION_UNSPECIFIED = 0; + + // The vulnerable system can be exploited without interaction from any user. + USER_INTERACTION_NONE = 1; + + // Successful exploitation of this vulnerability requires a user to take + // some action before the vulnerability can be exploited. + USER_INTERACTION_REQUIRED = 2; + } + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + enum Scope { + // Invalid value. + SCOPE_UNSPECIFIED = 0; + + // An exploited vulnerability can only affect resources managed by the same + // security authority. + SCOPE_UNCHANGED = 1; + + // An exploited vulnerability can affect resources beyond the security scope + // managed by the security authority of the vulnerable component. + SCOPE_CHANGED = 2; + } + + // The Impact metrics capture the effects of a successfully exploited + // vulnerability on the component that suffers the worst outcome that is most + // directly and predictably associated with the attack. + enum Impact { + // Invalid value. + IMPACT_UNSPECIFIED = 0; + + // High impact. + IMPACT_HIGH = 1; + + // Low impact. + IMPACT_LOW = 2; + + // No impact. + IMPACT_NONE = 3; + } + + // The base score is a function of the base metric scores. + // https://www.first.org/cvss/specification-document#Base-Metrics + float base_score = 1; + + // The Exploitability sub-score equation is derived from the Base + // Exploitability metrics. + // https://www.first.org/cvss/specification-document#2-1-Exploitability-Metrics + float exploitability_score = 2; + + // The Impact sub-score equation is derived from the Base Impact metrics. + float impact_score = 3; + + // This metric reflects the context by which vulnerability exploitation is + // possible. + AttackVector attack_vector = 5; + + // This metric describes the conditions beyond the attacker's control that + // must exist in order to exploit the vulnerability. + AttackComplexity attack_complexity = 6; + + // This metric describes the level of privileges an attacker must possess + // before successfully exploiting the vulnerability. + PrivilegesRequired privileges_required = 7; + + // This metric captures the requirement for a human user, other than the + // attacker, to participate in the successful compromise of the vulnerable + // component. + UserInteraction user_interaction = 8; + + // The Scope metric captures whether a vulnerability in one vulnerable + // component impacts resources in components beyond its security scope. + Scope scope = 9; + + // This metric measures the impact to the confidentiality of the information + // resources managed by a software component due to a successfully exploited + // vulnerability. + Impact confidentiality_impact = 10; + + // This metric measures the impact to integrity of a successfully exploited + // vulnerability. + Impact integrity_impact = 11; + + // This metric measures the impact to the availability of the impacted + // component resulting from a successfully exploited vulnerability. + Impact availability_impact = 12; +}