From 659e87f38bee5eeecf5568224dafdb46f63f095b Mon Sep 17 00:00:00 2001 From: Neenu Shaji Date: Thu, 27 May 2021 16:34:03 -0400 Subject: [PATCH] feat: add v1p7beta1 client (#723) --- google-cloud-asset-bom/pom.xml | 27 +- google-cloud-asset/pom.xml | 13 +- .../asset/v1p7beta1/AssetServiceClient.java | 302 ++ .../asset/v1p7beta1/AssetServiceSettings.java | 197 + .../cloud/asset/v1p7beta1/gapic_metadata.json | 21 + .../cloud/asset/v1p7beta1/package-info.java | 44 + .../v1p7beta1/stub/AssetServiceStub.java | 54 + .../stub/AssetServiceStubSettings.java | 322 ++ .../stub/GrpcAssetServiceCallableFactory.java | 115 + .../v1p7beta1/stub/GrpcAssetServiceStub.java | 176 + .../v1p7beta1/AssetServiceClientTest.java | 153 + .../asset/v1p7beta1/MockAssetService.java | 59 + .../asset/v1p7beta1/MockAssetServiceImpl.java | 82 + grpc-google-cloud-asset-v1p7beta1/pom.xml | 69 + .../asset/v1p7beta1/AssetServiceGrpc.java | 392 ++ pom.xml | 26 +- .../clirr-ignored-differences.xml | 19 + proto-google-cloud-asset-v1p7beta1/pom.xml | 50 + .../google/cloud/asset/v1p7beta1/Asset.java | 4074 +++++++++++++++++ .../cloud/asset/v1p7beta1/AssetOrBuilder.java | 519 +++ .../cloud/asset/v1p7beta1/AssetProto.java | 202 + .../asset/v1p7beta1/AssetServiceProto.java | 235 + .../asset/v1p7beta1/BigQueryDestination.java | 1580 +++++++ .../BigQueryDestinationOrBuilder.java | 214 + .../cloud/asset/v1p7beta1/ContentType.java | 242 + .../asset/v1p7beta1/ExportAssetsRequest.java | 2302 ++++++++++ .../ExportAssetsRequestOrBuilder.java | 368 ++ .../asset/v1p7beta1/ExportAssetsResponse.java | 1337 ++++++ .../ExportAssetsResponseOrBuilder.java | 142 + .../cloud/asset/v1p7beta1/GcsDestination.java | 1110 +++++ .../v1p7beta1/GcsDestinationOrBuilder.java | 137 + .../asset/v1p7beta1/GcsOutputResult.java | 749 +++ .../v1p7beta1/GcsOutputResultOrBuilder.java | 80 + .../cloud/asset/v1p7beta1/OutputConfig.java | 1164 +++++ .../v1p7beta1/OutputConfigOrBuilder.java | 100 + .../cloud/asset/v1p7beta1/OutputResult.java | 834 ++++ .../v1p7beta1/OutputResultOrBuilder.java | 62 + .../cloud/asset/v1p7beta1/PartitionSpec.java | 789 ++++ .../v1p7beta1/PartitionSpecOrBuilder.java | 50 + .../cloud/asset/v1p7beta1/RelatedAsset.java | 1208 +++++ .../v1p7beta1/RelatedAssetOrBuilder.java | 156 + .../cloud/asset/v1p7beta1/RelatedAssets.java | 1243 +++++ .../v1p7beta1/RelatedAssetsOrBuilder.java | 113 + .../v1p7beta1/RelationshipAttributes.java | 1183 +++++ .../RelationshipAttributesOrBuilder.java | 127 + .../cloud/asset/v1p7beta1/Resource.java | 1946 ++++++++ .../asset/v1p7beta1/ResourceOrBuilder.java | 253 + .../cloud/asset/v1p7beta1/asset_service.proto | 315 ++ .../google/cloud/asset/v1p7beta1/assets.proto | 235 + .../asset/BatchGetAssetsHistoryExample.java | 13 +- .../com/example/asset/CreateFeedExample.java | 28 +- .../com/example/asset/ListAssetsExample.java | 14 +- .../asset/SearchAllResourcesExample.java | 4 +- .../com/example/asset/UpdateFeedExample.java | 26 +- synth.metadata | 350 +- synth.py | 2 +- versions.txt | 16 +- 57 files changed, 25260 insertions(+), 383 deletions(-) create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceClient.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceSettings.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/gapic_metadata.json create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/package-info.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceCallableFactory.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceStub.java create mode 100644 google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/AssetServiceClientTest.java create mode 100644 google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetService.java create mode 100644 google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetServiceImpl.java create mode 100644 grpc-google-cloud-asset-v1p7beta1/pom.xml create mode 100644 grpc-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceGrpc.java create mode 100644 proto-google-cloud-asset-v1p7beta1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-asset-v1p7beta1/pom.xml create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Asset.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetProto.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceProto.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestination.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestinationOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ContentType.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequest.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequestOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponse.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponseOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestination.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestinationOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResult.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResultOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfig.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfigOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResult.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResultOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpec.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpecOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAsset.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssets.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetsOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributes.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributesOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Resource.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ResourceOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/asset_service.proto create mode 100644 proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/assets.proto diff --git a/google-cloud-asset-bom/pom.xml b/google-cloud-asset-bom/pom.xml index e3f7cfd5a..8829abb63 100644 --- a/google-cloud-asset-bom/pom.xml +++ b/google-cloud-asset-bom/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -60,11 +60,10 @@ - - com.google.api.grpc - proto-google-cloud-asset-v1 - 2.3.7-SNAPSHOT + com.google.cloud + google-cloud-asset + 2.3.7-SNAPSHOT com.google.api.grpc @@ -96,6 +95,16 @@ grpc-google-cloud-asset-v1p5beta1 0.96.7-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-asset-v1p7beta1 + 2.3.7-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-asset-v1 + 2.3.7-SNAPSHOT + com.google.api.grpc proto-google-cloud-asset-v1p1beta1 @@ -122,9 +131,9 @@ 0.96.7-SNAPSHOT - com.google.cloud - google-cloud-asset - 2.3.7-SNAPSHOT + com.google.api.grpc + proto-google-cloud-asset-v1p7beta1 + 2.3.7-SNAPSHOT @@ -140,4 +149,4 @@ - \ No newline at end of file + diff --git a/google-cloud-asset/pom.xml b/google-cloud-asset/pom.xml index e910ea90e..ebf6b1ead 100644 --- a/google-cloud-asset/pom.xml +++ b/google-cloud-asset/pom.xml @@ -1,4 +1,4 @@ - + 4.0.0 com.google.cloud @@ -42,6 +42,10 @@ proto-google-common-protos + + com.google.api.grpc + proto-google-cloud-asset-v1p7beta1 + com.google.api.grpc proto-google-cloud-asset-v1 @@ -114,6 +118,11 @@ grpc-google-cloud-asset-v1 test + + com.google.api.grpc + grpc-google-cloud-asset-v1p7beta1 + test + com.google.api.grpc grpc-google-cloud-asset-v1beta1 @@ -171,4 +180,4 @@ - \ No newline at end of file + diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceClient.java new file mode 100644 index 000000000..b0d1d5cb7 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceClient.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.asset.v1p7beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p7beta1.stub.AssetServiceStub; +import com.google.cloud.asset.v1p7beta1.stub.AssetServiceStubSettings; +import com.google.longrunning.Operation; +import com.google.longrunning.OperationsClient; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Asset service definition. + * + *

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 (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+ *   ExportAssetsRequest request =
+ *       ExportAssetsRequest.newBuilder()
+ *           .setParent("ExportAssetsRequest-846449128".toString())
+ *           .setReadTime(Timestamp.newBuilder().build())
+ *           .addAllAssetTypes(new ArrayList())
+ *           .setContentType(ContentType.forNumber(0))
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .addAllRelationshipTypes(new ArrayList())
+ *           .build();
+ *   ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
+ * }
+ * }
+ * + *

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

To customize credentials: + * + *

{@code
+ * AssetServiceSettings assetServiceSettings =
+ *     AssetServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
+ * }
+ * + *

To customize the endpoint: + * + *

{@code
+ * AssetServiceSettings assetServiceSettings =
+ *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AssetServiceClient implements BackgroundResource { + private final AssetServiceSettings settings; + private final AssetServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AssetServiceClient with default settings. */ + public static final AssetServiceClient create() throws IOException { + return create(AssetServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AssetServiceClient, 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 AssetServiceClient create(AssetServiceSettings settings) throws IOException { + return new AssetServiceClient(settings); + } + + /** + * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AssetServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AssetServiceClient create(AssetServiceStub stub) { + return new AssetServiceClient(stub); + } + + /** + * Constructs an instance of AssetServiceClient, 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 AssetServiceClient(AssetServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AssetServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AssetServiceClient(AssetServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AssetServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssetServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. + * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line + * represents a [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in the + * JSON format; for BigQuery table destinations, the output table stores the fields in asset proto + * as columns. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep + * track of the export. We recommend intervals of at least 2 seconds with exponential retry to + * poll the export operation result. For regular-size resource parent, the export operation + * usually finishes within 5 minutes. + * + *

Sample code: + * + *

{@code
+   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+   *   ExportAssetsRequest request =
+   *       ExportAssetsRequest.newBuilder()
+   *           .setParent("ExportAssetsRequest-846449128".toString())
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .addAllAssetTypes(new ArrayList())
+   *           .setContentType(ContentType.forNumber(0))
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .addAllRelationshipTypes(new ArrayList())
+   *           .build();
+   *   ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
+   * }
+   * }
+ * + * @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 OperationFuture exportAssetsAsync( + ExportAssetsRequest request) { + return exportAssetsOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. + * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line + * represents a [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in the + * JSON format; for BigQuery table destinations, the output table stores the fields in asset proto + * as columns. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep + * track of the export. We recommend intervals of at least 2 seconds with exponential retry to + * poll the export operation result. For regular-size resource parent, the export operation + * usually finishes within 5 minutes. + * + *

Sample code: + * + *

{@code
+   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+   *   ExportAssetsRequest request =
+   *       ExportAssetsRequest.newBuilder()
+   *           .setParent("ExportAssetsRequest-846449128".toString())
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .addAllAssetTypes(new ArrayList())
+   *           .setContentType(ContentType.forNumber(0))
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .addAllRelationshipTypes(new ArrayList())
+   *           .build();
+   *   OperationFuture future =
+   *       assetServiceClient.exportAssetsOperationCallable().futureCall(request);
+   *   // Do something.
+   *   ExportAssetsResponse response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + exportAssetsOperationCallable() { + return stub.exportAssetsOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. + * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line + * represents a [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in the + * JSON format; for BigQuery table destinations, the output table stores the fields in asset proto + * as columns. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep + * track of the export. We recommend intervals of at least 2 seconds with exponential retry to + * poll the export operation result. For regular-size resource parent, the export operation + * usually finishes within 5 minutes. + * + *

Sample code: + * + *

{@code
+   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+   *   ExportAssetsRequest request =
+   *       ExportAssetsRequest.newBuilder()
+   *           .setParent("ExportAssetsRequest-846449128".toString())
+   *           .setReadTime(Timestamp.newBuilder().build())
+   *           .addAllAssetTypes(new ArrayList())
+   *           .setContentType(ContentType.forNumber(0))
+   *           .setOutputConfig(OutputConfig.newBuilder().build())
+   *           .addAllRelationshipTypes(new ArrayList())
+   *           .build();
+   *   ApiFuture future = assetServiceClient.exportAssetsCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable exportAssetsCallable() { + return stub.exportAssetsCallable(); + } + + @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); + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceSettings.java new file mode 100644 index 000000000..003eab5bc --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceSettings.java @@ -0,0 +1,197 @@ +/* + * 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.asset.v1p7beta1; + +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.OperationCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.asset.v1p7beta1.stub.AssetServiceStubSettings; +import com.google.longrunning.Operation; +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 AssetServiceClient}. + * + *

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

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

{@code
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder();
+ * assetServiceSettingsBuilder
+ *     .exportAssetsSettings()
+ *     .setRetrySettings(
+ *         assetServiceSettingsBuilder
+ *             .exportAssetsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AssetServiceSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to exportAssets. */ + public UnaryCallSettings exportAssetsSettings() { + return ((AssetServiceStubSettings) getStubSettings()).exportAssetsSettings(); + } + + /** Returns the object with the settings used for calls to exportAssets. */ + public OperationCallSettings + exportAssetsOperationSettings() { + return ((AssetServiceStubSettings) getStubSettings()).exportAssetsOperationSettings(); + } + + public static final AssetServiceSettings create(AssetServiceStubSettings stub) + throws IOException { + return new AssetServiceSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return AssetServiceStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return AssetServiceStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return AssetServiceStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return AssetServiceStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return AssetServiceStubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return AssetServiceStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return AssetServiceStubSettings.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 AssetServiceSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for AssetServiceSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(AssetServiceStubSettings.newBuilder(clientContext)); + } + + protected Builder(AssetServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AssetServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + + public AssetServiceStubSettings.Builder getStubSettingsBuilder() { + return ((AssetServiceStubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to exportAssets. */ + public UnaryCallSettings.Builder exportAssetsSettings() { + return getStubSettingsBuilder().exportAssetsSettings(); + } + + /** Returns the builder for the settings used for calls to exportAssets. */ + public OperationCallSettings.Builder< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings() { + return getStubSettingsBuilder().exportAssetsOperationSettings(); + } + + @Override + public AssetServiceSettings build() throws IOException { + return new AssetServiceSettings(this); + } + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/gapic_metadata.json b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/gapic_metadata.json new file mode 100644 index 000000000..70c675dd3 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/gapic_metadata.json @@ -0,0 +1,21 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.asset.v1p7beta1", + "libraryPackage": "com.google.cloud.asset.v1p7beta1", + "services": { + "AssetService": { + "clients": { + "grpc": { + "libraryClient": "AssetServiceClient", + "rpcs": { + "ExportAssets": { + "methods": ["exportAssetsAsync", "exportAssetsOperationCallable", "exportAssetsCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/package-info.java new file mode 100644 index 000000000..82a62bd5f --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/package-info.java @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/** + * The interfaces provided are listed below, along with usage samples. + * + *

======================= AssetServiceClient ======================= + * + *

Service Description: Asset service definition. + * + *

Sample for AssetServiceClient: + * + *

{@code
+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+ *   ExportAssetsRequest request =
+ *       ExportAssetsRequest.newBuilder()
+ *           .setParent(ProjectName.of("[PROJECT]").toString())
+ *           .setReadTime(Timestamp.newBuilder().build())
+ *           .addAllAssetTypes(new ArrayList())
+ *           .setContentType(ContentType.forNumber(0))
+ *           .setOutputConfig(OutputConfig.newBuilder().build())
+ *           .addAllRelationshipTypes(new ArrayList())
+ *           .build();
+ *   ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get();
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.asset.v1p7beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java new file mode 100644 index 000000000..7846b8925 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java @@ -0,0 +1,54 @@ +/* + * 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.asset.v1p7beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p7beta1.ExportAssetsRequest; +import com.google.cloud.asset.v1p7beta1.ExportAssetsResponse; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the AssetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class AssetServiceStub implements BackgroundResource { + + public OperationsStub getOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getOperationsStub()"); + } + + public OperationCallable + exportAssetsOperationCallable() { + throw new UnsupportedOperationException("Not implemented: exportAssetsOperationCallable()"); + } + + public UnaryCallable exportAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: exportAssetsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java new file mode 100644 index 000000000..03b6b2ec8 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStubSettings.java @@ -0,0 +1,322 @@ +/* + * 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.asset.v1p7beta1.stub; + +import com.google.api.core.ApiFunction; +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.grpc.ProtoOperationTransformers; +import com.google.api.gax.longrunning.OperationSnapshot; +import com.google.api.gax.longrunning.OperationTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +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.cloud.asset.v1p7beta1.ExportAssetsRequest; +import com.google.cloud.asset.v1p7beta1.ExportAssetsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +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 AssetServiceStub}. + * + *

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

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

{@code
+ * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
+ *     AssetServiceStubSettings.newBuilder();
+ * assetServiceSettingsBuilder
+ *     .exportAssetsSettings()
+ *     .setRetrySettings(
+ *         assetServiceSettingsBuilder
+ *             .exportAssetsSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AssetServiceStubSettings 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 exportAssetsSettings; + private final OperationCallSettings< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings; + + /** Returns the object with the settings used for calls to exportAssets. */ + public UnaryCallSettings exportAssetsSettings() { + return exportAssetsSettings; + } + + /** Returns the object with the settings used for calls to exportAssets. */ + public OperationCallSettings + exportAssetsOperationSettings() { + return exportAssetsOperationSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssetServiceStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcAssetServiceStub.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 "cloudasset.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder() + .setMaxInboundMessageSize(Integer.MAX_VALUE); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(AssetServiceStubSettings.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 AssetServiceStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + exportAssetsSettings = settingsBuilder.exportAssetsSettings().build(); + exportAssetsOperationSettings = settingsBuilder.exportAssetsOperationSettings().build(); + } + + /** Builder for AssetServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final UnaryCallSettings.Builder exportAssetsSettings; + private final OperationCallSettings.Builder< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings; + 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.DEADLINE_EXCEEDED, 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(100L)) + .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); + + exportAssetsSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + exportAssetsOperationSettings = OperationCallSettings.newBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(exportAssetsSettings); + initDefaults(this); + } + + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + exportAssetsSettings = settings.exportAssetsSettings.toBuilder(); + exportAssetsOperationSettings = settings.exportAssetsOperationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(exportAssetsSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .exportAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .exportAssetsOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(ExportAssetsResponse.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(ExportAssetsRequest.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(45000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + // NEXT_MAJOR_VER: remove 'throws Exception'. + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to exportAssets. */ + public UnaryCallSettings.Builder exportAssetsSettings() { + return exportAssetsSettings; + } + + /** Returns the builder for the settings used for calls to exportAssets. */ + @BetaApi( + "The surface for use by generated code is not stable yet and may change in the future.") + public OperationCallSettings.Builder< + ExportAssetsRequest, ExportAssetsResponse, ExportAssetsRequest> + exportAssetsOperationSettings() { + return exportAssetsOperationSettings; + } + + @Override + public AssetServiceStubSettings build() throws IOException { + return new AssetServiceStubSettings(this); + } + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceCallableFactory.java new file mode 100644 index 000000000..94dc88388 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * 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.asset.v1p7beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC callable factory implementation for the AssetService service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAssetServiceCallableFactory 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-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceStub.java new file mode 100644 index 000000000..e00d199f7 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/GrpcAssetServiceStub.java @@ -0,0 +1,176 @@ +/* + * 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.asset.v1p7beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p7beta1.ExportAssetsRequest; +import com.google.cloud.asset.v1p7beta1.ExportAssetsResponse; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * gRPC stub implementation for the AssetService service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcAssetServiceStub extends AssetServiceStub { + private static final MethodDescriptor + exportAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1p7beta1.AssetService/ExportAssets") + .setRequestMarshaller(ProtoUtils.marshaller(ExportAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private final UnaryCallable exportAssetsCallable; + private final OperationCallable + exportAssetsOperationCallable; + + private final BackgroundResource backgroundResources; + private final GrpcOperationsStub operationsStub; + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcAssetServiceStub create(AssetServiceStubSettings settings) + throws IOException { + return new GrpcAssetServiceStub(settings, ClientContext.create(settings)); + } + + public static final GrpcAssetServiceStub create(ClientContext clientContext) throws IOException { + return new GrpcAssetServiceStub(AssetServiceStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcAssetServiceStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcAssetServiceStub( + AssetServiceStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcAssetServiceStub, 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 GrpcAssetServiceStub(AssetServiceStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcAssetServiceCallableFactory()); + } + + /** + * Constructs an instance of GrpcAssetServiceStub, 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 GrpcAssetServiceStub( + AssetServiceStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings exportAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(exportAssetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ExportAssetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.exportAssetsCallable = + callableFactory.createUnaryCallable( + exportAssetsTransportSettings, settings.exportAssetsSettings(), clientContext); + this.exportAssetsOperationCallable = + callableFactory.createOperationCallable( + exportAssetsTransportSettings, + settings.exportAssetsOperationSettings(), + clientContext, + operationsStub); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public GrpcOperationsStub getOperationsStub() { + return operationsStub; + } + + @Override + public UnaryCallable exportAssetsCallable() { + return exportAssetsCallable; + } + + @Override + public OperationCallable + exportAssetsOperationCallable() { + return exportAssetsOperationCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/AssetServiceClientTest.java new file mode 100644 index 000000000..f9afc9fa1 --- /dev/null +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/AssetServiceClientTest.java @@ -0,0 +1,153 @@ +/* + * 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.asset.v1p7beta1; + +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.api.gax.rpc.StatusCode; +import com.google.longrunning.Operation; +import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Any; +import com.google.protobuf.Timestamp; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import java.util.concurrent.ExecutionException; +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 AssetServiceClientTest { + private static MockServiceHelper mockServiceHelper; + private AssetServiceClient client; + private LocalChannelProvider channelProvider; + private static MockAssetService mockAssetService; + + @BeforeClass + public static void startStaticServer() { + mockAssetService = new MockAssetService(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + AssetServiceSettings settings = + AssetServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AssetServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + public void exportAssetsTest() throws Exception { + ExportAssetsResponse expectedResponse = + ExportAssetsResponse.newBuilder() + .setReadTime(Timestamp.newBuilder().build()) + .setOutputConfig(OutputConfig.newBuilder().build()) + .setOutputResult(OutputResult.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("exportAssetsTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockAssetService.addResponse(resultOperation); + + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent("ExportAssetsRequest-846449128".toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + + ExportAssetsResponse actualResponse = client.exportAssetsAsync(request).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ExportAssetsRequest actualRequest = ((ExportAssetsRequest) actualRequests.get(0)); + + Assert.assertEquals(request.getParent(), actualRequest.getParent()); + Assert.assertEquals(request.getReadTime(), actualRequest.getReadTime()); + Assert.assertEquals(request.getAssetTypesList(), actualRequest.getAssetTypesList()); + Assert.assertEquals(request.getContentType(), actualRequest.getContentType()); + Assert.assertEquals(request.getOutputConfig(), actualRequest.getOutputConfig()); + Assert.assertEquals( + request.getRelationshipTypesList(), actualRequest.getRelationshipTypesList()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + public void exportAssetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(io.grpc.Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + ExportAssetsRequest request = + ExportAssetsRequest.newBuilder() + .setParent("ExportAssetsRequest-846449128".toString()) + .setReadTime(Timestamp.newBuilder().build()) + .addAllAssetTypes(new ArrayList()) + .setContentType(ContentType.forNumber(0)) + .setOutputConfig(OutputConfig.newBuilder().build()) + .addAllRelationshipTypes(new ArrayList()) + .build(); + client.exportAssetsAsync(request).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + Assert.assertEquals(InvalidArgumentException.class, e.getCause().getClass()); + InvalidArgumentException apiException = ((InvalidArgumentException) e.getCause()); + Assert.assertEquals(StatusCode.Code.INVALID_ARGUMENT, apiException.getStatusCode().getCode()); + } + } +} diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetService.java new file mode 100644 index 000000000..53c124d57 --- /dev/null +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetService.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.asset.v1p7beta1; + +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 MockAssetService implements MockGrpcService { + private final MockAssetServiceImpl serviceImpl; + + public MockAssetService() { + serviceImpl = new MockAssetServiceImpl(); + } + + @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-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetServiceImpl.java new file mode 100644 index 000000000..5c7f57de7 --- /dev/null +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p7beta1/MockAssetServiceImpl.java @@ -0,0 +1,82 @@ +/* + * 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.asset.v1p7beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.asset.v1p7beta1.AssetServiceGrpc.AssetServiceImplBase; +import com.google.longrunning.Operation; +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 MockAssetServiceImpl extends AssetServiceImplBase { + private List requests; + private Queue responses; + + public MockAssetServiceImpl() { + 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 exportAssets( + ExportAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.poll(); + if (response instanceof Operation) { + requests.add(request); + responseObserver.onNext(((Operation) 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 ExportAssets, expected %s or %s", + response == null ? "null" : response.getClass().getName(), + Operation.class.getName(), + Exception.class.getName()))); + } + } +} diff --git a/grpc-google-cloud-asset-v1p7beta1/pom.xml b/grpc-google-cloud-asset-v1p7beta1/pom.xml new file mode 100644 index 000000000..846b6f15c --- /dev/null +++ b/grpc-google-cloud-asset-v1p7beta1/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-asset-v1p7beta1 + 2.3.7-SNAPSHOT + grpc-google-cloud-asset-v1p7beta1 + GRPC library for google-cloud-asset + + com.google.cloud + google-cloud-asset-parent + 2.3.7-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-cloud-asset-v1p7beta1 + + + com.google.guava + guava + + + + + + java9 + + [9,) + + + + javax.annotation + javax.annotation-api + + + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/grpc-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceGrpc.java b/grpc-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceGrpc.java new file mode 100644 index 000000000..9bec802f1 --- /dev/null +++ b/grpc-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceGrpc.java @@ -0,0 +1,392 @@ +/* + * 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.asset.v1p7beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Asset service definition.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/asset/v1p7beta1/asset_service.proto") +public final class AssetServiceGrpc { + + private AssetServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.asset.v1p7beta1.AssetService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest, com.google.longrunning.Operation> + getExportAssetsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExportAssets", + requestType = com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest, com.google.longrunning.Operation> + getExportAssetsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest, com.google.longrunning.Operation> + getExportAssetsMethod; + if ((getExportAssetsMethod = AssetServiceGrpc.getExportAssetsMethod) == null) { + synchronized (AssetServiceGrpc.class) { + if ((getExportAssetsMethod = AssetServiceGrpc.getExportAssetsMethod) == null) { + AssetServiceGrpc.getExportAssetsMethod = + getExportAssetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExportAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor(new AssetServiceMethodDescriptorSupplier("ExportAssets")) + .build(); + } + } + } + return getExportAssetsMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static AssetServiceStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AssetServiceStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssetServiceStub(channel, callOptions); + } + }; + return AssetServiceStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AssetServiceBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AssetServiceBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssetServiceBlockingStub(channel, callOptions); + } + }; + return AssetServiceBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static AssetServiceFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AssetServiceFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssetServiceFutureStub(channel, callOptions); + } + }; + return AssetServiceFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Asset service definition.
+   * 
+ */ + public abstract static class AssetServiceImplBase implements io.grpc.BindableService { + + /** + * + * + *
+     * Exports assets with time and resource types to a given Cloud Storage
+     * location/BigQuery table. For Cloud Storage location destinations, the
+     * output format is newline-delimited JSON. Each line represents a
+     * [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in
+     * the JSON format; for BigQuery table destinations, the output table stores
+     * the fields in asset proto as columns. This API implements the
+     * [google.longrunning.Operation][google.longrunning.Operation] API , which
+     * allows you to keep track of the export. We recommend intervals of at least
+     * 2 seconds with exponential retry to poll the export operation result. For
+     * regular-size resource parent, the export operation usually finishes within
+     * 5 minutes.
+     * 
+ */ + public void exportAssets( + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getExportAssetsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getExportAssetsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest, + com.google.longrunning.Operation>(this, METHODID_EXPORT_ASSETS))) + .build(); + } + } + + /** + * + * + *
+   * Asset service definition.
+   * 
+ */ + public static final class AssetServiceStub + extends io.grpc.stub.AbstractAsyncStub { + private AssetServiceStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AssetServiceStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssetServiceStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports assets with time and resource types to a given Cloud Storage
+     * location/BigQuery table. For Cloud Storage location destinations, the
+     * output format is newline-delimited JSON. Each line represents a
+     * [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in
+     * the JSON format; for BigQuery table destinations, the output table stores
+     * the fields in asset proto as columns. This API implements the
+     * [google.longrunning.Operation][google.longrunning.Operation] API , which
+     * allows you to keep track of the export. We recommend intervals of at least
+     * 2 seconds with exponential retry to poll the export operation result. For
+     * regular-size resource parent, the export operation usually finishes within
+     * 5 minutes.
+     * 
+ */ + public void exportAssets( + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getExportAssetsMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Asset service definition.
+   * 
+ */ + public static final class AssetServiceBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private AssetServiceBlockingStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AssetServiceBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssetServiceBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports assets with time and resource types to a given Cloud Storage
+     * location/BigQuery table. For Cloud Storage location destinations, the
+     * output format is newline-delimited JSON. Each line represents a
+     * [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in
+     * the JSON format; for BigQuery table destinations, the output table stores
+     * the fields in asset proto as columns. This API implements the
+     * [google.longrunning.Operation][google.longrunning.Operation] API , which
+     * allows you to keep track of the export. We recommend intervals of at least
+     * 2 seconds with exponential retry to poll the export operation result. For
+     * regular-size resource parent, the export operation usually finishes within
+     * 5 minutes.
+     * 
+ */ + public com.google.longrunning.Operation exportAssets( + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getExportAssetsMethod(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Asset service definition.
+   * 
+ */ + public static final class AssetServiceFutureStub + extends io.grpc.stub.AbstractFutureStub { + private AssetServiceFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AssetServiceFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AssetServiceFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Exports assets with time and resource types to a given Cloud Storage
+     * location/BigQuery table. For Cloud Storage location destinations, the
+     * output format is newline-delimited JSON. Each line represents a
+     * [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in
+     * the JSON format; for BigQuery table destinations, the output table stores
+     * the fields in asset proto as columns. This API implements the
+     * [google.longrunning.Operation][google.longrunning.Operation] API , which
+     * allows you to keep track of the export. We recommend intervals of at least
+     * 2 seconds with exponential retry to poll the export operation result. For
+     * regular-size resource parent, the export operation usually finishes within
+     * 5 minutes.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + exportAssets(com.google.cloud.asset.v1p7beta1.ExportAssetsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getExportAssetsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_EXPORT_ASSETS = 0; + + 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 AssetServiceImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AssetServiceImplBase 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_EXPORT_ASSETS: + serviceImpl.exportAssets( + (com.google.cloud.asset.v1p7beta1.ExportAssetsRequest) request, + (io.grpc.stub.StreamObserver) 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 AssetServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AssetServiceBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AssetService"); + } + } + + private static final class AssetServiceFileDescriptorSupplier + extends AssetServiceBaseDescriptorSupplier { + AssetServiceFileDescriptorSupplier() {} + } + + private static final class AssetServiceMethodDescriptorSupplier + extends AssetServiceBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AssetServiceMethodDescriptorSupplier(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 (AssetServiceGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AssetServiceFileDescriptorSupplier()) + .addMethod(getExportAssetsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 105a1ef11..2953fa020 100644 --- a/pom.xml +++ b/pom.xml @@ -72,6 +72,16 @@ proto-google-cloud-asset-v1 2.3.7-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-asset-v1p7beta1 + 2.3.7-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-asset-v1p7beta1 + 2.3.7-SNAPSHOT + com.google.api.grpc proto-google-cloud-asset-v1p1beta1 @@ -201,19 +211,21 @@ - proto-google-cloud-asset-v1 - proto-google-cloud-asset-v1p1beta1 - proto-google-cloud-asset-v1p2beta1 - proto-google-cloud-asset-v1beta1 - proto-google-cloud-asset-v1p4beta1 - proto-google-cloud-asset-v1p5beta1 + google-cloud-asset grpc-google-cloud-asset-v1 grpc-google-cloud-asset-v1beta1 grpc-google-cloud-asset-v1p1beta1 grpc-google-cloud-asset-v1p2beta1 grpc-google-cloud-asset-v1p4beta1 grpc-google-cloud-asset-v1p5beta1 - google-cloud-asset + grpc-google-cloud-asset-v1p7beta1 + proto-google-cloud-asset-v1 + proto-google-cloud-asset-v1p1beta1 + proto-google-cloud-asset-v1p2beta1 + proto-google-cloud-asset-v1beta1 + proto-google-cloud-asset-v1p4beta1 + proto-google-cloud-asset-v1p5beta1 + proto-google-cloud-asset-v1p7beta1 google-cloud-asset-bom diff --git a/proto-google-cloud-asset-v1p7beta1/clirr-ignored-differences.xml b/proto-google-cloud-asset-v1p7beta1/clirr-ignored-differences.xml new file mode 100644 index 000000000..702a4b7ff --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/asset/v1p7beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/asset/v1p7beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/asset/v1p7beta1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-asset-v1p7beta1/pom.xml b/proto-google-cloud-asset-v1p7beta1/pom.xml new file mode 100644 index 000000000..d40a028b5 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/pom.xml @@ -0,0 +1,50 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-asset-v1p7beta1 + 2.3.7-SNAPSHOT + proto-google-cloud-asset-v1p7beta1 + Proto library for google-cloud-asset + + com.google.cloud + google-cloud-asset-parent + 2.3.7-SNAPSHOT + + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + proto-google-cloud-orgpolicy-v1 + + + com.google.api.grpc + proto-google-identity-accesscontextmanager-v1 + + + com.google.api.grpc + proto-google-cloud-os-config-v1 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Asset.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Asset.java new file mode 100644 index 000000000..c35381869 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Asset.java @@ -0,0 +1,4074 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * An asset in Google Cloud. An asset can be any resource in the Google Cloud
+ * [resource
+ * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+ * a resource outside the Google Cloud resource hierarchy (such as Google
+ * Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
+ * See [Supported asset
+ * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+ * for more information.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.Asset} + */ +public final class Asset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.Asset) + AssetOrBuilder { + private static final long serialVersionUID = 0L; + // Use Asset.newBuilder() to construct. + private Asset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Asset() { + name_ = ""; + assetType_ = ""; + orgPolicy_ = java.util.Collections.emptyList(); + ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Asset(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Asset( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + assetType_ = s; + break; + } + case 26: + { + com.google.cloud.asset.v1p7beta1.Resource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.Resource.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(resource_); + resource_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + com.google.iam.v1.Policy.Builder subBuilder = null; + if (iamPolicy_ != null) { + subBuilder = iamPolicy_.toBuilder(); + } + iamPolicy_ = input.readMessage(com.google.iam.v1.Policy.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(iamPolicy_); + iamPolicy_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + orgPolicy_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + orgPolicy_.add( + input.readMessage( + com.google.cloud.orgpolicy.v1.Policy.parser(), extensionRegistry)); + break; + } + case 58: + { + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder subBuilder = null; + if (accessContextPolicyCase_ == 7) { + subBuilder = + ((com.google.identity.accesscontextmanager.v1.AccessPolicy) + accessContextPolicy_) + .toBuilder(); + } + accessContextPolicy_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.AccessPolicy.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.identity.accesscontextmanager.v1.AccessPolicy) + accessContextPolicy_); + accessContextPolicy_ = subBuilder.buildPartial(); + } + accessContextPolicyCase_ = 7; + break; + } + case 66: + { + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder subBuilder = null; + if (accessContextPolicyCase_ == 8) { + subBuilder = + ((com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_) + .toBuilder(); + } + accessContextPolicy_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.AccessLevel.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_); + accessContextPolicy_ = subBuilder.buildPartial(); + } + accessContextPolicyCase_ = 8; + break; + } + case 74: + { + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder subBuilder = + null; + if (accessContextPolicyCase_ == 9) { + subBuilder = + ((com.google.identity.accesscontextmanager.v1.ServicePerimeter) + accessContextPolicy_) + .toBuilder(); + } + accessContextPolicy_ = + input.readMessage( + com.google.identity.accesscontextmanager.v1.ServicePerimeter.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.identity.accesscontextmanager.v1.ServicePerimeter) + accessContextPolicy_); + accessContextPolicy_ = subBuilder.buildPartial(); + } + accessContextPolicyCase_ = 9; + break; + } + case 82: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + ancestors_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + ancestors_.add(s); + break; + } + case 90: + { + 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; + } + case 106: + { + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder subBuilder = null; + if (relatedAssets_ != null) { + subBuilder = relatedAssets_.toBuilder(); + } + relatedAssets_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.RelatedAssets.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(relatedAssets_); + relatedAssets_ = 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)) { + orgPolicy_ = java.util.Collections.unmodifiableList(orgPolicy_); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + ancestors_ = ancestors_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.Asset.class, + com.google.cloud.asset.v1p7beta1.Asset.Builder.class); + } + + private int accessContextPolicyCase_ = 0; + private java.lang.Object accessContextPolicy_; + + public enum AccessContextPolicyCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + ACCESS_POLICY(7), + ACCESS_LEVEL(8), + SERVICE_PERIMETER(9), + ACCESSCONTEXTPOLICY_NOT_SET(0); + private final int value; + + private AccessContextPolicyCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AccessContextPolicyCase valueOf(int value) { + return forNumber(value); + } + + public static AccessContextPolicyCase forNumber(int value) { + switch (value) { + case 7: + return ACCESS_POLICY; + case 8: + return ACCESS_LEVEL; + case 9: + return SERVICE_PERIMETER; + case 0: + return ACCESSCONTEXTPOLICY_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public AccessContextPolicyCase getAccessContextPolicyCase() { + return AccessContextPolicyCase.forNumber(accessContextPolicyCase_); + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 11; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * The last update timestamp of an asset. update_time is updated when
+   * create/update/delete operation is performed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return updateTime_ != null; + } + /** + * + * + *
+   * The last update timestamp of an asset. update_time is updated when
+   * create/update/delete operation is performed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * The last update timestamp of an asset. update_time is updated when
+   * create/update/delete operation is performed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return getUpdateTime(); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASSET_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object assetType_; + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + @java.lang.Override + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + 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(); + assetType_ = s; + return s; + } + } + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 3; + private com.google.cloud.asset.v1p7beta1.Resource resource_; + /** + * + * + *
+   * A representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return resource_ != null; + } + /** + * + * + *
+   * A representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + * + * @return The resource. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Resource getResource() { + return resource_ == null + ? com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance() + : resource_; + } + /** + * + * + *
+   * A representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ResourceOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int IAM_POLICY_FIELD_NUMBER = 4; + private com.google.iam.v1.Policy iamPolicy_; + /** + * + * + *
+   * A representation of the Cloud IAM policy set on a Google Cloud resource.
+   * There can be a maximum of one Cloud IAM policy set on any given resource.
+   * In addition, Cloud IAM policies inherit their granted access scope from any
+   * policies set on parent resources in the resource hierarchy. Therefore, the
+   * effectively policy is the union of both the policy set on this resource
+   * and each policy set on all of the resource's ancestry resource levels in
+   * the hierarchy. See
+   * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+   * more information.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return Whether the iamPolicy field is set. + */ + @java.lang.Override + public boolean hasIamPolicy() { + return iamPolicy_ != null; + } + /** + * + * + *
+   * A representation of the Cloud IAM policy set on a Google Cloud resource.
+   * There can be a maximum of one Cloud IAM policy set on any given resource.
+   * In addition, Cloud IAM policies inherit their granted access scope from any
+   * policies set on parent resources in the resource hierarchy. Therefore, the
+   * effectively policy is the union of both the policy set on this resource
+   * and each policy set on all of the resource's ancestry resource levels in
+   * the hierarchy. See
+   * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+   * more information.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return The iamPolicy. + */ + @java.lang.Override + public com.google.iam.v1.Policy getIamPolicy() { + return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_; + } + /** + * + * + *
+   * A representation of the Cloud IAM policy set on a Google Cloud resource.
+   * There can be a maximum of one Cloud IAM policy set on any given resource.
+   * In addition, Cloud IAM policies inherit their granted access scope from any
+   * policies set on parent resources in the resource hierarchy. Therefore, the
+   * effectively policy is the union of both the policy set on this resource
+   * and each policy set on all of the resource's ancestry resource levels in
+   * the hierarchy. See
+   * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+   * more information.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + @java.lang.Override + public com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder() { + return getIamPolicy(); + } + + public static final int ORG_POLICY_FIELD_NUMBER = 6; + private java.util.List orgPolicy_; + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public java.util.List getOrgPolicyList() { + return orgPolicy_; + } + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public java.util.List + getOrgPolicyOrBuilderList() { + return orgPolicy_; + } + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public int getOrgPolicyCount() { + return orgPolicy_.size(); + } + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public com.google.cloud.orgpolicy.v1.Policy getOrgPolicy(int index) { + return orgPolicy_.get(index); + } + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public com.google.cloud.orgpolicy.v1.PolicyOrBuilder getOrgPolicyOrBuilder(int index) { + return orgPolicy_.get(index); + } + + public static final int ACCESS_POLICY_FIELD_NUMBER = 7; + /** + * + * + *
+   * Please also refer to the [access policy user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return Whether the accessPolicy field is set. + */ + @java.lang.Override + public boolean hasAccessPolicy() { + return accessContextPolicyCase_ == 7; + } + /** + * + * + *
+   * Please also refer to the [access policy user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return The accessPolicy. + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicy getAccessPolicy() { + if (accessContextPolicyCase_ == 7) { + return (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } + /** + * + * + *
+   * Please also refer to the [access policy user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder + getAccessPolicyOrBuilder() { + if (accessContextPolicyCase_ == 7) { + return (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } + + public static final int ACCESS_LEVEL_FIELD_NUMBER = 8; + /** + * + * + *
+   * Please also refer to the [access level user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return Whether the accessLevel field is set. + */ + @java.lang.Override + public boolean hasAccessLevel() { + return accessContextPolicyCase_ == 8; + } + /** + * + * + *
+   * Please also refer to the [access level user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return The accessLevel. + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevel getAccessLevel() { + if (accessContextPolicyCase_ == 8) { + return (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } + /** + * + * + *
+   * Please also refer to the [access level user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder + getAccessLevelOrBuilder() { + if (accessContextPolicyCase_ == 8) { + return (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } + + public static final int SERVICE_PERIMETER_FIELD_NUMBER = 9; + /** + * + * + *
+   * Please also refer to the [service perimeter user
+   * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return Whether the servicePerimeter field is set. + */ + @java.lang.Override + public boolean hasServicePerimeter() { + return accessContextPolicyCase_ == 9; + } + /** + * + * + *
+   * Please also refer to the [service perimeter user
+   * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return The servicePerimeter. + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeter getServicePerimeter() { + if (accessContextPolicyCase_ == 9) { + return (com.google.identity.accesscontextmanager.v1.ServicePerimeter) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } + /** + * + * + *
+   * Please also refer to the [service perimeter user
+   * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder + getServicePerimeterOrBuilder() { + if (accessContextPolicyCase_ == 9) { + return (com.google.identity.accesscontextmanager.v1.ServicePerimeter) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } + + public static final int RELATED_ASSETS_FIELD_NUMBER = 13; + private com.google.cloud.asset.v1p7beta1.RelatedAssets relatedAssets_; + /** + * + * + *
+   * The related assets of the asset of one relationship type.
+   * One asset only represents one type of relationship.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + * + * @return Whether the relatedAssets field is set. + */ + @java.lang.Override + public boolean hasRelatedAssets() { + return relatedAssets_ != null; + } + /** + * + * + *
+   * The related assets of the asset of one relationship type.
+   * One asset only represents one type of relationship.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + * + * @return The relatedAssets. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAssets getRelatedAssets() { + return relatedAssets_ == null + ? com.google.cloud.asset.v1p7beta1.RelatedAssets.getDefaultInstance() + : relatedAssets_; + } + /** + * + * + *
+   * The related assets of the asset of one relationship type.
+   * One asset only represents one type of relationship.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder getRelatedAssetsOrBuilder() { + return getRelatedAssets(); + } + + public static final int ANCESTORS_FIELD_NUMBER = 10; + private com.google.protobuf.LazyStringList ancestors_; + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @return A list containing the ancestors. + */ + public com.google.protobuf.ProtocolStringList getAncestorsList() { + return ancestors_; + } + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @return The count of ancestors. + */ + public int getAncestorsCount() { + return ancestors_.size(); + } + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @param index The index of the element to return. + * @return The ancestors at the given index. + */ + public java.lang.String getAncestors(int index) { + return ancestors_.get(index); + } + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @param index The index of the value to return. + * @return The bytes of the ancestors at the given index. + */ + public com.google.protobuf.ByteString getAncestorsBytes(int index) { + return ancestors_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!getAssetTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetType_); + } + if (resource_ != null) { + output.writeMessage(3, getResource()); + } + if (iamPolicy_ != null) { + output.writeMessage(4, getIamPolicy()); + } + for (int i = 0; i < orgPolicy_.size(); i++) { + output.writeMessage(6, orgPolicy_.get(i)); + } + if (accessContextPolicyCase_ == 7) { + output.writeMessage( + 7, (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_); + } + if (accessContextPolicyCase_ == 8) { + output.writeMessage( + 8, (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_); + } + if (accessContextPolicyCase_ == 9) { + output.writeMessage( + 9, (com.google.identity.accesscontextmanager.v1.ServicePerimeter) accessContextPolicy_); + } + for (int i = 0; i < ancestors_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, ancestors_.getRaw(i)); + } + if (updateTime_ != null) { + output.writeMessage(11, getUpdateTime()); + } + if (relatedAssets_ != null) { + output.writeMessage(13, getRelatedAssets()); + } + 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 (!getAssetTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, assetType_); + } + if (resource_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getResource()); + } + if (iamPolicy_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getIamPolicy()); + } + for (int i = 0; i < orgPolicy_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, orgPolicy_.get(i)); + } + if (accessContextPolicyCase_ == 7) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_); + } + if (accessContextPolicyCase_ == 8) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 8, (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_); + } + if (accessContextPolicyCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 9, + (com.google.identity.accesscontextmanager.v1.ServicePerimeter) accessContextPolicy_); + } + { + int dataSize = 0; + for (int i = 0; i < ancestors_.size(); i++) { + dataSize += computeStringSizeNoTag(ancestors_.getRaw(i)); + } + size += dataSize; + size += 1 * getAncestorsList().size(); + } + if (updateTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, getUpdateTime()); + } + if (relatedAssets_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, getRelatedAssets()); + } + 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.asset.v1p7beta1.Asset)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.Asset other = (com.google.cloud.asset.v1p7beta1.Asset) obj; + + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!getName().equals(other.getName())) return false; + if (!getAssetType().equals(other.getAssetType())) return false; + if (hasResource() != other.hasResource()) return false; + if (hasResource()) { + if (!getResource().equals(other.getResource())) return false; + } + if (hasIamPolicy() != other.hasIamPolicy()) return false; + if (hasIamPolicy()) { + if (!getIamPolicy().equals(other.getIamPolicy())) return false; + } + if (!getOrgPolicyList().equals(other.getOrgPolicyList())) return false; + if (hasRelatedAssets() != other.hasRelatedAssets()) return false; + if (hasRelatedAssets()) { + if (!getRelatedAssets().equals(other.getRelatedAssets())) return false; + } + if (!getAncestorsList().equals(other.getAncestorsList())) return false; + if (!getAccessContextPolicyCase().equals(other.getAccessContextPolicyCase())) return false; + switch (accessContextPolicyCase_) { + case 7: + if (!getAccessPolicy().equals(other.getAccessPolicy())) return false; + break; + case 8: + if (!getAccessLevel().equals(other.getAccessLevel())) return false; + break; + case 9: + if (!getServicePerimeter().equals(other.getServicePerimeter())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ASSET_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAssetType().hashCode(); + if (hasResource()) { + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + } + if (hasIamPolicy()) { + hash = (37 * hash) + IAM_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getIamPolicy().hashCode(); + } + if (getOrgPolicyCount() > 0) { + hash = (37 * hash) + ORG_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getOrgPolicyList().hashCode(); + } + if (hasRelatedAssets()) { + hash = (37 * hash) + RELATED_ASSETS_FIELD_NUMBER; + hash = (53 * hash) + getRelatedAssets().hashCode(); + } + if (getAncestorsCount() > 0) { + hash = (37 * hash) + ANCESTORS_FIELD_NUMBER; + hash = (53 * hash) + getAncestorsList().hashCode(); + } + switch (accessContextPolicyCase_) { + case 7: + hash = (37 * hash) + ACCESS_POLICY_FIELD_NUMBER; + hash = (53 * hash) + getAccessPolicy().hashCode(); + break; + case 8: + hash = (37 * hash) + ACCESS_LEVEL_FIELD_NUMBER; + hash = (53 * hash) + getAccessLevel().hashCode(); + break; + case 9: + hash = (37 * hash) + SERVICE_PERIMETER_FIELD_NUMBER; + hash = (53 * hash) + getServicePerimeter().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.Asset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.Asset 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.asset.v1p7beta1.Asset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.Asset 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.asset.v1p7beta1.Asset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.Asset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.Asset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.Asset 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.asset.v1p7beta1.Asset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.Asset 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.asset.v1p7beta1.Asset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.Asset 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.asset.v1p7beta1.Asset 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; + } + /** + * + * + *
+   * An asset in Google Cloud. An asset can be any resource in the Google Cloud
+   * [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * a resource outside the Google Cloud resource hierarchy (such as Google
+   * Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.Asset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.Asset) + com.google.cloud.asset.v1p7beta1.AssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.Asset.class, + com.google.cloud.asset.v1p7beta1.Asset.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.Asset.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getOrgPolicyFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (updateTimeBuilder_ == null) { + updateTime_ = null; + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + name_ = ""; + + assetType_ = ""; + + if (resourceBuilder_ == null) { + resource_ = null; + } else { + resource_ = null; + resourceBuilder_ = null; + } + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + if (orgPolicyBuilder_ == null) { + orgPolicy_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + orgPolicyBuilder_.clear(); + } + if (relatedAssetsBuilder_ == null) { + relatedAssets_ = null; + } else { + relatedAssets_ = null; + relatedAssetsBuilder_ = null; + } + ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Asset_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Asset getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.Asset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Asset build() { + com.google.cloud.asset.v1p7beta1.Asset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Asset buildPartial() { + com.google.cloud.asset.v1p7beta1.Asset result = + new com.google.cloud.asset.v1p7beta1.Asset(this); + int from_bitField0_ = bitField0_; + if (updateTimeBuilder_ == null) { + result.updateTime_ = updateTime_; + } else { + result.updateTime_ = updateTimeBuilder_.build(); + } + result.name_ = name_; + result.assetType_ = assetType_; + if (resourceBuilder_ == null) { + result.resource_ = resource_; + } else { + result.resource_ = resourceBuilder_.build(); + } + if (iamPolicyBuilder_ == null) { + result.iamPolicy_ = iamPolicy_; + } else { + result.iamPolicy_ = iamPolicyBuilder_.build(); + } + if (orgPolicyBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + orgPolicy_ = java.util.Collections.unmodifiableList(orgPolicy_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.orgPolicy_ = orgPolicy_; + } else { + result.orgPolicy_ = orgPolicyBuilder_.build(); + } + if (accessContextPolicyCase_ == 7) { + if (accessPolicyBuilder_ == null) { + result.accessContextPolicy_ = accessContextPolicy_; + } else { + result.accessContextPolicy_ = accessPolicyBuilder_.build(); + } + } + if (accessContextPolicyCase_ == 8) { + if (accessLevelBuilder_ == null) { + result.accessContextPolicy_ = accessContextPolicy_; + } else { + result.accessContextPolicy_ = accessLevelBuilder_.build(); + } + } + if (accessContextPolicyCase_ == 9) { + if (servicePerimeterBuilder_ == null) { + result.accessContextPolicy_ = accessContextPolicy_; + } else { + result.accessContextPolicy_ = servicePerimeterBuilder_.build(); + } + } + if (relatedAssetsBuilder_ == null) { + result.relatedAssets_ = relatedAssets_; + } else { + result.relatedAssets_ = relatedAssetsBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + ancestors_ = ancestors_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.ancestors_ = ancestors_; + result.accessContextPolicyCase_ = accessContextPolicyCase_; + 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.asset.v1p7beta1.Asset) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.Asset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.Asset other) { + if (other == com.google.cloud.asset.v1p7beta1.Asset.getDefaultInstance()) return this; + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getAssetType().isEmpty()) { + assetType_ = other.assetType_; + onChanged(); + } + if (other.hasResource()) { + mergeResource(other.getResource()); + } + if (other.hasIamPolicy()) { + mergeIamPolicy(other.getIamPolicy()); + } + if (orgPolicyBuilder_ == null) { + if (!other.orgPolicy_.isEmpty()) { + if (orgPolicy_.isEmpty()) { + orgPolicy_ = other.orgPolicy_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOrgPolicyIsMutable(); + orgPolicy_.addAll(other.orgPolicy_); + } + onChanged(); + } + } else { + if (!other.orgPolicy_.isEmpty()) { + if (orgPolicyBuilder_.isEmpty()) { + orgPolicyBuilder_.dispose(); + orgPolicyBuilder_ = null; + orgPolicy_ = other.orgPolicy_; + bitField0_ = (bitField0_ & ~0x00000001); + orgPolicyBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getOrgPolicyFieldBuilder() + : null; + } else { + orgPolicyBuilder_.addAllMessages(other.orgPolicy_); + } + } + } + if (other.hasRelatedAssets()) { + mergeRelatedAssets(other.getRelatedAssets()); + } + if (!other.ancestors_.isEmpty()) { + if (ancestors_.isEmpty()) { + ancestors_ = other.ancestors_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAncestorsIsMutable(); + ancestors_.addAll(other.ancestors_); + } + onChanged(); + } + switch (other.getAccessContextPolicyCase()) { + case ACCESS_POLICY: + { + mergeAccessPolicy(other.getAccessPolicy()); + break; + } + case ACCESS_LEVEL: + { + mergeAccessLevel(other.getAccessLevel()); + break; + } + case SERVICE_PERIMETER: + { + mergeServicePerimeter(other.getServicePerimeter()); + break; + } + case ACCESSCONTEXTPOLICY_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p7beta1.Asset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.Asset) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int accessContextPolicyCase_ = 0; + private java.lang.Object accessContextPolicy_; + + public AccessContextPolicyCase getAccessContextPolicyCase() { + return AccessContextPolicyCase.forNumber(accessContextPolicyCase_); + } + + public Builder clearAccessContextPolicy() { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + 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 last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return updateTimeBuilder_ != null || updateTime_ != null; + } + /** + * + * + *
+     * The last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + * + * @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 last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + 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 last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + onChanged(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + 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 last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public Builder clearUpdateTime() { + if (updateTimeBuilder_ == null) { + updateTime_ = null; + onChanged(); + } else { + updateTime_ = null; + updateTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * The last update timestamp of an asset. update_time is updated when
+     * create/update/delete operation is performed.
+     * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + 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_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string name = 1; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string name = 1; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string name = 1; + * + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string name = 1; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private java.lang.Object assetType_ = ""; + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @param value The assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + assetType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearAssetType() { + + assetType_ = getDefaultInstance().getAssetType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @param value The bytes for assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + assetType_ = value; + onChanged(); + return this; + } + + private com.google.cloud.asset.v1p7beta1.Resource resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.Resource, + com.google.cloud.asset.v1p7beta1.Resource.Builder, + com.google.cloud.asset.v1p7beta1.ResourceOrBuilder> + resourceBuilder_; + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + * + * @return The resource. + */ + public com.google.cloud.asset.v1p7beta1.Resource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + public Builder setResource(com.google.cloud.asset.v1p7beta1.Resource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + public Builder setResource(com.google.cloud.asset.v1p7beta1.Resource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + public Builder mergeResource(com.google.cloud.asset.v1p7beta1.Resource value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + com.google.cloud.asset.v1p7beta1.Resource.newBuilder(resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + public com.google.cloud.asset.v1p7beta1.Resource.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + public com.google.cloud.asset.v1p7beta1.ResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance() + : resource_; + } + } + /** + * + * + *
+     * A representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.Resource, + com.google.cloud.asset.v1p7beta1.Resource.Builder, + com.google.cloud.asset.v1p7beta1.ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.Resource, + com.google.cloud.asset.v1p7beta1.Resource.Builder, + com.google.cloud.asset.v1p7beta1.ResourceOrBuilder>( + getResource(), getParentForChildren(), isClean()); + resource_ = null; + } + return resourceBuilder_; + } + + private com.google.iam.v1.Policy iamPolicy_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + iamPolicyBuilder_; + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return Whether the iamPolicy field is set. + */ + public boolean hasIamPolicy() { + return iamPolicyBuilder_ != null || iamPolicy_ != null; + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return The iamPolicy. + */ + public com.google.iam.v1.Policy getIamPolicy() { + if (iamPolicyBuilder_ == null) { + return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_; + } else { + return iamPolicyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public Builder setIamPolicy(com.google.iam.v1.Policy value) { + if (iamPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + iamPolicy_ = value; + onChanged(); + } else { + iamPolicyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public Builder setIamPolicy(com.google.iam.v1.Policy.Builder builderForValue) { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = builderForValue.build(); + onChanged(); + } else { + iamPolicyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public Builder mergeIamPolicy(com.google.iam.v1.Policy value) { + if (iamPolicyBuilder_ == null) { + if (iamPolicy_ != null) { + iamPolicy_ = + com.google.iam.v1.Policy.newBuilder(iamPolicy_).mergeFrom(value).buildPartial(); + } else { + iamPolicy_ = value; + } + onChanged(); + } else { + iamPolicyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public Builder clearIamPolicy() { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + onChanged(); + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public com.google.iam.v1.Policy.Builder getIamPolicyBuilder() { + + onChanged(); + return getIamPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder() { + if (iamPolicyBuilder_ != null) { + return iamPolicyBuilder_.getMessageOrBuilder(); + } else { + return iamPolicy_ == null ? com.google.iam.v1.Policy.getDefaultInstance() : iamPolicy_; + } + } + /** + * + * + *
+     * A representation of the Cloud IAM policy set on a Google Cloud resource.
+     * There can be a maximum of one Cloud IAM policy set on any given resource.
+     * In addition, Cloud IAM policies inherit their granted access scope from any
+     * policies set on parent resources in the resource hierarchy. Therefore, the
+     * effectively policy is the union of both the policy set on this resource
+     * and each policy set on all of the resource's ancestry resource levels in
+     * the hierarchy. See
+     * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+     * more information.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder> + getIamPolicyFieldBuilder() { + if (iamPolicyBuilder_ == null) { + iamPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.iam.v1.Policy, + com.google.iam.v1.Policy.Builder, + com.google.iam.v1.PolicyOrBuilder>( + getIamPolicy(), getParentForChildren(), isClean()); + iamPolicy_ = null; + } + return iamPolicyBuilder_; + } + + private java.util.List orgPolicy_ = + java.util.Collections.emptyList(); + + private void ensureOrgPolicyIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + orgPolicy_ = new java.util.ArrayList(orgPolicy_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.orgpolicy.v1.Policy, + com.google.cloud.orgpolicy.v1.Policy.Builder, + com.google.cloud.orgpolicy.v1.PolicyOrBuilder> + orgPolicyBuilder_; + + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public java.util.List getOrgPolicyList() { + if (orgPolicyBuilder_ == null) { + return java.util.Collections.unmodifiableList(orgPolicy_); + } else { + return orgPolicyBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public int getOrgPolicyCount() { + if (orgPolicyBuilder_ == null) { + return orgPolicy_.size(); + } else { + return orgPolicyBuilder_.getCount(); + } + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public com.google.cloud.orgpolicy.v1.Policy getOrgPolicy(int index) { + if (orgPolicyBuilder_ == null) { + return orgPolicy_.get(index); + } else { + return orgPolicyBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder setOrgPolicy(int index, com.google.cloud.orgpolicy.v1.Policy value) { + if (orgPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrgPolicyIsMutable(); + orgPolicy_.set(index, value); + onChanged(); + } else { + orgPolicyBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder setOrgPolicy( + int index, com.google.cloud.orgpolicy.v1.Policy.Builder builderForValue) { + if (orgPolicyBuilder_ == null) { + ensureOrgPolicyIsMutable(); + orgPolicy_.set(index, builderForValue.build()); + onChanged(); + } else { + orgPolicyBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder addOrgPolicy(com.google.cloud.orgpolicy.v1.Policy value) { + if (orgPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrgPolicyIsMutable(); + orgPolicy_.add(value); + onChanged(); + } else { + orgPolicyBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder addOrgPolicy(int index, com.google.cloud.orgpolicy.v1.Policy value) { + if (orgPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOrgPolicyIsMutable(); + orgPolicy_.add(index, value); + onChanged(); + } else { + orgPolicyBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder addOrgPolicy(com.google.cloud.orgpolicy.v1.Policy.Builder builderForValue) { + if (orgPolicyBuilder_ == null) { + ensureOrgPolicyIsMutable(); + orgPolicy_.add(builderForValue.build()); + onChanged(); + } else { + orgPolicyBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder addOrgPolicy( + int index, com.google.cloud.orgpolicy.v1.Policy.Builder builderForValue) { + if (orgPolicyBuilder_ == null) { + ensureOrgPolicyIsMutable(); + orgPolicy_.add(index, builderForValue.build()); + onChanged(); + } else { + orgPolicyBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder addAllOrgPolicy( + java.lang.Iterable values) { + if (orgPolicyBuilder_ == null) { + ensureOrgPolicyIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, orgPolicy_); + onChanged(); + } else { + orgPolicyBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder clearOrgPolicy() { + if (orgPolicyBuilder_ == null) { + orgPolicy_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + orgPolicyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public Builder removeOrgPolicy(int index) { + if (orgPolicyBuilder_ == null) { + ensureOrgPolicyIsMutable(); + orgPolicy_.remove(index); + onChanged(); + } else { + orgPolicyBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public com.google.cloud.orgpolicy.v1.Policy.Builder getOrgPolicyBuilder(int index) { + return getOrgPolicyFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public com.google.cloud.orgpolicy.v1.PolicyOrBuilder getOrgPolicyOrBuilder(int index) { + if (orgPolicyBuilder_ == null) { + return orgPolicy_.get(index); + } else { + return orgPolicyBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public java.util.List + getOrgPolicyOrBuilderList() { + if (orgPolicyBuilder_ != null) { + return orgPolicyBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(orgPolicy_); + } + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public com.google.cloud.orgpolicy.v1.Policy.Builder addOrgPolicyBuilder() { + return getOrgPolicyFieldBuilder() + .addBuilder(com.google.cloud.orgpolicy.v1.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public com.google.cloud.orgpolicy.v1.Policy.Builder addOrgPolicyBuilder(int index) { + return getOrgPolicyFieldBuilder() + .addBuilder(index, com.google.cloud.orgpolicy.v1.Policy.getDefaultInstance()); + } + /** + * + * + *
+     * A representation of an [organization
+     * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+     * There can be more than one organization policy with different constraints
+     * set on a given resource.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public java.util.List getOrgPolicyBuilderList() { + return getOrgPolicyFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.orgpolicy.v1.Policy, + com.google.cloud.orgpolicy.v1.Policy.Builder, + com.google.cloud.orgpolicy.v1.PolicyOrBuilder> + getOrgPolicyFieldBuilder() { + if (orgPolicyBuilder_ == null) { + orgPolicyBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.orgpolicy.v1.Policy, + com.google.cloud.orgpolicy.v1.Policy.Builder, + com.google.cloud.orgpolicy.v1.PolicyOrBuilder>( + orgPolicy_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + orgPolicy_ = null; + } + return orgPolicyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.AccessPolicy, + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder, + com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder> + accessPolicyBuilder_; + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return Whether the accessPolicy field is set. + */ + @java.lang.Override + public boolean hasAccessPolicy() { + return accessContextPolicyCase_ == 7; + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return The accessPolicy. + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicy getAccessPolicy() { + if (accessPolicyBuilder_ == null) { + if (accessContextPolicyCase_ == 7) { + return (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } else { + if (accessContextPolicyCase_ == 7) { + return accessPolicyBuilder_.getMessage(); + } + return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + public Builder setAccessPolicy(com.google.identity.accesscontextmanager.v1.AccessPolicy value) { + if (accessPolicyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accessContextPolicy_ = value; + onChanged(); + } else { + accessPolicyBuilder_.setMessage(value); + } + accessContextPolicyCase_ = 7; + return this; + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + public Builder setAccessPolicy( + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder builderForValue) { + if (accessPolicyBuilder_ == null) { + accessContextPolicy_ = builderForValue.build(); + onChanged(); + } else { + accessPolicyBuilder_.setMessage(builderForValue.build()); + } + accessContextPolicyCase_ = 7; + return this; + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + public Builder mergeAccessPolicy( + com.google.identity.accesscontextmanager.v1.AccessPolicy value) { + if (accessPolicyBuilder_ == null) { + if (accessContextPolicyCase_ == 7 + && accessContextPolicy_ + != com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance()) { + accessContextPolicy_ = + com.google.identity.accesscontextmanager.v1.AccessPolicy.newBuilder( + (com.google.identity.accesscontextmanager.v1.AccessPolicy) + accessContextPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + accessContextPolicy_ = value; + } + onChanged(); + } else { + if (accessContextPolicyCase_ == 7) { + accessPolicyBuilder_.mergeFrom(value); + } + accessPolicyBuilder_.setMessage(value); + } + accessContextPolicyCase_ = 7; + return this; + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + public Builder clearAccessPolicy() { + if (accessPolicyBuilder_ == null) { + if (accessContextPolicyCase_ == 7) { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + onChanged(); + } + } else { + if (accessContextPolicyCase_ == 7) { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + } + accessPolicyBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + public com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder + getAccessPolicyBuilder() { + return getAccessPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder + getAccessPolicyOrBuilder() { + if ((accessContextPolicyCase_ == 7) && (accessPolicyBuilder_ != null)) { + return accessPolicyBuilder_.getMessageOrBuilder(); + } else { + if (accessContextPolicyCase_ == 7) { + return (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } + } + /** + * + * + *
+     * Please also refer to the [access policy user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.AccessPolicy, + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder, + com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder> + getAccessPolicyFieldBuilder() { + if (accessPolicyBuilder_ == null) { + if (!(accessContextPolicyCase_ == 7)) { + accessContextPolicy_ = + com.google.identity.accesscontextmanager.v1.AccessPolicy.getDefaultInstance(); + } + accessPolicyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.AccessPolicy, + com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder, + com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder>( + (com.google.identity.accesscontextmanager.v1.AccessPolicy) accessContextPolicy_, + getParentForChildren(), + isClean()); + accessContextPolicy_ = null; + } + accessContextPolicyCase_ = 7; + onChanged(); + ; + return accessPolicyBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.AccessLevel, + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder, + com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder> + accessLevelBuilder_; + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return Whether the accessLevel field is set. + */ + @java.lang.Override + public boolean hasAccessLevel() { + return accessContextPolicyCase_ == 8; + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return The accessLevel. + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevel getAccessLevel() { + if (accessLevelBuilder_ == null) { + if (accessContextPolicyCase_ == 8) { + return (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } else { + if (accessContextPolicyCase_ == 8) { + return accessLevelBuilder_.getMessage(); + } + return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + public Builder setAccessLevel(com.google.identity.accesscontextmanager.v1.AccessLevel value) { + if (accessLevelBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accessContextPolicy_ = value; + onChanged(); + } else { + accessLevelBuilder_.setMessage(value); + } + accessContextPolicyCase_ = 8; + return this; + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + public Builder setAccessLevel( + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder builderForValue) { + if (accessLevelBuilder_ == null) { + accessContextPolicy_ = builderForValue.build(); + onChanged(); + } else { + accessLevelBuilder_.setMessage(builderForValue.build()); + } + accessContextPolicyCase_ = 8; + return this; + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + public Builder mergeAccessLevel(com.google.identity.accesscontextmanager.v1.AccessLevel value) { + if (accessLevelBuilder_ == null) { + if (accessContextPolicyCase_ == 8 + && accessContextPolicy_ + != com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance()) { + accessContextPolicy_ = + com.google.identity.accesscontextmanager.v1.AccessLevel.newBuilder( + (com.google.identity.accesscontextmanager.v1.AccessLevel) + accessContextPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + accessContextPolicy_ = value; + } + onChanged(); + } else { + if (accessContextPolicyCase_ == 8) { + accessLevelBuilder_.mergeFrom(value); + } + accessLevelBuilder_.setMessage(value); + } + accessContextPolicyCase_ = 8; + return this; + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + public Builder clearAccessLevel() { + if (accessLevelBuilder_ == null) { + if (accessContextPolicyCase_ == 8) { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + onChanged(); + } + } else { + if (accessContextPolicyCase_ == 8) { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + } + accessLevelBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + public com.google.identity.accesscontextmanager.v1.AccessLevel.Builder getAccessLevelBuilder() { + return getAccessLevelFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder + getAccessLevelOrBuilder() { + if ((accessContextPolicyCase_ == 8) && (accessLevelBuilder_ != null)) { + return accessLevelBuilder_.getMessageOrBuilder(); + } else { + if (accessContextPolicyCase_ == 8) { + return (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } + } + /** + * + * + *
+     * Please also refer to the [access level user
+     * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.AccessLevel, + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder, + com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder> + getAccessLevelFieldBuilder() { + if (accessLevelBuilder_ == null) { + if (!(accessContextPolicyCase_ == 8)) { + accessContextPolicy_ = + com.google.identity.accesscontextmanager.v1.AccessLevel.getDefaultInstance(); + } + accessLevelBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.AccessLevel, + com.google.identity.accesscontextmanager.v1.AccessLevel.Builder, + com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder>( + (com.google.identity.accesscontextmanager.v1.AccessLevel) accessContextPolicy_, + getParentForChildren(), + isClean()); + accessContextPolicy_ = null; + } + accessContextPolicyCase_ = 8; + onChanged(); + ; + return accessLevelBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeter, + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder> + servicePerimeterBuilder_; + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return Whether the servicePerimeter field is set. + */ + @java.lang.Override + public boolean hasServicePerimeter() { + return accessContextPolicyCase_ == 9; + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return The servicePerimeter. + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeter getServicePerimeter() { + if (servicePerimeterBuilder_ == null) { + if (accessContextPolicyCase_ == 9) { + return (com.google.identity.accesscontextmanager.v1.ServicePerimeter) + accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } else { + if (accessContextPolicyCase_ == 9) { + return servicePerimeterBuilder_.getMessage(); + } + return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + public Builder setServicePerimeter( + com.google.identity.accesscontextmanager.v1.ServicePerimeter value) { + if (servicePerimeterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + accessContextPolicy_ = value; + onChanged(); + } else { + servicePerimeterBuilder_.setMessage(value); + } + accessContextPolicyCase_ = 9; + return this; + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + public Builder setServicePerimeter( + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder builderForValue) { + if (servicePerimeterBuilder_ == null) { + accessContextPolicy_ = builderForValue.build(); + onChanged(); + } else { + servicePerimeterBuilder_.setMessage(builderForValue.build()); + } + accessContextPolicyCase_ = 9; + return this; + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + public Builder mergeServicePerimeter( + com.google.identity.accesscontextmanager.v1.ServicePerimeter value) { + if (servicePerimeterBuilder_ == null) { + if (accessContextPolicyCase_ == 9 + && accessContextPolicy_ + != com.google.identity.accesscontextmanager.v1.ServicePerimeter + .getDefaultInstance()) { + accessContextPolicy_ = + com.google.identity.accesscontextmanager.v1.ServicePerimeter.newBuilder( + (com.google.identity.accesscontextmanager.v1.ServicePerimeter) + accessContextPolicy_) + .mergeFrom(value) + .buildPartial(); + } else { + accessContextPolicy_ = value; + } + onChanged(); + } else { + if (accessContextPolicyCase_ == 9) { + servicePerimeterBuilder_.mergeFrom(value); + } + servicePerimeterBuilder_.setMessage(value); + } + accessContextPolicyCase_ = 9; + return this; + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + public Builder clearServicePerimeter() { + if (servicePerimeterBuilder_ == null) { + if (accessContextPolicyCase_ == 9) { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + onChanged(); + } + } else { + if (accessContextPolicyCase_ == 9) { + accessContextPolicyCase_ = 0; + accessContextPolicy_ = null; + } + servicePerimeterBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder + getServicePerimeterBuilder() { + return getServicePerimeterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + @java.lang.Override + public com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder + getServicePerimeterOrBuilder() { + if ((accessContextPolicyCase_ == 9) && (servicePerimeterBuilder_ != null)) { + return servicePerimeterBuilder_.getMessageOrBuilder(); + } else { + if (accessContextPolicyCase_ == 9) { + return (com.google.identity.accesscontextmanager.v1.ServicePerimeter) + accessContextPolicy_; + } + return com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } + } + /** + * + * + *
+     * Please also refer to the [service perimeter user
+     * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+     * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeter, + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder> + getServicePerimeterFieldBuilder() { + if (servicePerimeterBuilder_ == null) { + if (!(accessContextPolicyCase_ == 9)) { + accessContextPolicy_ = + com.google.identity.accesscontextmanager.v1.ServicePerimeter.getDefaultInstance(); + } + servicePerimeterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.identity.accesscontextmanager.v1.ServicePerimeter, + com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder, + com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder>( + (com.google.identity.accesscontextmanager.v1.ServicePerimeter) accessContextPolicy_, + getParentForChildren(), + isClean()); + accessContextPolicy_ = null; + } + accessContextPolicyCase_ = 9; + onChanged(); + ; + return servicePerimeterBuilder_; + } + + private com.google.cloud.asset.v1p7beta1.RelatedAssets relatedAssets_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelatedAssets, + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder, + com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder> + relatedAssetsBuilder_; + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + * + * @return Whether the relatedAssets field is set. + */ + public boolean hasRelatedAssets() { + return relatedAssetsBuilder_ != null || relatedAssets_ != null; + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + * + * @return The relatedAssets. + */ + public com.google.cloud.asset.v1p7beta1.RelatedAssets getRelatedAssets() { + if (relatedAssetsBuilder_ == null) { + return relatedAssets_ == null + ? com.google.cloud.asset.v1p7beta1.RelatedAssets.getDefaultInstance() + : relatedAssets_; + } else { + return relatedAssetsBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + public Builder setRelatedAssets(com.google.cloud.asset.v1p7beta1.RelatedAssets value) { + if (relatedAssetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + relatedAssets_ = value; + onChanged(); + } else { + relatedAssetsBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + public Builder setRelatedAssets( + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder builderForValue) { + if (relatedAssetsBuilder_ == null) { + relatedAssets_ = builderForValue.build(); + onChanged(); + } else { + relatedAssetsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + public Builder mergeRelatedAssets(com.google.cloud.asset.v1p7beta1.RelatedAssets value) { + if (relatedAssetsBuilder_ == null) { + if (relatedAssets_ != null) { + relatedAssets_ = + com.google.cloud.asset.v1p7beta1.RelatedAssets.newBuilder(relatedAssets_) + .mergeFrom(value) + .buildPartial(); + } else { + relatedAssets_ = value; + } + onChanged(); + } else { + relatedAssetsBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + public Builder clearRelatedAssets() { + if (relatedAssetsBuilder_ == null) { + relatedAssets_ = null; + onChanged(); + } else { + relatedAssets_ = null; + relatedAssetsBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder getRelatedAssetsBuilder() { + + onChanged(); + return getRelatedAssetsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder getRelatedAssetsOrBuilder() { + if (relatedAssetsBuilder_ != null) { + return relatedAssetsBuilder_.getMessageOrBuilder(); + } else { + return relatedAssets_ == null + ? com.google.cloud.asset.v1p7beta1.RelatedAssets.getDefaultInstance() + : relatedAssets_; + } + } + /** + * + * + *
+     * The related assets of the asset of one relationship type.
+     * One asset only represents one type of relationship.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelatedAssets, + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder, + com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder> + getRelatedAssetsFieldBuilder() { + if (relatedAssetsBuilder_ == null) { + relatedAssetsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelatedAssets, + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder, + com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder>( + getRelatedAssets(), getParentForChildren(), isClean()); + relatedAssets_ = null; + } + return relatedAssetsBuilder_; + } + + private com.google.protobuf.LazyStringList ancestors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAncestorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ancestors_ = new com.google.protobuf.LazyStringArrayList(ancestors_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @return A list containing the ancestors. + */ + public com.google.protobuf.ProtocolStringList getAncestorsList() { + return ancestors_.getUnmodifiableView(); + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @return The count of ancestors. + */ + public int getAncestorsCount() { + return ancestors_.size(); + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @param index The index of the element to return. + * @return The ancestors at the given index. + */ + public java.lang.String getAncestors(int index) { + return ancestors_.get(index); + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @param index The index of the value to return. + * @return The bytes of the ancestors at the given index. + */ + public com.google.protobuf.ByteString getAncestorsBytes(int index) { + return ancestors_.getByteString(index); + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @param index The index to set the value at. + * @param value The ancestors to set. + * @return This builder for chaining. + */ + public Builder setAncestors(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAncestorsIsMutable(); + ancestors_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @param value The ancestors to add. + * @return This builder for chaining. + */ + public Builder addAncestors(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAncestorsIsMutable(); + ancestors_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @param values The ancestors to add. + * @return This builder for chaining. + */ + public Builder addAllAncestors(java.lang.Iterable values) { + ensureAncestorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ancestors_); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @return This builder for chaining. + */ + public Builder clearAncestors() { + ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestry path of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root. If the asset
+     * is a project, folder, or organization, the ancestry path starts from the
+     * asset itself.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 10; + * + * @param value The bytes of the ancestors to add. + * @return This builder for chaining. + */ + public Builder addAncestorsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAncestorsIsMutable(); + ancestors_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p7beta1.Asset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.Asset) + private static final com.google.cloud.asset.v1p7beta1.Asset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.Asset(); + } + + public static com.google.cloud.asset.v1p7beta1.Asset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Asset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Asset(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.asset.v1p7beta1.Asset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetOrBuilder.java new file mode 100644 index 000000000..37bfc62b5 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetOrBuilder.java @@ -0,0 +1,519 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface AssetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.Asset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The last update timestamp of an asset. update_time is updated when
+   * create/update/delete operation is performed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * The last update timestamp of an asset. update_time is updated when
+   * create/update/delete operation is performed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * The last update timestamp of an asset. update_time is updated when
+   * create/update/delete operation is performed.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 11; + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string name = 1; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string name = 1; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + java.lang.String getAssetType(); + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + com.google.protobuf.ByteString getAssetTypeBytes(); + + /** + * + * + *
+   * A representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * A representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + * + * @return The resource. + */ + com.google.cloud.asset.v1p7beta1.Resource getResource(); + /** + * + * + *
+   * A representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.Resource resource = 3; + */ + com.google.cloud.asset.v1p7beta1.ResourceOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+   * A representation of the Cloud IAM policy set on a Google Cloud resource.
+   * There can be a maximum of one Cloud IAM policy set on any given resource.
+   * In addition, Cloud IAM policies inherit their granted access scope from any
+   * policies set on parent resources in the resource hierarchy. Therefore, the
+   * effectively policy is the union of both the policy set on this resource
+   * and each policy set on all of the resource's ancestry resource levels in
+   * the hierarchy. See
+   * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+   * more information.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return Whether the iamPolicy field is set. + */ + boolean hasIamPolicy(); + /** + * + * + *
+   * A representation of the Cloud IAM policy set on a Google Cloud resource.
+   * There can be a maximum of one Cloud IAM policy set on any given resource.
+   * In addition, Cloud IAM policies inherit their granted access scope from any
+   * policies set on parent resources in the resource hierarchy. Therefore, the
+   * effectively policy is the union of both the policy set on this resource
+   * and each policy set on all of the resource's ancestry resource levels in
+   * the hierarchy. See
+   * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+   * more information.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return The iamPolicy. + */ + com.google.iam.v1.Policy getIamPolicy(); + /** + * + * + *
+   * A representation of the Cloud IAM policy set on a Google Cloud resource.
+   * There can be a maximum of one Cloud IAM policy set on any given resource.
+   * In addition, Cloud IAM policies inherit their granted access scope from any
+   * policies set on parent resources in the resource hierarchy. Therefore, the
+   * effectively policy is the union of both the policy set on this resource
+   * and each policy set on all of the resource's ancestry resource levels in
+   * the hierarchy. See
+   * [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for
+   * more information.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder(); + + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + java.util.List getOrgPolicyList(); + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + com.google.cloud.orgpolicy.v1.Policy getOrgPolicy(int index); + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + int getOrgPolicyCount(); + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + java.util.List + getOrgPolicyOrBuilderList(); + /** + * + * + *
+   * A representation of an [organization
+   * policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy).
+   * There can be more than one organization policy with different constraints
+   * set on a given resource.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + com.google.cloud.orgpolicy.v1.PolicyOrBuilder getOrgPolicyOrBuilder(int index); + + /** + * + * + *
+   * Please also refer to the [access policy user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return Whether the accessPolicy field is set. + */ + boolean hasAccessPolicy(); + /** + * + * + *
+   * Please also refer to the [access policy user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return The accessPolicy. + */ + com.google.identity.accesscontextmanager.v1.AccessPolicy getAccessPolicy(); + /** + * + * + *
+   * Please also refer to the [access policy user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + */ + com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder getAccessPolicyOrBuilder(); + + /** + * + * + *
+   * Please also refer to the [access level user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return Whether the accessLevel field is set. + */ + boolean hasAccessLevel(); + /** + * + * + *
+   * Please also refer to the [access level user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return The accessLevel. + */ + com.google.identity.accesscontextmanager.v1.AccessLevel getAccessLevel(); + /** + * + * + *
+   * Please also refer to the [access level user
+   * guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + */ + com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder getAccessLevelOrBuilder(); + + /** + * + * + *
+   * Please also refer to the [service perimeter user
+   * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return Whether the servicePerimeter field is set. + */ + boolean hasServicePerimeter(); + /** + * + * + *
+   * Please also refer to the [service perimeter user
+   * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return The servicePerimeter. + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeter getServicePerimeter(); + /** + * + * + *
+   * Please also refer to the [service perimeter user
+   * guide](https://cloud.google.com/vpc-service-controls/docs/overview).
+   * 
+ * + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder + getServicePerimeterOrBuilder(); + + /** + * + * + *
+   * The related assets of the asset of one relationship type.
+   * One asset only represents one type of relationship.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + * + * @return Whether the relatedAssets field is set. + */ + boolean hasRelatedAssets(); + /** + * + * + *
+   * The related assets of the asset of one relationship type.
+   * One asset only represents one type of relationship.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + * + * @return The relatedAssets. + */ + com.google.cloud.asset.v1p7beta1.RelatedAssets getRelatedAssets(); + /** + * + * + *
+   * The related assets of the asset of one relationship type.
+   * One asset only represents one type of relationship.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelatedAssets related_assets = 13; + */ + com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder getRelatedAssetsOrBuilder(); + + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @return A list containing the ancestors. + */ + java.util.List getAncestorsList(); + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @return The count of ancestors. + */ + int getAncestorsCount(); + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @param index The index of the element to return. + * @return The ancestors at the given index. + */ + java.lang.String getAncestors(int index); + /** + * + * + *
+   * The ancestry path of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root. If the asset
+   * is a project, folder, or organization, the ancestry path starts from the
+   * asset itself.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 10; + * + * @param index The index of the value to return. + * @return The bytes of the ancestors at the given index. + */ + com.google.protobuf.ByteString getAncestorsBytes(int index); + + public com.google.cloud.asset.v1p7beta1.Asset.AccessContextPolicyCase + getAccessContextPolicyCase(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetProto.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetProto.java new file mode 100644 index 000000000..2df5fb560 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetProto.java @@ -0,0 +1,202 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +public final class AssetProto { + private AssetProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_Asset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_Asset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_Resource_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n)google/cloud/asset/v1p7beta1/assets.pr" + + "oto\022\034google.cloud.asset.v1p7beta1\032\034googl" + + "e/api/annotations.proto\032\031google/api/reso" + + "urce.proto\032)google/cloud/orgpolicy/v1/or" + + "gpolicy.proto\032(google/cloud/osconfig/v1/" + + "inventory.proto\032\032google/iam/v1/policy.pr" + + "oto\032:google/identity/accesscontextmanage" + + "r/v1/access_level.proto\032;google/identity" + + "/accesscontextmanager/v1/access_policy.p" + + "roto\032?google/identity/accesscontextmanag" + + "er/v1/service_perimeter.proto\032\031google/pr" + + "otobuf/any.proto\032\034google/protobuf/struct" + + ".proto\032\037google/protobuf/timestamp.proto\"" + + "\206\005\n\005Asset\022/\n\013update_time\030\013 \001(\0132\032.google." + + "protobuf.Timestamp\022\014\n\004name\030\001 \001(\t\022\022\n\nasse" + + "t_type\030\002 \001(\t\0228\n\010resource\030\003 \001(\0132&.google." + + "cloud.asset.v1p7beta1.Resource\022)\n\niam_po" + + "licy\030\004 \001(\0132\025.google.iam.v1.Policy\0225\n\norg" + + "_policy\030\006 \003(\0132!.google.cloud.orgpolicy.v" + + "1.Policy\022N\n\raccess_policy\030\007 \001(\01325.google" + + ".identity.accesscontextmanager.v1.Access" + + "PolicyH\000\022L\n\014access_level\030\010 \001(\01324.google." + + "identity.accesscontextmanager.v1.AccessL" + + "evelH\000\022V\n\021service_perimeter\030\t \001(\01329.goog" + + "le.identity.accesscontextmanager.v1.Serv" + + "icePerimeterH\000\022C\n\016related_assets\030\r \001(\0132+" + + ".google.cloud.asset.v1p7beta1.RelatedAss" + + "ets\022\021\n\tancestors\030\n \003(\t:\'\352A$\n\037cloudasset." + + "googleapis.com/Asset\022\001*B\027\n\025access_contex" + + "t_policy\"\262\001\n\010Resource\022\017\n\007version\030\001 \001(\t\022\036" + + "\n\026discovery_document_uri\030\002 \001(\t\022\026\n\016discov" + + "ery_name\030\003 \001(\t\022\024\n\014resource_url\030\004 \001(\t\022\016\n\006" + + "parent\030\005 \001(\t\022%\n\004data\030\006 \001(\0132\027.google.prot" + + "obuf.Struct\022\020\n\010location\030\010 \001(\t\"\242\001\n\rRelate" + + "dAssets\022U\n\027relationship_attributes\030\001 \001(\013" + + "24.google.cloud.asset.v1p7beta1.Relation" + + "shipAttributes\022:\n\006assets\030\002 \003(\0132*.google." + + "cloud.asset.v1p7beta1.RelatedAsset\"r\n\026Re" + + "lationshipAttributes\022\014\n\004type\030\004 \001(\t\022\034\n\024so" + + "urce_resource_type\030\001 \001(\t\022\034\n\024target_resou" + + "rce_type\030\002 \001(\t\022\016\n\006action\030\003 \001(\t\"j\n\014Relate" + + "dAsset\0223\n\005asset\030\001 \001(\tB$\372A!\n\037cloudasset.g" + + "oogleapis.com/Asset\022\022\n\nasset_type\030\002 \001(\t\022" + + "\021\n\tancestors\030\003 \003(\tB\264\001\n com.google.cloud." + + "asset.v1p7beta1B\nAssetProtoP\001ZAgoogle.go" + + "lang.org/genproto/googleapis/cloud/asset" + + "/v1p7beta1;asset\370\001\001\252\002\034Google.Cloud.Asset" + + ".V1P7Beta1\312\002\034Google\\Cloud\\Asset\\V1p7beta" + + "1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.orgpolicy.v1.OrgPolicyProto.getDescriptor(), + com.google.cloud.osconfig.v1.Inventories.getDescriptor(), + com.google.iam.v1.PolicyProto.getDescriptor(), + com.google.identity.accesscontextmanager.v1.AccessLevelProto.getDescriptor(), + com.google.identity.accesscontextmanager.v1.PolicyProto.getDescriptor(), + com.google.identity.accesscontextmanager.v1.ServicePerimeterProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.StructProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_asset_v1p7beta1_Asset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_asset_v1p7beta1_Asset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_Asset_descriptor, + new java.lang.String[] { + "UpdateTime", + "Name", + "AssetType", + "Resource", + "IamPolicy", + "OrgPolicy", + "AccessPolicy", + "AccessLevel", + "ServicePerimeter", + "RelatedAssets", + "Ancestors", + "AccessContextPolicy", + }); + internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_asset_v1p7beta1_Resource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor, + new java.lang.String[] { + "Version", + "DiscoveryDocumentUri", + "DiscoveryName", + "ResourceUrl", + "Parent", + "Data", + "Location", + }); + internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_descriptor, + new java.lang.String[] { + "RelationshipAttributes", "Assets", + }); + internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_descriptor, + new java.lang.String[] { + "Type", "SourceResourceType", "TargetResourceType", "Action", + }); + internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_descriptor, + new java.lang.String[] { + "Asset", "AssetType", "Ancestors", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + 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.AnnotationsProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.orgpolicy.v1.OrgPolicyProto.getDescriptor(); + com.google.cloud.osconfig.v1.Inventories.getDescriptor(); + com.google.iam.v1.PolicyProto.getDescriptor(); + com.google.identity.accesscontextmanager.v1.AccessLevelProto.getDescriptor(); + com.google.identity.accesscontextmanager.v1.PolicyProto.getDescriptor(); + com.google.identity.accesscontextmanager.v1.ServicePerimeterProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.StructProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceProto.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceProto.java new file mode 100644 index 000000000..1cd5b7494 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/AssetServiceProto.java @@ -0,0 +1,235 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public final class AssetServiceProto { + private AssetServiceProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_OutputConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_OutputConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_OutputResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_OutputResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_GcsDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_GcsDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n0google/cloud/asset/v1p7beta1/asset_ser" + + "vice.proto\022\034google.cloud.asset.v1p7beta1" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032\031google/api/resource.proto\032)goo" + + "gle/cloud/asset/v1p7beta1/assets.proto\032#" + + "google/longrunning/operations.proto\032\033goo" + + "gle/protobuf/empty.proto\032 google/protobu" + + "f/field_mask.proto\032\037google/protobuf/time" + + "stamp.proto\"\267\002\n\023ExportAssetsRequest\0227\n\006p" + + "arent\030\001 \001(\tB\'\340A\002\372A!\022\037cloudasset.googleap" + + "is.com/Asset\022-\n\tread_time\030\002 \001(\0132\032.google" + + ".protobuf.Timestamp\022\023\n\013asset_types\030\003 \003(\t" + + "\022?\n\014content_type\030\004 \001(\0162).google.cloud.as" + + "set.v1p7beta1.ContentType\022F\n\routput_conf" + + "ig\030\005 \001(\0132*.google.cloud.asset.v1p7beta1." + + "OutputConfigB\003\340A\002\022\032\n\022relationship_types\030" + + "\006 \003(\t\"\313\001\n\024ExportAssetsResponse\022-\n\tread_t" + + "ime\030\001 \001(\0132\032.google.protobuf.Timestamp\022A\n" + + "\routput_config\030\002 \001(\0132*.google.cloud.asse" + + "t.v1p7beta1.OutputConfig\022A\n\routput_resul" + + "t\030\003 \001(\0132*.google.cloud.asset.v1p7beta1.O" + + "utputResult\"\271\001\n\014OutputConfig\022G\n\017gcs_dest" + + "ination\030\001 \001(\0132,.google.cloud.asset.v1p7b" + + "eta1.GcsDestinationH\000\022Q\n\024bigquery_destin" + + "ation\030\002 \001(\01321.google.cloud.asset.v1p7bet" + + "a1.BigQueryDestinationH\000B\r\n\013destination\"" + + "]\n\014OutputResult\022C\n\ngcs_result\030\001 \001(\0132-.go" + + "ogle.cloud.asset.v1p7beta1.GcsOutputResu" + + "ltH\000B\010\n\006result\"\037\n\017GcsOutputResult\022\014\n\004uri" + + "s\030\001 \003(\t\"C\n\016GcsDestination\022\r\n\003uri\030\001 \001(\tH\000" + + "\022\024\n\nuri_prefix\030\002 \001(\tH\000B\014\n\nobject_uri\"\273\001\n" + + "\023BigQueryDestination\022\024\n\007dataset\030\001 \001(\tB\003\340" + + "A\002\022\022\n\005table\030\002 \001(\tB\003\340A\002\022\r\n\005force\030\003 \001(\010\022C\n" + + "\016partition_spec\030\004 \001(\0132+.google.cloud.ass" + + "et.v1p7beta1.PartitionSpec\022&\n\036separate_t" + + "ables_per_asset_type\030\005 \001(\010\"\260\001\n\rPartition" + + "Spec\022O\n\rpartition_key\030\001 \001(\01628.google.clo" + + "ud.asset.v1p7beta1.PartitionSpec.Partiti" + + "onKey\"N\n\014PartitionKey\022\035\n\031PARTITION_KEY_U" + + "NSPECIFIED\020\000\022\r\n\tREAD_TIME\020\001\022\020\n\014REQUEST_T" + + "IME\020\002*~\n\013ContentType\022\034\n\030CONTENT_TYPE_UNS" + + "PECIFIED\020\000\022\014\n\010RESOURCE\020\001\022\016\n\nIAM_POLICY\020\002" + + "\022\016\n\nORG_POLICY\020\004\022\021\n\rACCESS_POLICY\020\005\022\020\n\014R" + + "ELATIONSHIP\020\0072\332\002\n\014AssetService\022\372\001\n\014Expor" + + "tAssets\0221.google.cloud.asset.v1p7beta1.E" + + "xportAssetsRequest\032\035.google.longrunning." + + "Operation\"\227\001\202\323\344\223\002)\"$/v1p7beta1/{parent=*" + + "/*}:exportAssets:\001*\312Ae\n1google.cloud.ass" + + "et.v1p7beta1.ExportAssetsResponse\0220googl" + + "e.cloud.asset.v1p7beta1.ExportAssetsRequ" + + "est\032M\312A\031cloudasset.googleapis.com\322A.http" + + "s://www.googleapis.com/auth/cloud-platfo" + + "rmB\270\001\n com.google.cloud.asset.v1p7beta1B" + + "\021AssetServiceProtoP\001ZAgoogle.golang.org/" + + "genproto/googleapis/cloud/asset/v1p7beta" + + "1;asset\252\002\034Google.Cloud.Asset.V1P7Beta1\312\002" + + "\034Google\\Cloud\\Asset\\V1p7beta1b\006proto3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.api.ClientProto.getDescriptor(), + com.google.api.FieldBehaviorProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.cloud.asset.v1p7beta1.AssetProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_descriptor, + new java.lang.String[] { + "Parent", + "ReadTime", + "AssetTypes", + "ContentType", + "OutputConfig", + "RelationshipTypes", + }); + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_descriptor, + new java.lang.String[] { + "ReadTime", "OutputConfig", "OutputResult", + }); + internal_static_google_cloud_asset_v1p7beta1_OutputConfig_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_asset_v1p7beta1_OutputConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_OutputConfig_descriptor, + new java.lang.String[] { + "GcsDestination", "BigqueryDestination", "Destination", + }); + internal_static_google_cloud_asset_v1p7beta1_OutputResult_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_asset_v1p7beta1_OutputResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_OutputResult_descriptor, + new java.lang.String[] { + "GcsResult", "Result", + }); + internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_descriptor, + new java.lang.String[] { + "Uris", + }); + internal_static_google_cloud_asset_v1p7beta1_GcsDestination_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_asset_v1p7beta1_GcsDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_GcsDestination_descriptor, + new java.lang.String[] { + "Uri", "UriPrefix", "ObjectUri", + }); + internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_descriptor, + new java.lang.String[] { + "Dataset", "Table", "Force", "PartitionSpec", "SeparateTablesPerAssetType", + }); + internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_descriptor, + new java.lang.String[] { + "PartitionKey", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ClientProto.defaultHost); + registry.add(com.google.api.FieldBehaviorProto.fieldBehavior); + registry.add(com.google.api.AnnotationsProto.http); + registry.add(com.google.api.ClientProto.oauthScopes); + registry.add(com.google.api.ResourceProto.resourceReference); + registry.add(com.google.longrunning.OperationsProto.operationInfo); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.api.ClientProto.getDescriptor(); + com.google.api.FieldBehaviorProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.cloud.asset.v1p7beta1.AssetProto.getDescriptor(); + com.google.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestination.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestination.java new file mode 100644 index 000000000..a46724c9a --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestination.java @@ -0,0 +1,1580 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * A BigQuery destination for exporting assets to.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.BigQueryDestination} + */ +public final class BigQueryDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.BigQueryDestination) + BigQueryDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use BigQueryDestination.newBuilder() to construct. + private BigQueryDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private BigQueryDestination() { + dataset_ = ""; + table_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new BigQueryDestination(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private BigQueryDestination( + 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(); + + dataset_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + table_ = s; + break; + } + case 24: + { + force_ = input.readBool(); + break; + } + case 34: + { + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder subBuilder = null; + if (partitionSpec_ != null) { + subBuilder = partitionSpec_.toBuilder(); + } + partitionSpec_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.PartitionSpec.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(partitionSpec_); + partitionSpec_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + separateTablesPerAssetType_ = input.readBool(); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.BigQueryDestination.class, + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder.class); + } + + public static final int DATASET_FIELD_NUMBER = 1; + private volatile java.lang.Object dataset_; + /** + * + * + *
+   * Required. The BigQuery dataset in format
+   * "projects/projectId/datasets/datasetId", to which the snapshot result
+   * should be exported. If this dataset does not exist, the export call returns
+   * an INVALID_ARGUMENT error.
+   * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dataset. + */ + @java.lang.Override + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + 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(); + dataset_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BigQuery dataset in format
+   * "projects/projectId/datasets/datasetId", to which the snapshot result
+   * should be exported. If this dataset does not exist, the export call returns
+   * an INVALID_ARGUMENT error.
+   * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dataset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TABLE_FIELD_NUMBER = 2; + private volatile java.lang.Object table_; + /** + * + * + *
+   * Required. The BigQuery table to which the snapshot result should be
+   * written. If this table does not exist, a new table with the given name
+   * will be created.
+   * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The table. + */ + @java.lang.Override + public java.lang.String getTable() { + java.lang.Object ref = table_; + 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(); + table_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The BigQuery table to which the snapshot result should be
+   * written. If this table does not exist, a new table with the given name
+   * will be created.
+   * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for table. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORCE_FIELD_NUMBER = 3; + private boolean force_; + /** + * + * + *
+   * If the destination table already exists and this flag is `TRUE`, the
+   * table will be overwritten by the contents of assets snapshot. If the flag
+   * is `FALSE` or unset and the destination table already exists, the export
+   * call returns an INVALID_ARGUMEMT error.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + + public static final int PARTITION_SPEC_FIELD_NUMBER = 4; + private com.google.cloud.asset.v1p7beta1.PartitionSpec partitionSpec_; + /** + * + * + *
+   * [partition_spec] determines whether to export to partitioned table(s) and
+   * how to partition the data.
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+   * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+   * non-partitioned table(s). [force] will decide whether to overwrite existing
+   * table(s).
+   * If [partition_spec] is specified. First, the snapshot results will be
+   * written to partitioned table(s) with two additional timestamp columns,
+   * readTime and requestTime, one of which will be the partition key. Secondly,
+   * in the case when any destination table already exists, it will first try to
+   * update existing table's schema as necessary by appending additional
+   * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+   * overwritten by the snapshot results (data in different partitions will
+   * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+   * error will be returned if the schema update or data appension fails.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + * + * @return Whether the partitionSpec field is set. + */ + @java.lang.Override + public boolean hasPartitionSpec() { + return partitionSpec_ != null; + } + /** + * + * + *
+   * [partition_spec] determines whether to export to partitioned table(s) and
+   * how to partition the data.
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+   * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+   * non-partitioned table(s). [force] will decide whether to overwrite existing
+   * table(s).
+   * If [partition_spec] is specified. First, the snapshot results will be
+   * written to partitioned table(s) with two additional timestamp columns,
+   * readTime and requestTime, one of which will be the partition key. Secondly,
+   * in the case when any destination table already exists, it will first try to
+   * update existing table's schema as necessary by appending additional
+   * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+   * overwritten by the snapshot results (data in different partitions will
+   * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+   * error will be returned if the schema update or data appension fails.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + * + * @return The partitionSpec. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpec getPartitionSpec() { + return partitionSpec_ == null + ? com.google.cloud.asset.v1p7beta1.PartitionSpec.getDefaultInstance() + : partitionSpec_; + } + /** + * + * + *
+   * [partition_spec] determines whether to export to partitioned table(s) and
+   * how to partition the data.
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+   * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+   * non-partitioned table(s). [force] will decide whether to overwrite existing
+   * table(s).
+   * If [partition_spec] is specified. First, the snapshot results will be
+   * written to partitioned table(s) with two additional timestamp columns,
+   * readTime and requestTime, one of which will be the partition key. Secondly,
+   * in the case when any destination table already exists, it will first try to
+   * update existing table's schema as necessary by appending additional
+   * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+   * overwritten by the snapshot results (data in different partitions will
+   * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+   * error will be returned if the schema update or data appension fails.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder getPartitionSpecOrBuilder() { + return getPartitionSpec(); + } + + public static final int SEPARATE_TABLES_PER_ASSET_TYPE_FIELD_NUMBER = 5; + private boolean separateTablesPerAssetType_; + /** + * + * + *
+   * If this flag is `TRUE`, the snapshot results will be written to one or
+   * multiple tables, each of which contains results of one asset type. The
+   * [force] and [partition_spec] fields will apply to each of them.
+   * Field [table] will be concatenated with "_" and the asset type names (see
+   * https://cloud.google.com/asset-inventory/docs/supported-asset-types for
+   * supported asset types) to construct per-asset-type table names, in which
+   * all non-alphanumeric characters like "." and "/" will be substituted by
+   * "_". Example: if field [table] is "mytable" and snapshot results
+   * contain "storage.googleapis.com/Bucket" assets, the corresponding table
+   * name will be "mytable_storage_googleapis_com_Bucket". If any of these
+   * tables does not exist, a new table with the concatenated name will be
+   * created.
+   * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
+   * each table will include RECORD-type columns mapped to the nested fields in
+   * the Asset.resource.data field of that asset type (up to the 15 nested level
+   * BigQuery supports
+   * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
+   * fields in >15 nested levels will be stored in JSON format string as a child
+   * column of its parent RECORD column.
+   * If error occurs when exporting to any table, the whole export call will
+   * return an error but the export results that already succeed will persist.
+   * Example: if exporting to table_type_A succeeds when exporting to
+   * table_type_B fails during one export call, the results in table_type_A will
+   * persist and there will not be partial results persisting in a table.
+   * 
+ * + * bool separate_tables_per_asset_type = 5; + * + * @return The separateTablesPerAssetType. + */ + @java.lang.Override + public boolean getSeparateTablesPerAssetType() { + return separateTablesPerAssetType_; + } + + 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 (!getDatasetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, dataset_); + } + if (!getTableBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, table_); + } + if (force_ != false) { + output.writeBool(3, force_); + } + if (partitionSpec_ != null) { + output.writeMessage(4, getPartitionSpec()); + } + if (separateTablesPerAssetType_ != false) { + output.writeBool(5, separateTablesPerAssetType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getDatasetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, dataset_); + } + if (!getTableBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, table_); + } + if (force_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, force_); + } + if (partitionSpec_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getPartitionSpec()); + } + if (separateTablesPerAssetType_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, separateTablesPerAssetType_); + } + 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.asset.v1p7beta1.BigQueryDestination)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.BigQueryDestination other = + (com.google.cloud.asset.v1p7beta1.BigQueryDestination) obj; + + if (!getDataset().equals(other.getDataset())) return false; + if (!getTable().equals(other.getTable())) return false; + if (getForce() != other.getForce()) return false; + if (hasPartitionSpec() != other.hasPartitionSpec()) return false; + if (hasPartitionSpec()) { + if (!getPartitionSpec().equals(other.getPartitionSpec())) return false; + } + if (getSeparateTablesPerAssetType() != other.getSeparateTablesPerAssetType()) 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) + DATASET_FIELD_NUMBER; + hash = (53 * hash) + getDataset().hashCode(); + hash = (37 * hash) + TABLE_FIELD_NUMBER; + hash = (53 * hash) + getTable().hashCode(); + hash = (37 * hash) + FORCE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getForce()); + if (hasPartitionSpec()) { + hash = (37 * hash) + PARTITION_SPEC_FIELD_NUMBER; + hash = (53 * hash) + getPartitionSpec().hashCode(); + } + hash = (37 * hash) + SEPARATE_TABLES_PER_ASSET_TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getSeparateTablesPerAssetType()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination 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.asset.v1p7beta1.BigQueryDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination 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.asset.v1p7beta1.BigQueryDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination 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.asset.v1p7beta1.BigQueryDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination 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.asset.v1p7beta1.BigQueryDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination 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.asset.v1p7beta1.BigQueryDestination 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 BigQuery destination for exporting assets to.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.BigQueryDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.BigQueryDestination) + com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.BigQueryDestination.class, + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.BigQueryDestination.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(); + dataset_ = ""; + + table_ = ""; + + force_ = false; + + if (partitionSpecBuilder_ == null) { + partitionSpec_ = null; + } else { + partitionSpec_ = null; + partitionSpecBuilder_ = null; + } + separateTablesPerAssetType_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_BigQueryDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestination getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestination build() { + com.google.cloud.asset.v1p7beta1.BigQueryDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestination buildPartial() { + com.google.cloud.asset.v1p7beta1.BigQueryDestination result = + new com.google.cloud.asset.v1p7beta1.BigQueryDestination(this); + result.dataset_ = dataset_; + result.table_ = table_; + result.force_ = force_; + if (partitionSpecBuilder_ == null) { + result.partitionSpec_ = partitionSpec_; + } else { + result.partitionSpec_ = partitionSpecBuilder_.build(); + } + result.separateTablesPerAssetType_ = separateTablesPerAssetType_; + 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.asset.v1p7beta1.BigQueryDestination) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.BigQueryDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.BigQueryDestination other) { + if (other == com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance()) + return this; + if (!other.getDataset().isEmpty()) { + dataset_ = other.dataset_; + onChanged(); + } + if (!other.getTable().isEmpty()) { + table_ = other.table_; + onChanged(); + } + if (other.getForce() != false) { + setForce(other.getForce()); + } + if (other.hasPartitionSpec()) { + mergePartitionSpec(other.getPartitionSpec()); + } + if (other.getSeparateTablesPerAssetType() != false) { + setSeparateTablesPerAssetType(other.getSeparateTablesPerAssetType()); + } + 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.asset.v1p7beta1.BigQueryDestination parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p7beta1.BigQueryDestination) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object dataset_ = ""; + /** + * + * + *
+     * Required. The BigQuery dataset in format
+     * "projects/projectId/datasets/datasetId", to which the snapshot result
+     * should be exported. If this dataset does not exist, the export call returns
+     * an INVALID_ARGUMENT error.
+     * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dataset. + */ + public java.lang.String getDataset() { + java.lang.Object ref = dataset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery dataset in format
+     * "projects/projectId/datasets/datasetId", to which the snapshot result
+     * should be exported. If this dataset does not exist, the export call returns
+     * an INVALID_ARGUMENT error.
+     * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dataset. + */ + public com.google.protobuf.ByteString getDatasetBytes() { + java.lang.Object ref = dataset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + dataset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery dataset in format
+     * "projects/projectId/datasets/datasetId", to which the snapshot result
+     * should be exported. If this dataset does not exist, the export call returns
+     * an INVALID_ARGUMENT error.
+     * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The dataset to set. + * @return This builder for chaining. + */ + public Builder setDataset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery dataset in format
+     * "projects/projectId/datasets/datasetId", to which the snapshot result
+     * should be exported. If this dataset does not exist, the export call returns
+     * an INVALID_ARGUMENT error.
+     * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearDataset() { + + dataset_ = getDefaultInstance().getDataset(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery dataset in format
+     * "projects/projectId/datasets/datasetId", to which the snapshot result
+     * should be exported. If this dataset does not exist, the export call returns
+     * an INVALID_ARGUMENT error.
+     * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for dataset to set. + * @return This builder for chaining. + */ + public Builder setDatasetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataset_ = value; + onChanged(); + return this; + } + + private java.lang.Object table_ = ""; + /** + * + * + *
+     * Required. The BigQuery table to which the snapshot result should be
+     * written. If this table does not exist, a new table with the given name
+     * will be created.
+     * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The table. + */ + public java.lang.String getTable() { + java.lang.Object ref = table_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + table_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery table to which the snapshot result should be
+     * written. If this table does not exist, a new table with the given name
+     * will be created.
+     * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for table. + */ + public com.google.protobuf.ByteString getTableBytes() { + java.lang.Object ref = table_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + table_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The BigQuery table to which the snapshot result should be
+     * written. If this table does not exist, a new table with the given name
+     * will be created.
+     * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The table to set. + * @return This builder for chaining. + */ + public Builder setTable(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + table_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to which the snapshot result should be
+     * written. If this table does not exist, a new table with the given name
+     * will be created.
+     * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearTable() { + + table_ = getDefaultInstance().getTable(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The BigQuery table to which the snapshot result should be
+     * written. If this table does not exist, a new table with the given name
+     * will be created.
+     * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for table to set. + * @return This builder for chaining. + */ + public Builder setTableBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + table_ = value; + onChanged(); + return this; + } + + private boolean force_; + /** + * + * + *
+     * If the destination table already exists and this flag is `TRUE`, the
+     * table will be overwritten by the contents of assets snapshot. If the flag
+     * is `FALSE` or unset and the destination table already exists, the export
+     * call returns an INVALID_ARGUMEMT error.
+     * 
+ * + * bool force = 3; + * + * @return The force. + */ + @java.lang.Override + public boolean getForce() { + return force_; + } + /** + * + * + *
+     * If the destination table already exists and this flag is `TRUE`, the
+     * table will be overwritten by the contents of assets snapshot. If the flag
+     * is `FALSE` or unset and the destination table already exists, the export
+     * call returns an INVALID_ARGUMEMT error.
+     * 
+ * + * bool force = 3; + * + * @param value The force to set. + * @return This builder for chaining. + */ + public Builder setForce(boolean value) { + + force_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If the destination table already exists and this flag is `TRUE`, the
+     * table will be overwritten by the contents of assets snapshot. If the flag
+     * is `FALSE` or unset and the destination table already exists, the export
+     * call returns an INVALID_ARGUMEMT error.
+     * 
+ * + * bool force = 3; + * + * @return This builder for chaining. + */ + public Builder clearForce() { + + force_ = false; + onChanged(); + return this; + } + + private com.google.cloud.asset.v1p7beta1.PartitionSpec partitionSpec_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.PartitionSpec, + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder, + com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder> + partitionSpecBuilder_; + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + * + * @return Whether the partitionSpec field is set. + */ + public boolean hasPartitionSpec() { + return partitionSpecBuilder_ != null || partitionSpec_ != null; + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + * + * @return The partitionSpec. + */ + public com.google.cloud.asset.v1p7beta1.PartitionSpec getPartitionSpec() { + if (partitionSpecBuilder_ == null) { + return partitionSpec_ == null + ? com.google.cloud.asset.v1p7beta1.PartitionSpec.getDefaultInstance() + : partitionSpec_; + } else { + return partitionSpecBuilder_.getMessage(); + } + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + public Builder setPartitionSpec(com.google.cloud.asset.v1p7beta1.PartitionSpec value) { + if (partitionSpecBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + partitionSpec_ = value; + onChanged(); + } else { + partitionSpecBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + public Builder setPartitionSpec( + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder builderForValue) { + if (partitionSpecBuilder_ == null) { + partitionSpec_ = builderForValue.build(); + onChanged(); + } else { + partitionSpecBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + public Builder mergePartitionSpec(com.google.cloud.asset.v1p7beta1.PartitionSpec value) { + if (partitionSpecBuilder_ == null) { + if (partitionSpec_ != null) { + partitionSpec_ = + com.google.cloud.asset.v1p7beta1.PartitionSpec.newBuilder(partitionSpec_) + .mergeFrom(value) + .buildPartial(); + } else { + partitionSpec_ = value; + } + onChanged(); + } else { + partitionSpecBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + public Builder clearPartitionSpec() { + if (partitionSpecBuilder_ == null) { + partitionSpec_ = null; + onChanged(); + } else { + partitionSpec_ = null; + partitionSpecBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + public com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder getPartitionSpecBuilder() { + + onChanged(); + return getPartitionSpecFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + public com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder getPartitionSpecOrBuilder() { + if (partitionSpecBuilder_ != null) { + return partitionSpecBuilder_.getMessageOrBuilder(); + } else { + return partitionSpec_ == null + ? com.google.cloud.asset.v1p7beta1.PartitionSpec.getDefaultInstance() + : partitionSpec_; + } + } + /** + * + * + *
+     * [partition_spec] determines whether to export to partitioned table(s) and
+     * how to partition the data.
+     * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+     * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+     * non-partitioned table(s). [force] will decide whether to overwrite existing
+     * table(s).
+     * If [partition_spec] is specified. First, the snapshot results will be
+     * written to partitioned table(s) with two additional timestamp columns,
+     * readTime and requestTime, one of which will be the partition key. Secondly,
+     * in the case when any destination table already exists, it will first try to
+     * update existing table's schema as necessary by appending additional
+     * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+     * overwritten by the snapshot results (data in different partitions will
+     * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+     * error will be returned if the schema update or data appension fails.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.PartitionSpec, + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder, + com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder> + getPartitionSpecFieldBuilder() { + if (partitionSpecBuilder_ == null) { + partitionSpecBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.PartitionSpec, + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder, + com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder>( + getPartitionSpec(), getParentForChildren(), isClean()); + partitionSpec_ = null; + } + return partitionSpecBuilder_; + } + + private boolean separateTablesPerAssetType_; + /** + * + * + *
+     * If this flag is `TRUE`, the snapshot results will be written to one or
+     * multiple tables, each of which contains results of one asset type. The
+     * [force] and [partition_spec] fields will apply to each of them.
+     * Field [table] will be concatenated with "_" and the asset type names (see
+     * https://cloud.google.com/asset-inventory/docs/supported-asset-types for
+     * supported asset types) to construct per-asset-type table names, in which
+     * all non-alphanumeric characters like "." and "/" will be substituted by
+     * "_". Example: if field [table] is "mytable" and snapshot results
+     * contain "storage.googleapis.com/Bucket" assets, the corresponding table
+     * name will be "mytable_storage_googleapis_com_Bucket". If any of these
+     * tables does not exist, a new table with the concatenated name will be
+     * created.
+     * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
+     * each table will include RECORD-type columns mapped to the nested fields in
+     * the Asset.resource.data field of that asset type (up to the 15 nested level
+     * BigQuery supports
+     * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
+     * fields in >15 nested levels will be stored in JSON format string as a child
+     * column of its parent RECORD column.
+     * If error occurs when exporting to any table, the whole export call will
+     * return an error but the export results that already succeed will persist.
+     * Example: if exporting to table_type_A succeeds when exporting to
+     * table_type_B fails during one export call, the results in table_type_A will
+     * persist and there will not be partial results persisting in a table.
+     * 
+ * + * bool separate_tables_per_asset_type = 5; + * + * @return The separateTablesPerAssetType. + */ + @java.lang.Override + public boolean getSeparateTablesPerAssetType() { + return separateTablesPerAssetType_; + } + /** + * + * + *
+     * If this flag is `TRUE`, the snapshot results will be written to one or
+     * multiple tables, each of which contains results of one asset type. The
+     * [force] and [partition_spec] fields will apply to each of them.
+     * Field [table] will be concatenated with "_" and the asset type names (see
+     * https://cloud.google.com/asset-inventory/docs/supported-asset-types for
+     * supported asset types) to construct per-asset-type table names, in which
+     * all non-alphanumeric characters like "." and "/" will be substituted by
+     * "_". Example: if field [table] is "mytable" and snapshot results
+     * contain "storage.googleapis.com/Bucket" assets, the corresponding table
+     * name will be "mytable_storage_googleapis_com_Bucket". If any of these
+     * tables does not exist, a new table with the concatenated name will be
+     * created.
+     * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
+     * each table will include RECORD-type columns mapped to the nested fields in
+     * the Asset.resource.data field of that asset type (up to the 15 nested level
+     * BigQuery supports
+     * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
+     * fields in >15 nested levels will be stored in JSON format string as a child
+     * column of its parent RECORD column.
+     * If error occurs when exporting to any table, the whole export call will
+     * return an error but the export results that already succeed will persist.
+     * Example: if exporting to table_type_A succeeds when exporting to
+     * table_type_B fails during one export call, the results in table_type_A will
+     * persist and there will not be partial results persisting in a table.
+     * 
+ * + * bool separate_tables_per_asset_type = 5; + * + * @param value The separateTablesPerAssetType to set. + * @return This builder for chaining. + */ + public Builder setSeparateTablesPerAssetType(boolean value) { + + separateTablesPerAssetType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * If this flag is `TRUE`, the snapshot results will be written to one or
+     * multiple tables, each of which contains results of one asset type. The
+     * [force] and [partition_spec] fields will apply to each of them.
+     * Field [table] will be concatenated with "_" and the asset type names (see
+     * https://cloud.google.com/asset-inventory/docs/supported-asset-types for
+     * supported asset types) to construct per-asset-type table names, in which
+     * all non-alphanumeric characters like "." and "/" will be substituted by
+     * "_". Example: if field [table] is "mytable" and snapshot results
+     * contain "storage.googleapis.com/Bucket" assets, the corresponding table
+     * name will be "mytable_storage_googleapis_com_Bucket". If any of these
+     * tables does not exist, a new table with the concatenated name will be
+     * created.
+     * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
+     * each table will include RECORD-type columns mapped to the nested fields in
+     * the Asset.resource.data field of that asset type (up to the 15 nested level
+     * BigQuery supports
+     * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
+     * fields in >15 nested levels will be stored in JSON format string as a child
+     * column of its parent RECORD column.
+     * If error occurs when exporting to any table, the whole export call will
+     * return an error but the export results that already succeed will persist.
+     * Example: if exporting to table_type_A succeeds when exporting to
+     * table_type_B fails during one export call, the results in table_type_A will
+     * persist and there will not be partial results persisting in a table.
+     * 
+ * + * bool separate_tables_per_asset_type = 5; + * + * @return This builder for chaining. + */ + public Builder clearSeparateTablesPerAssetType() { + + separateTablesPerAssetType_ = false; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p7beta1.BigQueryDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.BigQueryDestination) + private static final com.google.cloud.asset.v1p7beta1.BigQueryDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.BigQueryDestination(); + } + + public static com.google.cloud.asset.v1p7beta1.BigQueryDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BigQueryDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BigQueryDestination(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.asset.v1p7beta1.BigQueryDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestinationOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestinationOrBuilder.java new file mode 100644 index 000000000..f388d517d --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/BigQueryDestinationOrBuilder.java @@ -0,0 +1,214 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface BigQueryDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.BigQueryDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The BigQuery dataset in format
+   * "projects/projectId/datasets/datasetId", to which the snapshot result
+   * should be exported. If this dataset does not exist, the export call returns
+   * an INVALID_ARGUMENT error.
+   * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The dataset. + */ + java.lang.String getDataset(); + /** + * + * + *
+   * Required. The BigQuery dataset in format
+   * "projects/projectId/datasets/datasetId", to which the snapshot result
+   * should be exported. If this dataset does not exist, the export call returns
+   * an INVALID_ARGUMENT error.
+   * 
+ * + * string dataset = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for dataset. + */ + com.google.protobuf.ByteString getDatasetBytes(); + + /** + * + * + *
+   * Required. The BigQuery table to which the snapshot result should be
+   * written. If this table does not exist, a new table with the given name
+   * will be created.
+   * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The table. + */ + java.lang.String getTable(); + /** + * + * + *
+   * Required. The BigQuery table to which the snapshot result should be
+   * written. If this table does not exist, a new table with the given name
+   * will be created.
+   * 
+ * + * string table = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for table. + */ + com.google.protobuf.ByteString getTableBytes(); + + /** + * + * + *
+   * If the destination table already exists and this flag is `TRUE`, the
+   * table will be overwritten by the contents of assets snapshot. If the flag
+   * is `FALSE` or unset and the destination table already exists, the export
+   * call returns an INVALID_ARGUMEMT error.
+   * 
+ * + * bool force = 3; + * + * @return The force. + */ + boolean getForce(); + + /** + * + * + *
+   * [partition_spec] determines whether to export to partitioned table(s) and
+   * how to partition the data.
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+   * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+   * non-partitioned table(s). [force] will decide whether to overwrite existing
+   * table(s).
+   * If [partition_spec] is specified. First, the snapshot results will be
+   * written to partitioned table(s) with two additional timestamp columns,
+   * readTime and requestTime, one of which will be the partition key. Secondly,
+   * in the case when any destination table already exists, it will first try to
+   * update existing table's schema as necessary by appending additional
+   * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+   * overwritten by the snapshot results (data in different partitions will
+   * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+   * error will be returned if the schema update or data appension fails.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + * + * @return Whether the partitionSpec field is set. + */ + boolean hasPartitionSpec(); + /** + * + * + *
+   * [partition_spec] determines whether to export to partitioned table(s) and
+   * how to partition the data.
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+   * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+   * non-partitioned table(s). [force] will decide whether to overwrite existing
+   * table(s).
+   * If [partition_spec] is specified. First, the snapshot results will be
+   * written to partitioned table(s) with two additional timestamp columns,
+   * readTime and requestTime, one of which will be the partition key. Secondly,
+   * in the case when any destination table already exists, it will first try to
+   * update existing table's schema as necessary by appending additional
+   * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+   * overwritten by the snapshot results (data in different partitions will
+   * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+   * error will be returned if the schema update or data appension fails.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + * + * @return The partitionSpec. + */ + com.google.cloud.asset.v1p7beta1.PartitionSpec getPartitionSpec(); + /** + * + * + *
+   * [partition_spec] determines whether to export to partitioned table(s) and
+   * how to partition the data.
+   * If [partition_spec] is unset or [partition_spec.partition_key] is unset or
+   * `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to
+   * non-partitioned table(s). [force] will decide whether to overwrite existing
+   * table(s).
+   * If [partition_spec] is specified. First, the snapshot results will be
+   * written to partitioned table(s) with two additional timestamp columns,
+   * readTime and requestTime, one of which will be the partition key. Secondly,
+   * in the case when any destination table already exists, it will first try to
+   * update existing table's schema as necessary by appending additional
+   * columns. Then, if [force] is `TRUE`, the corresponding partition will be
+   * overwritten by the snapshot results (data in different partitions will
+   * remain intact); if [force] is unset or `FALSE`, it will append the data. An
+   * error will be returned if the schema update or data appension fails.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec partition_spec = 4; + */ + com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder getPartitionSpecOrBuilder(); + + /** + * + * + *
+   * If this flag is `TRUE`, the snapshot results will be written to one or
+   * multiple tables, each of which contains results of one asset type. The
+   * [force] and [partition_spec] fields will apply to each of them.
+   * Field [table] will be concatenated with "_" and the asset type names (see
+   * https://cloud.google.com/asset-inventory/docs/supported-asset-types for
+   * supported asset types) to construct per-asset-type table names, in which
+   * all non-alphanumeric characters like "." and "/" will be substituted by
+   * "_". Example: if field [table] is "mytable" and snapshot results
+   * contain "storage.googleapis.com/Bucket" assets, the corresponding table
+   * name will be "mytable_storage_googleapis_com_Bucket". If any of these
+   * tables does not exist, a new table with the concatenated name will be
+   * created.
+   * When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of
+   * each table will include RECORD-type columns mapped to the nested fields in
+   * the Asset.resource.data field of that asset type (up to the 15 nested level
+   * BigQuery supports
+   * (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The
+   * fields in >15 nested levels will be stored in JSON format string as a child
+   * column of its parent RECORD column.
+   * If error occurs when exporting to any table, the whole export call will
+   * return an error but the export results that already succeed will persist.
+   * Example: if exporting to table_type_A succeeds when exporting to
+   * table_type_B fails during one export call, the results in table_type_A will
+   * persist and there will not be partial results persisting in a table.
+   * 
+ * + * bool separate_tables_per_asset_type = 5; + * + * @return The separateTablesPerAssetType. + */ + boolean getSeparateTablesPerAssetType(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ContentType.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ContentType.java new file mode 100644 index 000000000..d69eb0030 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ContentType.java @@ -0,0 +1,242 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * Asset content type.
+ * 
+ * + * Protobuf enum {@code google.cloud.asset.v1p7beta1.ContentType} + */ +public enum ContentType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Unspecified content type.
+   * 
+ * + * CONTENT_TYPE_UNSPECIFIED = 0; + */ + CONTENT_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Resource metadata.
+   * 
+ * + * RESOURCE = 1; + */ + RESOURCE(1), + /** + * + * + *
+   * The actual IAM policy set on a resource.
+   * 
+ * + * IAM_POLICY = 2; + */ + IAM_POLICY(2), + /** + * + * + *
+   * The Cloud Organization Policy set on an asset.
+   * 
+ * + * ORG_POLICY = 4; + */ + ORG_POLICY(4), + /** + * + * + *
+   * The Cloud Access context manager Policy set on an asset.
+   * 
+ * + * ACCESS_POLICY = 5; + */ + ACCESS_POLICY(5), + /** + * + * + *
+   * The related resources.
+   * 
+ * + * RELATIONSHIP = 7; + */ + RELATIONSHIP(7), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Unspecified content type.
+   * 
+ * + * CONTENT_TYPE_UNSPECIFIED = 0; + */ + public static final int CONTENT_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Resource metadata.
+   * 
+ * + * RESOURCE = 1; + */ + public static final int RESOURCE_VALUE = 1; + /** + * + * + *
+   * The actual IAM policy set on a resource.
+   * 
+ * + * IAM_POLICY = 2; + */ + public static final int IAM_POLICY_VALUE = 2; + /** + * + * + *
+   * The Cloud Organization Policy set on an asset.
+   * 
+ * + * ORG_POLICY = 4; + */ + public static final int ORG_POLICY_VALUE = 4; + /** + * + * + *
+   * The Cloud Access context manager Policy set on an asset.
+   * 
+ * + * ACCESS_POLICY = 5; + */ + public static final int ACCESS_POLICY_VALUE = 5; + /** + * + * + *
+   * The related resources.
+   * 
+ * + * RELATIONSHIP = 7; + */ + public static final int RELATIONSHIP_VALUE = 7; + + 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 ContentType 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 ContentType forNumber(int value) { + switch (value) { + case 0: + return CONTENT_TYPE_UNSPECIFIED; + case 1: + return RESOURCE; + case 2: + return IAM_POLICY; + case 4: + return ORG_POLICY; + case 5: + return ACCESS_POLICY; + case 7: + return RELATIONSHIP; + 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 ContentType findValueByNumber(int number) { + return ContentType.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.asset.v1p7beta1.AssetServiceProto.getDescriptor().getEnumTypes().get(0); + } + + private static final ContentType[] VALUES = values(); + + public static ContentType 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 ContentType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.asset.v1p7beta1.ContentType) +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequest.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequest.java new file mode 100644 index 000000000..df3cd6534 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequest.java @@ -0,0 +1,2302 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * Export asset request.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.ExportAssetsRequest} + */ +public final class ExportAssetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.ExportAssetsRequest) + ExportAssetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAssetsRequest.newBuilder() to construct. + private ExportAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAssetsRequest() { + parent_ = ""; + assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contentType_ = 0; + relationshipTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAssetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportAssetsRequest( + 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(); + + parent_ = s; + break; + } + case 18: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + assetTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + assetTypes_.add(s); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + contentType_ = rawValue; + break; + } + case 42: + { + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + relationshipTypes_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + relationshipTypes_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + assetTypes_ = assetTypes_.getUnmodifiableView(); + } + if (((mutable_bitField0_ & 0x00000002) != 0)) { + relationshipTypes_ = relationshipTypes_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.class, + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The relative name of the root asset. This can only be an
+   * organization number (such as "organizations/123"), a project ID (such as
+   * "projects/my-project-id"), or a project number (such as "projects/12345"),
+   * or a folder number (such as "folders/123").
+   * 
+ * + * + * 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 relative name of the root asset. This can only be an
+   * organization number (such as "organizations/123"), a project ID (such as
+   * "projects/my-project-id"), or a project number (such as "projects/12345"),
+   * or a folder number (such as "folders/123").
+   * 
+ * + * + * 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 READ_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Timestamp to take an asset snapshot. This can only be set to a timestamp
+   * between the current time and the current time minus 35 days (inclusive).
+   * If not specified, the current time will be used. Due to delays in resource
+   * data collection and indexing, there is a volatile window during which
+   * running the same query may get different results.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Timestamp to take an asset snapshot. This can only be set to a timestamp
+   * between the current time and the current time minus 35 days (inclusive).
+   * If not specified, the current time will be used. Due to delays in resource
+   * data collection and indexing, there is a volatile window during which
+   * running the same query may get different results.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Timestamp to take an asset snapshot. This can only be set to a timestamp
+   * between the current time and the current time minus 35 days (inclusive).
+   * If not specified, the current time will be used. Due to delays in resource
+   * data collection and indexing, there is a volatile window during which
+   * running the same query may get different results.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int ASSET_TYPES_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList assetTypes_; + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @return A list containing the assetTypes. + */ + public com.google.protobuf.ProtocolStringList getAssetTypesList() { + return assetTypes_; + } + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @return The count of assetTypes. + */ + public int getAssetTypesCount() { + return assetTypes_.size(); + } + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @param index The index of the element to return. + * @return The assetTypes at the given index. + */ + public java.lang.String getAssetTypes(int index) { + return assetTypes_.get(index); + } + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @param index The index of the value to return. + * @return The bytes of the assetTypes at the given index. + */ + public com.google.protobuf.ByteString getAssetTypesBytes(int index) { + return assetTypes_.getByteString(index); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 4; + private int contentType_; + /** + * + * + *
+   * Asset content type. If not specified, no content but the asset name will be
+   * returned.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return The enum numeric value on the wire for contentType. + */ + @java.lang.Override + public int getContentTypeValue() { + return contentType_; + } + /** + * + * + *
+   * Asset content type. If not specified, no content but the asset name will be
+   * returned.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return The contentType. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ContentType getContentType() { + @SuppressWarnings("deprecation") + com.google.cloud.asset.v1p7beta1.ContentType result = + com.google.cloud.asset.v1p7beta1.ContentType.valueOf(contentType_); + return result == null ? com.google.cloud.asset.v1p7beta1.ContentType.UNRECOGNIZED : result; + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 5; + private com.google.cloud.asset.v1p7beta1.OutputConfig outputConfig_; + /** + * + * + *
+   * Required. Output configuration indicating where the results will be output
+   * to.
+   * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Required. Output configuration indicating where the results will be output
+   * to.
+   * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Required. Output configuration indicating where the results will be output
+   * to.
+   * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + public static final int RELATIONSHIP_TYPES_FIELD_NUMBER = 6; + private com.google.protobuf.LazyStringList relationshipTypes_; + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @return A list containing the relationshipTypes. + */ + public com.google.protobuf.ProtocolStringList getRelationshipTypesList() { + return relationshipTypes_; + } + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @return The count of relationshipTypes. + */ + public int getRelationshipTypesCount() { + return relationshipTypes_.size(); + } + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index of the element to return. + * @return The relationshipTypes at the given index. + */ + public java.lang.String getRelationshipTypes(int index) { + return relationshipTypes_.get(index); + } + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relationshipTypes at the given index. + */ + public com.google.protobuf.ByteString getRelationshipTypesBytes(int index) { + return relationshipTypes_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (readTime_ != null) { + output.writeMessage(2, getReadTime()); + } + for (int i = 0; i < assetTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, assetTypes_.getRaw(i)); + } + if (contentType_ + != com.google.cloud.asset.v1p7beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, contentType_); + } + if (outputConfig_ != null) { + output.writeMessage(5, getOutputConfig()); + } + for (int i = 0; i < relationshipTypes_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, relationshipTypes_.getRaw(i)); + } + 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 (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getReadTime()); + } + { + int dataSize = 0; + for (int i = 0; i < assetTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(assetTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getAssetTypesList().size(); + } + if (contentType_ + != com.google.cloud.asset.v1p7beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, contentType_); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getOutputConfig()); + } + { + int dataSize = 0; + for (int i = 0; i < relationshipTypes_.size(); i++) { + dataSize += computeStringSizeNoTag(relationshipTypes_.getRaw(i)); + } + size += dataSize; + size += 1 * getRelationshipTypesList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.asset.v1p7beta1.ExportAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest other = + (com.google.cloud.asset.v1p7beta1.ExportAssetsRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getAssetTypesList().equals(other.getAssetTypesList())) return false; + if (contentType_ != other.contentType_) return false; + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (!getRelationshipTypesList().equals(other.getRelationshipTypesList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (getAssetTypesCount() > 0) { + hash = (37 * hash) + ASSET_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getAssetTypesList().hashCode(); + } + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + contentType_; + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + if (getRelationshipTypesCount() > 0) { + hash = (37 * hash) + RELATIONSHIP_TYPES_FIELD_NUMBER; + hash = (53 * hash) + getRelationshipTypesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest 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.asset.v1p7beta1.ExportAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest 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.asset.v1p7beta1.ExportAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest 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.asset.v1p7beta1.ExportAssetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest 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.asset.v1p7beta1.ExportAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest 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.asset.v1p7beta1.ExportAssetsRequest 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; + } + /** + * + * + *
+   * Export asset request.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.ExportAssetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.ExportAssetsRequest) + com.google.cloud.asset.v1p7beta1.ExportAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.class, + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + contentType_ = 0; + + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + relationshipTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ExportAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ExportAssetsRequest build() { + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ExportAssetsRequest buildPartial() { + com.google.cloud.asset.v1p7beta1.ExportAssetsRequest result = + new com.google.cloud.asset.v1p7beta1.ExportAssetsRequest(this); + int from_bitField0_ = bitField0_; + result.parent_ = parent_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (((bitField0_ & 0x00000001) != 0)) { + assetTypes_ = assetTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.assetTypes_ = assetTypes_; + result.contentType_ = contentType_; + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + if (((bitField0_ & 0x00000002) != 0)) { + relationshipTypes_ = relationshipTypes_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.relationshipTypes_ = relationshipTypes_; + 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.asset.v1p7beta1.ExportAssetsRequest) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.ExportAssetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.ExportAssetsRequest other) { + if (other == com.google.cloud.asset.v1p7beta1.ExportAssetsRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (!other.assetTypes_.isEmpty()) { + if (assetTypes_.isEmpty()) { + assetTypes_ = other.assetTypes_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAssetTypesIsMutable(); + assetTypes_.addAll(other.assetTypes_); + } + onChanged(); + } + if (other.contentType_ != 0) { + setContentTypeValue(other.getContentTypeValue()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (!other.relationshipTypes_.isEmpty()) { + if (relationshipTypes_.isEmpty()) { + relationshipTypes_ = other.relationshipTypes_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureRelationshipTypesIsMutable(); + relationshipTypes_.addAll(other.relationshipTypes_); + } + 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.asset.v1p7beta1.ExportAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p7beta1.ExportAssetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The relative name of the root asset. This can only be an
+     * organization number (such as "organizations/123"), a project ID (such as
+     * "projects/my-project-id"), or a project number (such as "projects/12345"),
+     * or a folder number (such as "folders/123").
+     * 
+ * + * + * 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 relative name of the root asset. This can only be an
+     * organization number (such as "organizations/123"), a project ID (such as
+     * "projects/my-project-id"), or a project number (such as "projects/12345"),
+     * or a folder number (such as "folders/123").
+     * 
+ * + * + * 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 relative name of the root asset. This can only be an
+     * organization number (such as "organizations/123"), a project ID (such as
+     * "projects/my-project-id"), or a project number (such as "projects/12345"),
+     * or a folder number (such as "folders/123").
+     * 
+ * + * + * 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 relative name of the root asset. This can only be an
+     * organization number (such as "organizations/123"), a project ID (such as
+     * "projects/my-project-id"), or a project number (such as "projects/12345"),
+     * or a folder number (such as "folders/123").
+     * 
+ * + * + * 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 relative name of the root asset. This can only be an
+     * organization number (such as "organizations/123"), a project ID (such as
+     * "projects/my-project-id"), or a project number (such as "projects/12345"),
+     * or a folder number (such as "folders/123").
+     * 
+ * + * + * 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 com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Timestamp to take an asset snapshot. This can only be set to a timestamp
+     * between the current time and the current time minus 35 days (inclusive).
+     * If not specified, the current time will be used. Due to delays in resource
+     * data collection and indexing, there is a volatile window during which
+     * running the same query may get different results.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.protobuf.LazyStringList assetTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAssetTypesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + assetTypes_ = new com.google.protobuf.LazyStringArrayList(assetTypes_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @return A list containing the assetTypes. + */ + public com.google.protobuf.ProtocolStringList getAssetTypesList() { + return assetTypes_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @return The count of assetTypes. + */ + public int getAssetTypesCount() { + return assetTypes_.size(); + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @param index The index of the element to return. + * @return The assetTypes at the given index. + */ + public java.lang.String getAssetTypes(int index) { + return assetTypes_.get(index); + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @param index The index of the value to return. + * @return The bytes of the assetTypes at the given index. + */ + public com.google.protobuf.ByteString getAssetTypesBytes(int index) { + return assetTypes_.getByteString(index); + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @param index The index to set the value at. + * @param value The assetTypes to set. + * @return This builder for chaining. + */ + public Builder setAssetTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetTypesIsMutable(); + assetTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @param value The assetTypes to add. + * @return This builder for chaining. + */ + public Builder addAssetTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetTypesIsMutable(); + assetTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @param values The assetTypes to add. + * @return This builder for chaining. + */ + public Builder addAllAssetTypes(java.lang.Iterable values) { + ensureAssetTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, assetTypes_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @return This builder for chaining. + */ + public Builder clearAssetTypes() { + assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of asset types to take a snapshot for. For example:
+     * "compute.googleapis.com/Disk".
+     * Regular expressions are also supported. For example:
+     * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+     * with "compute.googleapis.com".
+     * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+     * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+     * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+     * regular expression syntax. If the regular expression does not match any
+     * supported asset type, an INVALID_ARGUMENT error will be returned.
+     * If specified, only matching assets will be returned, otherwise, it will
+     * snapshot all asset types. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+     * for all supported asset types.
+     * 
+ * + * repeated string asset_types = 3; + * + * @param value The bytes of the assetTypes to add. + * @return This builder for chaining. + */ + public Builder addAssetTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAssetTypesIsMutable(); + assetTypes_.add(value); + onChanged(); + return this; + } + + private int contentType_ = 0; + /** + * + * + *
+     * Asset content type. If not specified, no content but the asset name will be
+     * returned.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return The enum numeric value on the wire for contentType. + */ + @java.lang.Override + public int getContentTypeValue() { + return contentType_; + } + /** + * + * + *
+     * Asset content type. If not specified, no content but the asset name will be
+     * returned.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @param value The enum numeric value on the wire for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeValue(int value) { + + contentType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Asset content type. If not specified, no content but the asset name will be
+     * returned.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return The contentType. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ContentType getContentType() { + @SuppressWarnings("deprecation") + com.google.cloud.asset.v1p7beta1.ContentType result = + com.google.cloud.asset.v1p7beta1.ContentType.valueOf(contentType_); + return result == null ? com.google.cloud.asset.v1p7beta1.ContentType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Asset content type. If not specified, no content but the asset name will be
+     * returned.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType(com.google.cloud.asset.v1p7beta1.ContentType value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Asset content type. If not specified, no content but the asset name will be
+     * returned.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.asset.v1p7beta1.OutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputConfig, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder, + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + public com.google.cloud.asset.v1p7beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig(com.google.cloud.asset.v1p7beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setOutputConfig( + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeOutputConfig(com.google.cloud.asset.v1p7beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.asset.v1p7beta1.OutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.asset.v1p7beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Required. Output configuration indicating where the results will be output
+     * to.
+     * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputConfig, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder, + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputConfig, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder, + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.protobuf.LazyStringList relationshipTypes_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureRelationshipTypesIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + relationshipTypes_ = new com.google.protobuf.LazyStringArrayList(relationshipTypes_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @return A list containing the relationshipTypes. + */ + public com.google.protobuf.ProtocolStringList getRelationshipTypesList() { + return relationshipTypes_.getUnmodifiableView(); + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @return The count of relationshipTypes. + */ + public int getRelationshipTypesCount() { + return relationshipTypes_.size(); + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index of the element to return. + * @return The relationshipTypes at the given index. + */ + public java.lang.String getRelationshipTypes(int index) { + return relationshipTypes_.get(index); + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relationshipTypes at the given index. + */ + public com.google.protobuf.ByteString getRelationshipTypesBytes(int index) { + return relationshipTypes_.getByteString(index); + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index to set the value at. + * @param value The relationshipTypes to set. + * @return This builder for chaining. + */ + public Builder setRelationshipTypes(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelationshipTypesIsMutable(); + relationshipTypes_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @param value The relationshipTypes to add. + * @return This builder for chaining. + */ + public Builder addRelationshipTypes(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureRelationshipTypesIsMutable(); + relationshipTypes_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @param values The relationshipTypes to add. + * @return This builder for chaining. + */ + public Builder addAllRelationshipTypes(java.lang.Iterable values) { + ensureRelationshipTypesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, relationshipTypes_); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @return This builder for chaining. + */ + public Builder clearRelationshipTypes() { + relationshipTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A list of relationship types to export, for example:
+     * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+     * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+     * specified relationships, or give errors if any relationship_types'
+     * supported types are not in [asset_types]. If not specified, it will
+     * snapshot all [asset_types]' supported relationships. An unspecified
+     * [asset_types] field means all supported asset_types. See [Introduction to
+     * Cloud Asset
+     * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+     * supported asset types and relationship types.
+     * 
+ * + * repeated string relationship_types = 6; + * + * @param value The bytes of the relationshipTypes to add. + * @return This builder for chaining. + */ + public Builder addRelationshipTypesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureRelationshipTypesIsMutable(); + relationshipTypes_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p7beta1.ExportAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.ExportAssetsRequest) + private static final com.google.cloud.asset.v1p7beta1.ExportAssetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.ExportAssetsRequest(); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAssetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportAssetsRequest(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.asset.v1p7beta1.ExportAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequestOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequestOrBuilder.java new file mode 100644 index 000000000..909201e7a --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsRequestOrBuilder.java @@ -0,0 +1,368 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface ExportAssetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.ExportAssetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The relative name of the root asset. This can only be an
+   * organization number (such as "organizations/123"), a project ID (such as
+   * "projects/my-project-id"), or a project number (such as "projects/12345"),
+   * or a folder number (such as "folders/123").
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The relative name of the root asset. This can only be an
+   * organization number (such as "organizations/123"), a project ID (such as
+   * "projects/my-project-id"), or a project number (such as "projects/12345"),
+   * or a folder number (such as "folders/123").
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Timestamp to take an asset snapshot. This can only be set to a timestamp
+   * between the current time and the current time minus 35 days (inclusive).
+   * If not specified, the current time will be used. Due to delays in resource
+   * data collection and indexing, there is a volatile window during which
+   * running the same query may get different results.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Timestamp to take an asset snapshot. This can only be set to a timestamp
+   * between the current time and the current time minus 35 days (inclusive).
+   * If not specified, the current time will be used. Due to delays in resource
+   * data collection and indexing, there is a volatile window during which
+   * running the same query may get different results.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Timestamp to take an asset snapshot. This can only be set to a timestamp
+   * between the current time and the current time minus 35 days (inclusive).
+   * If not specified, the current time will be used. Due to delays in resource
+   * data collection and indexing, there is a volatile window during which
+   * running the same query may get different results.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 2; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @return A list containing the assetTypes. + */ + java.util.List getAssetTypesList(); + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @return The count of assetTypes. + */ + int getAssetTypesCount(); + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @param index The index of the element to return. + * @return The assetTypes at the given index. + */ + java.lang.String getAssetTypes(int index); + /** + * + * + *
+   * A list of asset types to take a snapshot for. For example:
+   * "compute.googleapis.com/Disk".
+   * Regular expressions are also supported. For example:
+   * * "compute.googleapis.com.*" snapshots resources whose asset type starts
+   * with "compute.googleapis.com".
+   * * ".*Instance" snapshots resources whose asset type ends with "Instance".
+   * * ".*Instance.*" snapshots resources whose asset type contains "Instance".
+   * See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported
+   * regular expression syntax. If the regular expression does not match any
+   * supported asset type, an INVALID_ARGUMENT error will be returned.
+   * If specified, only matching assets will be returned, otherwise, it will
+   * snapshot all asset types. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @param index The index of the value to return. + * @return The bytes of the assetTypes at the given index. + */ + com.google.protobuf.ByteString getAssetTypesBytes(int index); + + /** + * + * + *
+   * Asset content type. If not specified, no content but the asset name will be
+   * returned.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return The enum numeric value on the wire for contentType. + */ + int getContentTypeValue(); + /** + * + * + *
+   * Asset content type. If not specified, no content but the asset name will be
+   * returned.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.ContentType content_type = 4; + * + * @return The contentType. + */ + com.google.cloud.asset.v1p7beta1.ContentType getContentType(); + + /** + * + * + *
+   * Required. Output configuration indicating where the results will be output
+   * to.
+   * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Required. Output configuration indicating where the results will be output
+   * to.
+   * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The outputConfig. + */ + com.google.cloud.asset.v1p7beta1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Required. Output configuration indicating where the results will be output
+   * to.
+   * 
+ * + * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 5 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @return A list containing the relationshipTypes. + */ + java.util.List getRelationshipTypesList(); + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @return The count of relationshipTypes. + */ + int getRelationshipTypesCount(); + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index of the element to return. + * @return The relationshipTypes at the given index. + */ + java.lang.String getRelationshipTypes(int index); + /** + * + * + *
+   * A list of relationship types to export, for example:
+   * `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if
+   * content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]'
+   * specified relationships, or give errors if any relationship_types'
+   * supported types are not in [asset_types]. If not specified, it will
+   * snapshot all [asset_types]' supported relationships. An unspecified
+   * [asset_types] field means all supported asset_types. See [Introduction to
+   * Cloud Asset
+   * Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all
+   * supported asset types and relationship types.
+   * 
+ * + * repeated string relationship_types = 6; + * + * @param index The index of the value to return. + * @return The bytes of the relationshipTypes at the given index. + */ + com.google.protobuf.ByteString getRelationshipTypesBytes(int index); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponse.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponse.java new file mode 100644 index 000000000..be2e08ae4 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponse.java @@ -0,0 +1,1337 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * The export asset response. This message is returned by the
+ * [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation]
+ * method in the returned
+ * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+ * field.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.ExportAssetsResponse} + */ +public final class ExportAssetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.ExportAssetsResponse) + ExportAssetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExportAssetsResponse.newBuilder() to construct. + private ExportAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ExportAssetsResponse() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ExportAssetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ExportAssetsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (readTime_ != null) { + subBuilder = readTime_.toBuilder(); + } + readTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(readTime_); + readTime_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder subBuilder = null; + if (outputConfig_ != null) { + subBuilder = outputConfig_.toBuilder(); + } + outputConfig_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.OutputConfig.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputConfig_); + outputConfig_ = subBuilder.buildPartial(); + } + + break; + } + case 26: + { + com.google.cloud.asset.v1p7beta1.OutputResult.Builder subBuilder = null; + if (outputResult_ != null) { + subBuilder = outputResult_.toBuilder(); + } + outputResult_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.OutputResult.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(outputResult_); + outputResult_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.class, + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.Builder.class); + } + + public static final int READ_TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp readTime_; + /** + * + * + *
+   * Time the snapshot was taken.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 1; + * + * @return Whether the readTime field is set. + */ + @java.lang.Override + public boolean hasReadTime() { + return readTime_ != null; + } + /** + * + * + *
+   * Time the snapshot was taken.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 1; + * + * @return The readTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getReadTime() { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + /** + * + * + *
+   * Time the snapshot was taken.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + return getReadTime(); + } + + public static final int OUTPUT_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.asset.v1p7beta1.OutputConfig outputConfig_; + /** + * + * + *
+   * Output configuration indicating where the results were output to.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + * + * @return Whether the outputConfig field is set. + */ + @java.lang.Override + public boolean hasOutputConfig() { + return outputConfig_ != null; + } + /** + * + * + *
+   * Output configuration indicating where the results were output to.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + * + * @return The outputConfig. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfig getOutputConfig() { + return outputConfig_ == null + ? com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + /** + * + * + *
+   * Output configuration indicating where the results were output to.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + return getOutputConfig(); + } + + public static final int OUTPUT_RESULT_FIELD_NUMBER = 3; + private com.google.cloud.asset.v1p7beta1.OutputResult outputResult_; + /** + * + * + *
+   * Output result indicating where the assets were exported to. For example, a
+   * set of actual Google Cloud Storage object uris where the assets are
+   * exported to. The uris can be different from what [output_config] has
+   * specified, as the service will split the output object into multiple ones
+   * once it exceeds a single Google Cloud Storage object limit.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + @java.lang.Override + public boolean hasOutputResult() { + return outputResult_ != null; + } + /** + * + * + *
+   * Output result indicating where the assets were exported to. For example, a
+   * set of actual Google Cloud Storage object uris where the assets are
+   * exported to. The uris can be different from what [output_config] has
+   * specified, as the service will split the output object into multiple ones
+   * once it exceeds a single Google Cloud Storage object limit.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + * + * @return The outputResult. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputResult getOutputResult() { + return outputResult_ == null + ? com.google.cloud.asset.v1p7beta1.OutputResult.getDefaultInstance() + : outputResult_; + } + /** + * + * + *
+   * Output result indicating where the assets were exported to. For example, a
+   * set of actual Google Cloud Storage object uris where the assets are
+   * exported to. The uris can be different from what [output_config] has
+   * specified, as the service will split the output object into multiple ones
+   * once it exceeds a single Google Cloud Storage object limit.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder getOutputResultOrBuilder() { + return getOutputResult(); + } + + 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 (readTime_ != null) { + output.writeMessage(1, getReadTime()); + } + if (outputConfig_ != null) { + output.writeMessage(2, getOutputConfig()); + } + if (outputResult_ != null) { + output.writeMessage(3, getOutputResult()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (readTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getReadTime()); + } + if (outputConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getOutputConfig()); + } + if (outputResult_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getOutputResult()); + } + 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.asset.v1p7beta1.ExportAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse other = + (com.google.cloud.asset.v1p7beta1.ExportAssetsResponse) obj; + + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (hasOutputConfig() != other.hasOutputConfig()) return false; + if (hasOutputConfig()) { + if (!getOutputConfig().equals(other.getOutputConfig())) return false; + } + if (hasOutputResult() != other.hasOutputResult()) return false; + if (hasOutputResult()) { + if (!getOutputResult().equals(other.getOutputResult())) 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 (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (hasOutputConfig()) { + hash = (37 * hash) + OUTPUT_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getOutputConfig().hashCode(); + } + if (hasOutputResult()) { + hash = (37 * hash) + OUTPUT_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getOutputResult().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse 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.asset.v1p7beta1.ExportAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse 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.asset.v1p7beta1.ExportAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse 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.asset.v1p7beta1.ExportAssetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse 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.asset.v1p7beta1.ExportAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse 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.asset.v1p7beta1.ExportAssetsResponse 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; + } + /** + * + * + *
+   * The export asset response. This message is returned by the
+   * [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation]
+   * method in the returned
+   * [google.longrunning.Operation.response][google.longrunning.Operation.response]
+   * field.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.ExportAssetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.ExportAssetsResponse) + com.google.cloud.asset.v1p7beta1.ExportAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.class, + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.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 (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + if (outputResultBuilder_ == null) { + outputResult_ = null; + } else { + outputResult_ = null; + outputResultBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_ExportAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ExportAssetsResponse getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ExportAssetsResponse build() { + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.ExportAssetsResponse buildPartial() { + com.google.cloud.asset.v1p7beta1.ExportAssetsResponse result = + new com.google.cloud.asset.v1p7beta1.ExportAssetsResponse(this); + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.build(); + } + if (outputConfigBuilder_ == null) { + result.outputConfig_ = outputConfig_; + } else { + result.outputConfig_ = outputConfigBuilder_.build(); + } + if (outputResultBuilder_ == null) { + result.outputResult_ = outputResult_; + } else { + result.outputResult_ = outputResultBuilder_.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.asset.v1p7beta1.ExportAssetsResponse) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.ExportAssetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.ExportAssetsResponse other) { + if (other == com.google.cloud.asset.v1p7beta1.ExportAssetsResponse.getDefaultInstance()) + return this; + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + if (other.hasOutputConfig()) { + mergeOutputConfig(other.getOutputConfig()); + } + if (other.hasOutputResult()) { + mergeOutputResult(other.getOutputResult()); + } + 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.asset.v1p7beta1.ExportAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p7beta1.ExportAssetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp readTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + readTimeBuilder_; + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + * + * @return Whether the readTime field is set. + */ + public boolean hasReadTime() { + return readTimeBuilder_ != null || readTime_ != null; + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + * + * @return The readTime. + */ + public com.google.protobuf.Timestamp getReadTime() { + if (readTimeBuilder_ == null) { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } else { + return readTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + public Builder setReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + readTime_ = value; + onChanged(); + } else { + readTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + public Builder setReadTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (readTimeBuilder_ == null) { + readTime_ = builderForValue.build(); + onChanged(); + } else { + readTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + public Builder mergeReadTime(com.google.protobuf.Timestamp value) { + if (readTimeBuilder_ == null) { + if (readTime_ != null) { + readTime_ = + com.google.protobuf.Timestamp.newBuilder(readTime_).mergeFrom(value).buildPartial(); + } else { + readTime_ = value; + } + onChanged(); + } else { + readTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + public Builder clearReadTime() { + if (readTimeBuilder_ == null) { + readTime_ = null; + onChanged(); + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + public com.google.protobuf.Timestamp.Builder getReadTimeBuilder() { + + onChanged(); + return getReadTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder() { + if (readTimeBuilder_ != null) { + return readTimeBuilder_.getMessageOrBuilder(); + } else { + return readTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : readTime_; + } + } + /** + * + * + *
+     * Time the snapshot was taken.
+     * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getReadTimeFieldBuilder() { + if (readTimeBuilder_ == null) { + readTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getReadTime(), getParentForChildren(), isClean()); + readTime_ = null; + } + return readTimeBuilder_; + } + + private com.google.cloud.asset.v1p7beta1.OutputConfig outputConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputConfig, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder, + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder> + outputConfigBuilder_; + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + * + * @return Whether the outputConfig field is set. + */ + public boolean hasOutputConfig() { + return outputConfigBuilder_ != null || outputConfig_ != null; + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + * + * @return The outputConfig. + */ + public com.google.cloud.asset.v1p7beta1.OutputConfig getOutputConfig() { + if (outputConfigBuilder_ == null) { + return outputConfig_ == null + ? com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } else { + return outputConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + public Builder setOutputConfig(com.google.cloud.asset.v1p7beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputConfig_ = value; + onChanged(); + } else { + outputConfigBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + public Builder setOutputConfig( + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder builderForValue) { + if (outputConfigBuilder_ == null) { + outputConfig_ = builderForValue.build(); + onChanged(); + } else { + outputConfigBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + public Builder mergeOutputConfig(com.google.cloud.asset.v1p7beta1.OutputConfig value) { + if (outputConfigBuilder_ == null) { + if (outputConfig_ != null) { + outputConfig_ = + com.google.cloud.asset.v1p7beta1.OutputConfig.newBuilder(outputConfig_) + .mergeFrom(value) + .buildPartial(); + } else { + outputConfig_ = value; + } + onChanged(); + } else { + outputConfigBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + public Builder clearOutputConfig() { + if (outputConfigBuilder_ == null) { + outputConfig_ = null; + onChanged(); + } else { + outputConfig_ = null; + outputConfigBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.asset.v1p7beta1.OutputConfig.Builder getOutputConfigBuilder() { + + onChanged(); + return getOutputConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + public com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder getOutputConfigOrBuilder() { + if (outputConfigBuilder_ != null) { + return outputConfigBuilder_.getMessageOrBuilder(); + } else { + return outputConfig_ == null + ? com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance() + : outputConfig_; + } + } + /** + * + * + *
+     * Output configuration indicating where the results were output to.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputConfig, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder, + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder> + getOutputConfigFieldBuilder() { + if (outputConfigBuilder_ == null) { + outputConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputConfig, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder, + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder>( + getOutputConfig(), getParentForChildren(), isClean()); + outputConfig_ = null; + } + return outputConfigBuilder_; + } + + private com.google.cloud.asset.v1p7beta1.OutputResult outputResult_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputResult, + com.google.cloud.asset.v1p7beta1.OutputResult.Builder, + com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder> + outputResultBuilder_; + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + public boolean hasOutputResult() { + return outputResultBuilder_ != null || outputResult_ != null; + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + * + * @return The outputResult. + */ + public com.google.cloud.asset.v1p7beta1.OutputResult getOutputResult() { + if (outputResultBuilder_ == null) { + return outputResult_ == null + ? com.google.cloud.asset.v1p7beta1.OutputResult.getDefaultInstance() + : outputResult_; + } else { + return outputResultBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + public Builder setOutputResult(com.google.cloud.asset.v1p7beta1.OutputResult value) { + if (outputResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + outputResult_ = value; + onChanged(); + } else { + outputResultBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + public Builder setOutputResult( + com.google.cloud.asset.v1p7beta1.OutputResult.Builder builderForValue) { + if (outputResultBuilder_ == null) { + outputResult_ = builderForValue.build(); + onChanged(); + } else { + outputResultBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + public Builder mergeOutputResult(com.google.cloud.asset.v1p7beta1.OutputResult value) { + if (outputResultBuilder_ == null) { + if (outputResult_ != null) { + outputResult_ = + com.google.cloud.asset.v1p7beta1.OutputResult.newBuilder(outputResult_) + .mergeFrom(value) + .buildPartial(); + } else { + outputResult_ = value; + } + onChanged(); + } else { + outputResultBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + public Builder clearOutputResult() { + if (outputResultBuilder_ == null) { + outputResult_ = null; + onChanged(); + } else { + outputResult_ = null; + outputResultBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + public com.google.cloud.asset.v1p7beta1.OutputResult.Builder getOutputResultBuilder() { + + onChanged(); + return getOutputResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + public com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder getOutputResultOrBuilder() { + if (outputResultBuilder_ != null) { + return outputResultBuilder_.getMessageOrBuilder(); + } else { + return outputResult_ == null + ? com.google.cloud.asset.v1p7beta1.OutputResult.getDefaultInstance() + : outputResult_; + } + } + /** + * + * + *
+     * Output result indicating where the assets were exported to. For example, a
+     * set of actual Google Cloud Storage object uris where the assets are
+     * exported to. The uris can be different from what [output_config] has
+     * specified, as the service will split the output object into multiple ones
+     * once it exceeds a single Google Cloud Storage object limit.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputResult, + com.google.cloud.asset.v1p7beta1.OutputResult.Builder, + com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder> + getOutputResultFieldBuilder() { + if (outputResultBuilder_ == null) { + outputResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.OutputResult, + com.google.cloud.asset.v1p7beta1.OutputResult.Builder, + com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder>( + getOutputResult(), getParentForChildren(), isClean()); + outputResult_ = null; + } + return outputResultBuilder_; + } + + @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.asset.v1p7beta1.ExportAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.ExportAssetsResponse) + private static final com.google.cloud.asset.v1p7beta1.ExportAssetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.ExportAssetsResponse(); + } + + public static com.google.cloud.asset.v1p7beta1.ExportAssetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExportAssetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExportAssetsResponse(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.asset.v1p7beta1.ExportAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponseOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponseOrBuilder.java new file mode 100644 index 000000000..cfd199400 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ExportAssetsResponseOrBuilder.java @@ -0,0 +1,142 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface ExportAssetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.ExportAssetsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Time the snapshot was taken.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 1; + * + * @return Whether the readTime field is set. + */ + boolean hasReadTime(); + /** + * + * + *
+   * Time the snapshot was taken.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 1; + * + * @return The readTime. + */ + com.google.protobuf.Timestamp getReadTime(); + /** + * + * + *
+   * Time the snapshot was taken.
+   * 
+ * + * .google.protobuf.Timestamp read_time = 1; + */ + com.google.protobuf.TimestampOrBuilder getReadTimeOrBuilder(); + + /** + * + * + *
+   * Output configuration indicating where the results were output to.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + * + * @return Whether the outputConfig field is set. + */ + boolean hasOutputConfig(); + /** + * + * + *
+   * Output configuration indicating where the results were output to.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + * + * @return The outputConfig. + */ + com.google.cloud.asset.v1p7beta1.OutputConfig getOutputConfig(); + /** + * + * + *
+   * Output configuration indicating where the results were output to.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputConfig output_config = 2; + */ + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder getOutputConfigOrBuilder(); + + /** + * + * + *
+   * Output result indicating where the assets were exported to. For example, a
+   * set of actual Google Cloud Storage object uris where the assets are
+   * exported to. The uris can be different from what [output_config] has
+   * specified, as the service will split the output object into multiple ones
+   * once it exceeds a single Google Cloud Storage object limit.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + * + * @return Whether the outputResult field is set. + */ + boolean hasOutputResult(); + /** + * + * + *
+   * Output result indicating where the assets were exported to. For example, a
+   * set of actual Google Cloud Storage object uris where the assets are
+   * exported to. The uris can be different from what [output_config] has
+   * specified, as the service will split the output object into multiple ones
+   * once it exceeds a single Google Cloud Storage object limit.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + * + * @return The outputResult. + */ + com.google.cloud.asset.v1p7beta1.OutputResult getOutputResult(); + /** + * + * + *
+   * Output result indicating where the assets were exported to. For example, a
+   * set of actual Google Cloud Storage object uris where the assets are
+   * exported to. The uris can be different from what [output_config] has
+   * specified, as the service will split the output object into multiple ones
+   * once it exceeds a single Google Cloud Storage object limit.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.OutputResult output_result = 3; + */ + com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder getOutputResultOrBuilder(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestination.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestination.java new file mode 100644 index 000000000..842ada6bc --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestination.java @@ -0,0 +1,1110 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * A Cloud Storage location.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.GcsDestination} + */ +public final class GcsDestination extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.GcsDestination) + GcsDestinationOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsDestination.newBuilder() to construct. + private GcsDestination(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsDestination() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsDestination(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsDestination( + 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(); + objectUriCase_ = 1; + objectUri_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + objectUriCase_ = 2; + objectUri_ = 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.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.GcsDestination.class, + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder.class); + } + + private int objectUriCase_ = 0; + private java.lang.Object objectUri_; + + public enum ObjectUriCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + URI(1), + URI_PREFIX(2), + OBJECTURI_NOT_SET(0); + private final int value; + + private ObjectUriCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ObjectUriCase valueOf(int value) { + return forNumber(value); + } + + public static ObjectUriCase forNumber(int value) { + switch (value) { + case 1: + return URI; + case 2: + return URI_PREFIX; + case 0: + return OBJECTURI_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ObjectUriCase getObjectUriCase() { + return ObjectUriCase.forNumber(objectUriCase_); + } + + public static final int URI_FIELD_NUMBER = 1; + /** + * + * + *
+   * The uri of the Cloud Storage object. It's the same uri that is used by
+   * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+   * Editing Object
+   * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+   * for more information.
+   * 
+ * + * string uri = 1; + * + * @return Whether the uri field is set. + */ + public boolean hasUri() { + return objectUriCase_ == 1; + } + /** + * + * + *
+   * The uri of the Cloud Storage object. It's the same uri that is used by
+   * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+   * Editing Object
+   * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+   * for more information.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (objectUriCase_ == 1) { + ref = objectUri_; + } + 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(); + if (objectUriCase_ == 1) { + objectUri_ = s; + } + return s; + } + } + /** + * + * + *
+   * The uri of the Cloud Storage object. It's the same uri that is used by
+   * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+   * Editing Object
+   * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+   * for more information.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (objectUriCase_ == 1) { + ref = objectUri_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (objectUriCase_ == 1) { + objectUri_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URI_PREFIX_FIELD_NUMBER = 2; + /** + * + * + *
+   * The uri prefix of all generated Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+   * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+   * contains assets for that type. <shard number> starts from 0. Example:
+   * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+   * the first shard of output objects containing all
+   * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+   * returned if file with the same name "gs://bucket_name/object_name_prefix"
+   * already exists.
+   * 
+ * + * string uri_prefix = 2; + * + * @return Whether the uriPrefix field is set. + */ + public boolean hasUriPrefix() { + return objectUriCase_ == 2; + } + /** + * + * + *
+   * The uri prefix of all generated Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+   * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+   * contains assets for that type. <shard number> starts from 0. Example:
+   * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+   * the first shard of output objects containing all
+   * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+   * returned if file with the same name "gs://bucket_name/object_name_prefix"
+   * already exists.
+   * 
+ * + * string uri_prefix = 2; + * + * @return The uriPrefix. + */ + public java.lang.String getUriPrefix() { + java.lang.Object ref = ""; + if (objectUriCase_ == 2) { + ref = objectUri_; + } + 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(); + if (objectUriCase_ == 2) { + objectUri_ = s; + } + return s; + } + } + /** + * + * + *
+   * The uri prefix of all generated Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+   * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+   * contains assets for that type. <shard number> starts from 0. Example:
+   * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+   * the first shard of output objects containing all
+   * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+   * returned if file with the same name "gs://bucket_name/object_name_prefix"
+   * already exists.
+   * 
+ * + * string uri_prefix = 2; + * + * @return The bytes for uriPrefix. + */ + public com.google.protobuf.ByteString getUriPrefixBytes() { + java.lang.Object ref = ""; + if (objectUriCase_ == 2) { + ref = objectUri_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (objectUriCase_ == 2) { + objectUri_ = 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 (objectUriCase_ == 1) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, objectUri_); + } + if (objectUriCase_ == 2) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, objectUri_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (objectUriCase_ == 1) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, objectUri_); + } + if (objectUriCase_ == 2) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, objectUri_); + } + 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.asset.v1p7beta1.GcsDestination)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.GcsDestination other = + (com.google.cloud.asset.v1p7beta1.GcsDestination) obj; + + if (!getObjectUriCase().equals(other.getObjectUriCase())) return false; + switch (objectUriCase_) { + case 1: + if (!getUri().equals(other.getUri())) return false; + break; + case 2: + if (!getUriPrefix().equals(other.getUriPrefix())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (objectUriCase_) { + case 1: + hash = (37 * hash) + URI_FIELD_NUMBER; + hash = (53 * hash) + getUri().hashCode(); + break; + case 2: + hash = (37 * hash) + URI_PREFIX_FIELD_NUMBER; + hash = (53 * hash) + getUriPrefix().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination 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.asset.v1p7beta1.GcsDestination parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination 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.asset.v1p7beta1.GcsDestination parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination 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.asset.v1p7beta1.GcsDestination parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination 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.asset.v1p7beta1.GcsDestination parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination 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.asset.v1p7beta1.GcsDestination 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 Cloud Storage location.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.GcsDestination} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.GcsDestination) + com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsDestination_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsDestination_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.GcsDestination.class, + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.GcsDestination.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(); + objectUriCase_ = 0; + objectUri_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsDestination_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestination getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestination build() { + com.google.cloud.asset.v1p7beta1.GcsDestination result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestination buildPartial() { + com.google.cloud.asset.v1p7beta1.GcsDestination result = + new com.google.cloud.asset.v1p7beta1.GcsDestination(this); + if (objectUriCase_ == 1) { + result.objectUri_ = objectUri_; + } + if (objectUriCase_ == 2) { + result.objectUri_ = objectUri_; + } + result.objectUriCase_ = objectUriCase_; + 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.asset.v1p7beta1.GcsDestination) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.GcsDestination) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.GcsDestination other) { + if (other == com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance()) + return this; + switch (other.getObjectUriCase()) { + case URI: + { + objectUriCase_ = 1; + objectUri_ = other.objectUri_; + onChanged(); + break; + } + case URI_PREFIX: + { + objectUriCase_ = 2; + objectUri_ = other.objectUri_; + onChanged(); + break; + } + case OBJECTURI_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p7beta1.GcsDestination parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.GcsDestination) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int objectUriCase_ = 0; + private java.lang.Object objectUri_; + + public ObjectUriCase getObjectUriCase() { + return ObjectUriCase.forNumber(objectUriCase_); + } + + public Builder clearObjectUri() { + objectUriCase_ = 0; + objectUri_ = null; + onChanged(); + return this; + } + + /** + * + * + *
+     * The uri of the Cloud Storage object. It's the same uri that is used by
+     * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+     * Editing Object
+     * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+     * for more information.
+     * 
+ * + * string uri = 1; + * + * @return Whether the uri field is set. + */ + @java.lang.Override + public boolean hasUri() { + return objectUriCase_ == 1; + } + /** + * + * + *
+     * The uri of the Cloud Storage object. It's the same uri that is used by
+     * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+     * Editing Object
+     * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+     * for more information.
+     * 
+ * + * string uri = 1; + * + * @return The uri. + */ + @java.lang.Override + public java.lang.String getUri() { + java.lang.Object ref = ""; + if (objectUriCase_ == 1) { + ref = objectUri_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (objectUriCase_ == 1) { + objectUri_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The uri of the Cloud Storage object. It's the same uri that is used by
+     * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+     * Editing Object
+     * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+     * for more information.
+     * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriBytes() { + java.lang.Object ref = ""; + if (objectUriCase_ == 1) { + ref = objectUri_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (objectUriCase_ == 1) { + objectUri_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The uri of the Cloud Storage object. It's the same uri that is used by
+     * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+     * Editing Object
+     * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+     * for more information.
+     * 
+ * + * string uri = 1; + * + * @param value The uri to set. + * @return This builder for chaining. + */ + public Builder setUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + objectUriCase_ = 1; + objectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The uri of the Cloud Storage object. It's the same uri that is used by
+     * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+     * Editing Object
+     * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+     * for more information.
+     * 
+ * + * string uri = 1; + * + * @return This builder for chaining. + */ + public Builder clearUri() { + if (objectUriCase_ == 1) { + objectUriCase_ = 0; + objectUri_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The uri of the Cloud Storage object. It's the same uri that is used by
+     * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+     * Editing Object
+     * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+     * for more information.
+     * 
+ * + * string uri = 1; + * + * @param value The bytes for uri to set. + * @return This builder for chaining. + */ + public Builder setUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + objectUriCase_ = 1; + objectUri_ = value; + onChanged(); + return this; + } + + /** + * + * + *
+     * The uri prefix of all generated Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+     * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+     * contains assets for that type. <shard number> starts from 0. Example:
+     * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+     * the first shard of output objects containing all
+     * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+     * returned if file with the same name "gs://bucket_name/object_name_prefix"
+     * already exists.
+     * 
+ * + * string uri_prefix = 2; + * + * @return Whether the uriPrefix field is set. + */ + @java.lang.Override + public boolean hasUriPrefix() { + return objectUriCase_ == 2; + } + /** + * + * + *
+     * The uri prefix of all generated Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+     * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+     * contains assets for that type. <shard number> starts from 0. Example:
+     * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+     * the first shard of output objects containing all
+     * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+     * returned if file with the same name "gs://bucket_name/object_name_prefix"
+     * already exists.
+     * 
+ * + * string uri_prefix = 2; + * + * @return The uriPrefix. + */ + @java.lang.Override + public java.lang.String getUriPrefix() { + java.lang.Object ref = ""; + if (objectUriCase_ == 2) { + ref = objectUri_; + } + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (objectUriCase_ == 2) { + objectUri_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The uri prefix of all generated Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+     * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+     * contains assets for that type. <shard number> starts from 0. Example:
+     * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+     * the first shard of output objects containing all
+     * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+     * returned if file with the same name "gs://bucket_name/object_name_prefix"
+     * already exists.
+     * 
+ * + * string uri_prefix = 2; + * + * @return The bytes for uriPrefix. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUriPrefixBytes() { + java.lang.Object ref = ""; + if (objectUriCase_ == 2) { + ref = objectUri_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + if (objectUriCase_ == 2) { + objectUri_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The uri prefix of all generated Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+     * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+     * contains assets for that type. <shard number> starts from 0. Example:
+     * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+     * the first shard of output objects containing all
+     * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+     * returned if file with the same name "gs://bucket_name/object_name_prefix"
+     * already exists.
+     * 
+ * + * string uri_prefix = 2; + * + * @param value The uriPrefix to set. + * @return This builder for chaining. + */ + public Builder setUriPrefix(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + objectUriCase_ = 2; + objectUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The uri prefix of all generated Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+     * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+     * contains assets for that type. <shard number> starts from 0. Example:
+     * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+     * the first shard of output objects containing all
+     * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+     * returned if file with the same name "gs://bucket_name/object_name_prefix"
+     * already exists.
+     * 
+ * + * string uri_prefix = 2; + * + * @return This builder for chaining. + */ + public Builder clearUriPrefix() { + if (objectUriCase_ == 2) { + objectUriCase_ = 0; + objectUri_ = null; + onChanged(); + } + return this; + } + /** + * + * + *
+     * The uri prefix of all generated Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+     * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+     * contains assets for that type. <shard number> starts from 0. Example:
+     * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+     * the first shard of output objects containing all
+     * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+     * returned if file with the same name "gs://bucket_name/object_name_prefix"
+     * already exists.
+     * 
+ * + * string uri_prefix = 2; + * + * @param value The bytes for uriPrefix to set. + * @return This builder for chaining. + */ + public Builder setUriPrefixBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + objectUriCase_ = 2; + objectUri_ = 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.asset.v1p7beta1.GcsDestination) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.GcsDestination) + private static final com.google.cloud.asset.v1p7beta1.GcsDestination DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.GcsDestination(); + } + + public static com.google.cloud.asset.v1p7beta1.GcsDestination getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsDestination parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsDestination(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.asset.v1p7beta1.GcsDestination getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestinationOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestinationOrBuilder.java new file mode 100644 index 000000000..4196ea59b --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsDestinationOrBuilder.java @@ -0,0 +1,137 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface GcsDestinationOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.GcsDestination) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The uri of the Cloud Storage object. It's the same uri that is used by
+   * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+   * Editing Object
+   * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+   * for more information.
+   * 
+ * + * string uri = 1; + * + * @return Whether the uri field is set. + */ + boolean hasUri(); + /** + * + * + *
+   * The uri of the Cloud Storage object. It's the same uri that is used by
+   * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+   * Editing Object
+   * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+   * for more information.
+   * 
+ * + * string uri = 1; + * + * @return The uri. + */ + java.lang.String getUri(); + /** + * + * + *
+   * The uri of the Cloud Storage object. It's the same uri that is used by
+   * gsutil. Example: "gs://bucket_name/object_name". See [Viewing and
+   * Editing Object
+   * Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
+   * for more information.
+   * 
+ * + * string uri = 1; + * + * @return The bytes for uri. + */ + com.google.protobuf.ByteString getUriBytes(); + + /** + * + * + *
+   * The uri prefix of all generated Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+   * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+   * contains assets for that type. <shard number> starts from 0. Example:
+   * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+   * the first shard of output objects containing all
+   * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+   * returned if file with the same name "gs://bucket_name/object_name_prefix"
+   * already exists.
+   * 
+ * + * string uri_prefix = 2; + * + * @return Whether the uriPrefix field is set. + */ + boolean hasUriPrefix(); + /** + * + * + *
+   * The uri prefix of all generated Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+   * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+   * contains assets for that type. <shard number> starts from 0. Example:
+   * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+   * the first shard of output objects containing all
+   * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+   * returned if file with the same name "gs://bucket_name/object_name_prefix"
+   * already exists.
+   * 
+ * + * string uri_prefix = 2; + * + * @return The uriPrefix. + */ + java.lang.String getUriPrefix(); + /** + * + * + *
+   * The uri prefix of all generated Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name_prefix". Each object uri is in format:
+   * "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only
+   * contains assets for that type. <shard number> starts from 0. Example:
+   * "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is
+   * the first shard of output objects containing all
+   * compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be
+   * returned if file with the same name "gs://bucket_name/object_name_prefix"
+   * already exists.
+   * 
+ * + * string uri_prefix = 2; + * + * @return The bytes for uriPrefix. + */ + com.google.protobuf.ByteString getUriPrefixBytes(); + + public com.google.cloud.asset.v1p7beta1.GcsDestination.ObjectUriCase getObjectUriCase(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResult.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResult.java new file mode 100644 index 000000000..50bc87779 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResult.java @@ -0,0 +1,749 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * A Cloud Storage output result.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.GcsOutputResult} + */ +public final class GcsOutputResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.GcsOutputResult) + GcsOutputResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use GcsOutputResult.newBuilder() to construct. + private GcsOutputResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GcsOutputResult() { + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GcsOutputResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GcsOutputResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + uris_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + uris_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + uris_ = uris_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.GcsOutputResult.class, + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder.class); + } + + public static final int URIS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList uris_; + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_; + } + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < uris_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, uris_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < uris_.size(); i++) { + dataSize += computeStringSizeNoTag(uris_.getRaw(i)); + } + size += dataSize; + size += 1 * getUrisList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.asset.v1p7beta1.GcsOutputResult)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.GcsOutputResult other = + (com.google.cloud.asset.v1p7beta1.GcsOutputResult) obj; + + if (!getUrisList().equals(other.getUrisList())) 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 (getUrisCount() > 0) { + hash = (37 * hash) + URIS_FIELD_NUMBER; + hash = (53 * hash) + getUrisList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult 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.asset.v1p7beta1.GcsOutputResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult 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.asset.v1p7beta1.GcsOutputResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult 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.asset.v1p7beta1.GcsOutputResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult 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.asset.v1p7beta1.GcsOutputResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult 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.asset.v1p7beta1.GcsOutputResult 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 Cloud Storage output result.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.GcsOutputResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.GcsOutputResult) + com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.GcsOutputResult.class, + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.GcsOutputResult.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(); + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_GcsOutputResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResult getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResult build() { + com.google.cloud.asset.v1p7beta1.GcsOutputResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResult buildPartial() { + com.google.cloud.asset.v1p7beta1.GcsOutputResult result = + new com.google.cloud.asset.v1p7beta1.GcsOutputResult(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + uris_ = uris_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.uris_ = uris_; + 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.asset.v1p7beta1.GcsOutputResult) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.GcsOutputResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.GcsOutputResult other) { + if (other == com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance()) + return this; + if (!other.uris_.isEmpty()) { + if (uris_.isEmpty()) { + uris_ = other.uris_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureUrisIsMutable(); + uris_.addAll(other.uris_); + } + 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.asset.v1p7beta1.GcsOutputResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.GcsOutputResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList uris_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureUrisIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + uris_ = new com.google.protobuf.LazyStringArrayList(uris_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @return A list containing the uris. + */ + public com.google.protobuf.ProtocolStringList getUrisList() { + return uris_.getUnmodifiableView(); + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @return The count of uris. + */ + public int getUrisCount() { + return uris_.size(); + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + public java.lang.String getUris(int index) { + return uris_.get(index); + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + public com.google.protobuf.ByteString getUrisBytes(int index) { + return uris_.getByteString(index); + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @param index The index to set the value at. + * @param value The uris to set. + * @return This builder for chaining. + */ + public Builder setUris(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @param value The uris to add. + * @return This builder for chaining. + */ + public Builder addUris(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureUrisIsMutable(); + uris_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @param values The uris to add. + * @return This builder for chaining. + */ + public Builder addAllUris(java.lang.Iterable values) { + ensureUrisIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, uris_); + onChanged(); + return this; + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @return This builder for chaining. + */ + public Builder clearUris() { + uris_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * List of uris of the Cloud Storage objects. Example:
+     * "gs://bucket_name/object_name".
+     * 
+ * + * repeated string uris = 1; + * + * @param value The bytes of the uris to add. + * @return This builder for chaining. + */ + public Builder addUrisBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureUrisIsMutable(); + uris_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p7beta1.GcsOutputResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.GcsOutputResult) + private static final com.google.cloud.asset.v1p7beta1.GcsOutputResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.GcsOutputResult(); + } + + public static com.google.cloud.asset.v1p7beta1.GcsOutputResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GcsOutputResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GcsOutputResult(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.asset.v1p7beta1.GcsOutputResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResultOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResultOrBuilder.java new file mode 100644 index 000000000..ec8eda32a --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/GcsOutputResultOrBuilder.java @@ -0,0 +1,80 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface GcsOutputResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.GcsOutputResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @return A list containing the uris. + */ + java.util.List getUrisList(); + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @return The count of uris. + */ + int getUrisCount(); + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @param index The index of the element to return. + * @return The uris at the given index. + */ + java.lang.String getUris(int index); + /** + * + * + *
+   * List of uris of the Cloud Storage objects. Example:
+   * "gs://bucket_name/object_name".
+   * 
+ * + * repeated string uris = 1; + * + * @param index The index of the value to return. + * @return The bytes of the uris at the given index. + */ + com.google.protobuf.ByteString getUrisBytes(int index); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfig.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfig.java new file mode 100644 index 000000000..94c3cdc72 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfig.java @@ -0,0 +1,1164 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * Output configuration for export assets destination.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.OutputConfig} + */ +public final class OutputConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.OutputConfig) + OutputConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputConfig.newBuilder() to construct. + private OutputConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputConfig(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OutputConfig( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder subBuilder = null; + if (destinationCase_ == 1) { + subBuilder = + ((com.google.cloud.asset.v1p7beta1.GcsDestination) destination_).toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.GcsDestination.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 1; + break; + } + case 18: + { + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder subBuilder = null; + if (destinationCase_ == 2) { + subBuilder = + ((com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_) + .toBuilder(); + } + destination_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.BigQueryDestination.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_); + destination_ = subBuilder.buildPartial(); + } + destinationCase_ = 2; + 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.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.OutputConfig.class, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder.class); + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public enum DestinationCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_DESTINATION(1), + BIGQUERY_DESTINATION(2), + DESTINATION_NOT_SET(0); + private final int value; + + private DestinationCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static DestinationCase valueOf(int value) { + return forNumber(value); + } + + public static DestinationCase forNumber(int value) { + switch (value) { + case 1: + return GCS_DESTINATION; + case 2: + return BIGQUERY_DESTINATION; + case 0: + return DESTINATION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public static final int GCS_DESTINATION_FIELD_NUMBER = 1; + /** + * + * + *
+   * Destination on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+   * Destination on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestination getGcsDestination() { + if (destinationCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } + /** + * + * + *
+   * Destination on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if (destinationCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } + + public static final int BIGQUERY_DESTINATION_FIELD_NUMBER = 2; + /** + * + * + *
+   * Destination on BigQuery. The output table stores the fields in asset
+   * proto as columns in BigQuery.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return destinationCase_ == 2; + } + /** + * + * + *
+   * Destination on BigQuery. The output table stores the fields in asset
+   * proto as columns in BigQuery.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestination getBigqueryDestination() { + if (destinationCase_ == 2) { + return (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } + /** + * + * + *
+   * Destination on BigQuery. The output table stores the fields in asset
+   * proto as columns in BigQuery.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if (destinationCase_ == 2) { + return (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (destinationCase_ == 1) { + output.writeMessage(1, (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_); + } + if (destinationCase_ == 2) { + output.writeMessage(2, (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (destinationCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_); + } + if (destinationCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_); + } + 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.asset.v1p7beta1.OutputConfig)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.OutputConfig other = + (com.google.cloud.asset.v1p7beta1.OutputConfig) obj; + + if (!getDestinationCase().equals(other.getDestinationCase())) return false; + switch (destinationCase_) { + case 1: + if (!getGcsDestination().equals(other.getGcsDestination())) return false; + break; + case 2: + if (!getBigqueryDestination().equals(other.getBigqueryDestination())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (destinationCase_) { + case 1: + hash = (37 * hash) + GCS_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getGcsDestination().hashCode(); + break; + case 2: + hash = (37 * hash) + BIGQUERY_DESTINATION_FIELD_NUMBER; + hash = (53 * hash) + getBigqueryDestination().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig 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.asset.v1p7beta1.OutputConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig 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.asset.v1p7beta1.OutputConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig 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.asset.v1p7beta1.OutputConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig 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.asset.v1p7beta1.OutputConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig 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.asset.v1p7beta1.OutputConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Output configuration for export assets destination.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.OutputConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.OutputConfig) + com.google.cloud.asset.v1p7beta1.OutputConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.OutputConfig.class, + com.google.cloud.asset.v1p7beta1.OutputConfig.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.OutputConfig.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(); + destinationCase_ = 0; + destination_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfig getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfig build() { + com.google.cloud.asset.v1p7beta1.OutputConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputConfig buildPartial() { + com.google.cloud.asset.v1p7beta1.OutputConfig result = + new com.google.cloud.asset.v1p7beta1.OutputConfig(this); + if (destinationCase_ == 1) { + if (gcsDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = gcsDestinationBuilder_.build(); + } + } + if (destinationCase_ == 2) { + if (bigqueryDestinationBuilder_ == null) { + result.destination_ = destination_; + } else { + result.destination_ = bigqueryDestinationBuilder_.build(); + } + } + result.destinationCase_ = destinationCase_; + 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.asset.v1p7beta1.OutputConfig) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.OutputConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.OutputConfig other) { + if (other == com.google.cloud.asset.v1p7beta1.OutputConfig.getDefaultInstance()) return this; + switch (other.getDestinationCase()) { + case GCS_DESTINATION: + { + mergeGcsDestination(other.getGcsDestination()); + break; + } + case BIGQUERY_DESTINATION: + { + mergeBigqueryDestination(other.getBigqueryDestination()); + break; + } + case DESTINATION_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p7beta1.OutputConfig parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.OutputConfig) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int destinationCase_ = 0; + private java.lang.Object destination_; + + public DestinationCase getDestinationCase() { + return DestinationCase.forNumber(destinationCase_); + } + + public Builder clearDestination() { + destinationCase_ = 0; + destination_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.GcsDestination, + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder, + com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder> + gcsDestinationBuilder_; + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + @java.lang.Override + public boolean hasGcsDestination() { + return destinationCase_ == 1; + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestination getGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 1) { + return gcsDestinationBuilder_.getMessage(); + } + return com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination(com.google.cloud.asset.v1p7beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + public Builder setGcsDestination( + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder builderForValue) { + if (gcsDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + gcsDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + public Builder mergeGcsDestination(com.google.cloud.asset.v1p7beta1.GcsDestination value) { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1 + && destination_ + != com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.asset.v1p7beta1.GcsDestination.newBuilder( + (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 1) { + gcsDestinationBuilder_.mergeFrom(value); + } + gcsDestinationBuilder_.setMessage(value); + } + destinationCase_ = 1; + return this; + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + public Builder clearGcsDestination() { + if (gcsDestinationBuilder_ == null) { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 1) { + destinationCase_ = 0; + destination_ = null; + } + gcsDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + public com.google.cloud.asset.v1p7beta1.GcsDestination.Builder getGcsDestinationBuilder() { + return getGcsDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder() { + if ((destinationCase_ == 1) && (gcsDestinationBuilder_ != null)) { + return gcsDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Destination on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.GcsDestination, + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder, + com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder> + getGcsDestinationFieldBuilder() { + if (gcsDestinationBuilder_ == null) { + if (!(destinationCase_ == 1)) { + destination_ = com.google.cloud.asset.v1p7beta1.GcsDestination.getDefaultInstance(); + } + gcsDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.GcsDestination, + com.google.cloud.asset.v1p7beta1.GcsDestination.Builder, + com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder>( + (com.google.cloud.asset.v1p7beta1.GcsDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 1; + onChanged(); + ; + return gcsDestinationBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.BigQueryDestination, + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder, + com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder> + bigqueryDestinationBuilder_; + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + * + * @return Whether the bigqueryDestination field is set. + */ + @java.lang.Override + public boolean hasBigqueryDestination() { + return destinationCase_ == 2; + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + * + * @return The bigqueryDestination. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestination getBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2) { + return (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } else { + if (destinationCase_ == 2) { + return bigqueryDestinationBuilder_.getMessage(); + } + return com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + public Builder setBigqueryDestination( + com.google.cloud.asset.v1p7beta1.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + destination_ = value; + onChanged(); + } else { + bigqueryDestinationBuilder_.setMessage(value); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + public Builder setBigqueryDestination( + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder builderForValue) { + if (bigqueryDestinationBuilder_ == null) { + destination_ = builderForValue.build(); + onChanged(); + } else { + bigqueryDestinationBuilder_.setMessage(builderForValue.build()); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + public Builder mergeBigqueryDestination( + com.google.cloud.asset.v1p7beta1.BigQueryDestination value) { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2 + && destination_ + != com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance()) { + destination_ = + com.google.cloud.asset.v1p7beta1.BigQueryDestination.newBuilder( + (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_) + .mergeFrom(value) + .buildPartial(); + } else { + destination_ = value; + } + onChanged(); + } else { + if (destinationCase_ == 2) { + bigqueryDestinationBuilder_.mergeFrom(value); + } + bigqueryDestinationBuilder_.setMessage(value); + } + destinationCase_ = 2; + return this; + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + public Builder clearBigqueryDestination() { + if (bigqueryDestinationBuilder_ == null) { + if (destinationCase_ == 2) { + destinationCase_ = 0; + destination_ = null; + onChanged(); + } + } else { + if (destinationCase_ == 2) { + destinationCase_ = 0; + destination_ = null; + } + bigqueryDestinationBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + public com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder + getBigqueryDestinationBuilder() { + return getBigqueryDestinationFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder + getBigqueryDestinationOrBuilder() { + if ((destinationCase_ == 2) && (bigqueryDestinationBuilder_ != null)) { + return bigqueryDestinationBuilder_.getMessageOrBuilder(); + } else { + if (destinationCase_ == 2) { + return (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_; + } + return com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } + } + /** + * + * + *
+     * Destination on BigQuery. The output table stores the fields in asset
+     * proto as columns in BigQuery.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.BigQueryDestination, + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder, + com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder> + getBigqueryDestinationFieldBuilder() { + if (bigqueryDestinationBuilder_ == null) { + if (!(destinationCase_ == 2)) { + destination_ = com.google.cloud.asset.v1p7beta1.BigQueryDestination.getDefaultInstance(); + } + bigqueryDestinationBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.BigQueryDestination, + com.google.cloud.asset.v1p7beta1.BigQueryDestination.Builder, + com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder>( + (com.google.cloud.asset.v1p7beta1.BigQueryDestination) destination_, + getParentForChildren(), + isClean()); + destination_ = null; + } + destinationCase_ = 2; + onChanged(); + ; + return bigqueryDestinationBuilder_; + } + + @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.asset.v1p7beta1.OutputConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.OutputConfig) + private static final com.google.cloud.asset.v1p7beta1.OutputConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.OutputConfig(); + } + + public static com.google.cloud.asset.v1p7beta1.OutputConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutputConfig(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.asset.v1p7beta1.OutputConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfigOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfigOrBuilder.java new file mode 100644 index 000000000..36a0629db --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputConfigOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface OutputConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.OutputConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Destination on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + * + * @return Whether the gcsDestination field is set. + */ + boolean hasGcsDestination(); + /** + * + * + *
+   * Destination on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + * + * @return The gcsDestination. + */ + com.google.cloud.asset.v1p7beta1.GcsDestination getGcsDestination(); + /** + * + * + *
+   * Destination on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsDestination gcs_destination = 1; + */ + com.google.cloud.asset.v1p7beta1.GcsDestinationOrBuilder getGcsDestinationOrBuilder(); + + /** + * + * + *
+   * Destination on BigQuery. The output table stores the fields in asset
+   * proto as columns in BigQuery.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + * + * @return Whether the bigqueryDestination field is set. + */ + boolean hasBigqueryDestination(); + /** + * + * + *
+   * Destination on BigQuery. The output table stores the fields in asset
+   * proto as columns in BigQuery.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + * + * @return The bigqueryDestination. + */ + com.google.cloud.asset.v1p7beta1.BigQueryDestination getBigqueryDestination(); + /** + * + * + *
+   * Destination on BigQuery. The output table stores the fields in asset
+   * proto as columns in BigQuery.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.BigQueryDestination bigquery_destination = 2; + */ + com.google.cloud.asset.v1p7beta1.BigQueryDestinationOrBuilder getBigqueryDestinationOrBuilder(); + + public com.google.cloud.asset.v1p7beta1.OutputConfig.DestinationCase getDestinationCase(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResult.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResult.java new file mode 100644 index 000000000..79431dc8b --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResult.java @@ -0,0 +1,834 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * Output result of export assets.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.OutputResult} + */ +public final class OutputResult extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.OutputResult) + OutputResultOrBuilder { + private static final long serialVersionUID = 0L; + // Use OutputResult.newBuilder() to construct. + private OutputResult(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OutputResult() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OutputResult(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private OutputResult( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder subBuilder = null; + if (resultCase_ == 1) { + subBuilder = + ((com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_).toBuilder(); + } + result_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.GcsOutputResult.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_); + result_ = subBuilder.buildPartial(); + } + resultCase_ = 1; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.OutputResult.class, + com.google.cloud.asset.v1p7beta1.OutputResult.Builder.class); + } + + private int resultCase_ = 0; + private java.lang.Object result_; + + public enum ResultCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + GCS_RESULT(1), + RESULT_NOT_SET(0); + private final int value; + + private ResultCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ResultCase valueOf(int value) { + return forNumber(value); + } + + public static ResultCase forNumber(int value) { + switch (value) { + case 1: + return GCS_RESULT; + case 0: + return RESULT_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ResultCase getResultCase() { + return ResultCase.forNumber(resultCase_); + } + + public static final int GCS_RESULT_FIELD_NUMBER = 1; + /** + * + * + *
+   * Export result on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + * + * @return Whether the gcsResult field is set. + */ + @java.lang.Override + public boolean hasGcsResult() { + return resultCase_ == 1; + } + /** + * + * + *
+   * Export result on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + * + * @return The gcsResult. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResult getGcsResult() { + if (resultCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_; + } + return com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } + /** + * + * + *
+   * Export result on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder getGcsResultOrBuilder() { + if (resultCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_; + } + return com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (resultCase_ == 1) { + output.writeMessage(1, (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (resultCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_); + } + 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.asset.v1p7beta1.OutputResult)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.OutputResult other = + (com.google.cloud.asset.v1p7beta1.OutputResult) obj; + + if (!getResultCase().equals(other.getResultCase())) return false; + switch (resultCase_) { + case 1: + if (!getGcsResult().equals(other.getGcsResult())) return false; + break; + case 0: + default: + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (resultCase_) { + case 1: + hash = (37 * hash) + GCS_RESULT_FIELD_NUMBER; + hash = (53 * hash) + getGcsResult().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult 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.asset.v1p7beta1.OutputResult parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult 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.asset.v1p7beta1.OutputResult parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult 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.asset.v1p7beta1.OutputResult parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult 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.asset.v1p7beta1.OutputResult parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult 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.asset.v1p7beta1.OutputResult prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Output result of export assets.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.OutputResult} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.OutputResult) + com.google.cloud.asset.v1p7beta1.OutputResultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputResult_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputResult_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.OutputResult.class, + com.google.cloud.asset.v1p7beta1.OutputResult.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.OutputResult.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(); + resultCase_ = 0; + result_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_OutputResult_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputResult getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.OutputResult.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputResult build() { + com.google.cloud.asset.v1p7beta1.OutputResult result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.OutputResult buildPartial() { + com.google.cloud.asset.v1p7beta1.OutputResult result = + new com.google.cloud.asset.v1p7beta1.OutputResult(this); + if (resultCase_ == 1) { + if (gcsResultBuilder_ == null) { + result.result_ = result_; + } else { + result.result_ = gcsResultBuilder_.build(); + } + } + result.resultCase_ = resultCase_; + 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.asset.v1p7beta1.OutputResult) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.OutputResult) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.OutputResult other) { + if (other == com.google.cloud.asset.v1p7beta1.OutputResult.getDefaultInstance()) return this; + switch (other.getResultCase()) { + case GCS_RESULT: + { + mergeGcsResult(other.getGcsResult()); + break; + } + case RESULT_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p7beta1.OutputResult parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.OutputResult) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int resultCase_ = 0; + private java.lang.Object result_; + + public ResultCase getResultCase() { + return ResultCase.forNumber(resultCase_); + } + + public Builder clearResult() { + resultCase_ = 0; + result_ = null; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.GcsOutputResult, + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder, + com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder> + gcsResultBuilder_; + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + * + * @return Whether the gcsResult field is set. + */ + @java.lang.Override + public boolean hasGcsResult() { + return resultCase_ == 1; + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + * + * @return The gcsResult. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResult getGcsResult() { + if (gcsResultBuilder_ == null) { + if (resultCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_; + } + return com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } else { + if (resultCase_ == 1) { + return gcsResultBuilder_.getMessage(); + } + return com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + public Builder setGcsResult(com.google.cloud.asset.v1p7beta1.GcsOutputResult value) { + if (gcsResultBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + result_ = value; + onChanged(); + } else { + gcsResultBuilder_.setMessage(value); + } + resultCase_ = 1; + return this; + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + public Builder setGcsResult( + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder builderForValue) { + if (gcsResultBuilder_ == null) { + result_ = builderForValue.build(); + onChanged(); + } else { + gcsResultBuilder_.setMessage(builderForValue.build()); + } + resultCase_ = 1; + return this; + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + public Builder mergeGcsResult(com.google.cloud.asset.v1p7beta1.GcsOutputResult value) { + if (gcsResultBuilder_ == null) { + if (resultCase_ == 1 + && result_ != com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance()) { + result_ = + com.google.cloud.asset.v1p7beta1.GcsOutputResult.newBuilder( + (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_) + .mergeFrom(value) + .buildPartial(); + } else { + result_ = value; + } + onChanged(); + } else { + if (resultCase_ == 1) { + gcsResultBuilder_.mergeFrom(value); + } + gcsResultBuilder_.setMessage(value); + } + resultCase_ = 1; + return this; + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + public Builder clearGcsResult() { + if (gcsResultBuilder_ == null) { + if (resultCase_ == 1) { + resultCase_ = 0; + result_ = null; + onChanged(); + } + } else { + if (resultCase_ == 1) { + resultCase_ = 0; + result_ = null; + } + gcsResultBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + public com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder getGcsResultBuilder() { + return getGcsResultFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder getGcsResultOrBuilder() { + if ((resultCase_ == 1) && (gcsResultBuilder_ != null)) { + return gcsResultBuilder_.getMessageOrBuilder(); + } else { + if (resultCase_ == 1) { + return (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_; + } + return com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } + } + /** + * + * + *
+     * Export result on Cloud Storage.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.GcsOutputResult, + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder, + com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder> + getGcsResultFieldBuilder() { + if (gcsResultBuilder_ == null) { + if (!(resultCase_ == 1)) { + result_ = com.google.cloud.asset.v1p7beta1.GcsOutputResult.getDefaultInstance(); + } + gcsResultBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.GcsOutputResult, + com.google.cloud.asset.v1p7beta1.GcsOutputResult.Builder, + com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder>( + (com.google.cloud.asset.v1p7beta1.GcsOutputResult) result_, + getParentForChildren(), + isClean()); + result_ = null; + } + resultCase_ = 1; + onChanged(); + ; + return gcsResultBuilder_; + } + + @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.asset.v1p7beta1.OutputResult) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.OutputResult) + private static final com.google.cloud.asset.v1p7beta1.OutputResult DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.OutputResult(); + } + + public static com.google.cloud.asset.v1p7beta1.OutputResult getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OutputResult parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new OutputResult(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.asset.v1p7beta1.OutputResult getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResultOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResultOrBuilder.java new file mode 100644 index 000000000..ac9173854 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/OutputResultOrBuilder.java @@ -0,0 +1,62 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface OutputResultOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.OutputResult) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Export result on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + * + * @return Whether the gcsResult field is set. + */ + boolean hasGcsResult(); + /** + * + * + *
+   * Export result on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + * + * @return The gcsResult. + */ + com.google.cloud.asset.v1p7beta1.GcsOutputResult getGcsResult(); + /** + * + * + *
+   * Export result on Cloud Storage.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.GcsOutputResult gcs_result = 1; + */ + com.google.cloud.asset.v1p7beta1.GcsOutputResultOrBuilder getGcsResultOrBuilder(); + + public com.google.cloud.asset.v1p7beta1.OutputResult.ResultCase getResultCase(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpec.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpec.java new file mode 100644 index 000000000..338c90dcd --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpec.java @@ -0,0 +1,789 @@ +/* + * 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/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * Specifications of BigQuery partitioned table as export destination.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.PartitionSpec} + */ +public final class PartitionSpec extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.PartitionSpec) + PartitionSpecOrBuilder { + private static final long serialVersionUID = 0L; + // Use PartitionSpec.newBuilder() to construct. + private PartitionSpec(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PartitionSpec() { + partitionKey_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PartitionSpec(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private PartitionSpec( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + int rawValue = input.readEnum(); + + partitionKey_ = 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.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.PartitionSpec.class, + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder.class); + } + + /** + * + * + *
+   * This enum is used to determine the partition key column when exporting
+   * assets to BigQuery partitioned table(s). Note that, if the partition key is
+   * a timestamp column, the actual partition is based on its date value
+   * (expressed in UTC. see details in
+   * https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables).
+   * 
+ * + * Protobuf enum {@code google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey} + */ + public enum PartitionKey implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Unspecified partition key. If used, it means using non-partitioned table.
+     * 
+ * + * PARTITION_KEY_UNSPECIFIED = 0; + */ + PARTITION_KEY_UNSPECIFIED(0), + /** + * + * + *
+     * The time when the snapshot is taken. If specified as partition key, the
+     * result table(s) is partitoned by the additional timestamp column,
+     * readTime. If [read_time] in ExportAssetsRequest is specified, the
+     * readTime column's value will be the same as it. Otherwise, its value will
+     * be the current time that is used to take the snapshot.
+     * 
+ * + * READ_TIME = 1; + */ + READ_TIME(1), + /** + * + * + *
+     * The time when the request is received and started to be processed. If
+     * specified as partition key, the result table(s) is partitoned by the
+     * requestTime column, an additional timestamp column representing when the
+     * request was received.
+     * 
+ * + * REQUEST_TIME = 2; + */ + REQUEST_TIME(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Unspecified partition key. If used, it means using non-partitioned table.
+     * 
+ * + * PARTITION_KEY_UNSPECIFIED = 0; + */ + public static final int PARTITION_KEY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The time when the snapshot is taken. If specified as partition key, the
+     * result table(s) is partitoned by the additional timestamp column,
+     * readTime. If [read_time] in ExportAssetsRequest is specified, the
+     * readTime column's value will be the same as it. Otherwise, its value will
+     * be the current time that is used to take the snapshot.
+     * 
+ * + * READ_TIME = 1; + */ + public static final int READ_TIME_VALUE = 1; + /** + * + * + *
+     * The time when the request is received and started to be processed. If
+     * specified as partition key, the result table(s) is partitoned by the
+     * requestTime column, an additional timestamp column representing when the
+     * request was received.
+     * 
+ * + * REQUEST_TIME = 2; + */ + public static final int REQUEST_TIME_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 PartitionKey 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 PartitionKey forNumber(int value) { + switch (value) { + case 0: + return PARTITION_KEY_UNSPECIFIED; + case 1: + return READ_TIME; + case 2: + return REQUEST_TIME; + 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 PartitionKey findValueByNumber(int number) { + return PartitionKey.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.asset.v1p7beta1.PartitionSpec.getDescriptor().getEnumTypes().get(0); + } + + private static final PartitionKey[] VALUES = values(); + + public static PartitionKey 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 PartitionKey(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey) + } + + public static final int PARTITION_KEY_FIELD_NUMBER = 1; + private int partitionKey_; + /** + * + * + *
+   * The partition key for BigQuery partitioned table.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return The enum numeric value on the wire for partitionKey. + */ + @java.lang.Override + public int getPartitionKeyValue() { + return partitionKey_; + } + /** + * + * + *
+   * The partition key for BigQuery partitioned table.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return The partitionKey. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey getPartitionKey() { + @SuppressWarnings("deprecation") + com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey result = + com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey.valueOf(partitionKey_); + return result == null + ? com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey.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 (partitionKey_ + != com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey.PARTITION_KEY_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, partitionKey_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (partitionKey_ + != com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey.PARTITION_KEY_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, partitionKey_); + } + 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.asset.v1p7beta1.PartitionSpec)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.PartitionSpec other = + (com.google.cloud.asset.v1p7beta1.PartitionSpec) obj; + + if (partitionKey_ != other.partitionKey_) 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) + PARTITION_KEY_FIELD_NUMBER; + hash = (53 * hash) + partitionKey_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec 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.asset.v1p7beta1.PartitionSpec parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec 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.asset.v1p7beta1.PartitionSpec parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec 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.asset.v1p7beta1.PartitionSpec parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec 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.asset.v1p7beta1.PartitionSpec parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec 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.asset.v1p7beta1.PartitionSpec 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; + } + /** + * + * + *
+   * Specifications of BigQuery partitioned table as export destination.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.PartitionSpec} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.PartitionSpec) + com.google.cloud.asset.v1p7beta1.PartitionSpecOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.PartitionSpec.class, + com.google.cloud.asset.v1p7beta1.PartitionSpec.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.PartitionSpec.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(); + partitionKey_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p7beta1_PartitionSpec_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpec getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.PartitionSpec.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpec build() { + com.google.cloud.asset.v1p7beta1.PartitionSpec result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpec buildPartial() { + com.google.cloud.asset.v1p7beta1.PartitionSpec result = + new com.google.cloud.asset.v1p7beta1.PartitionSpec(this); + result.partitionKey_ = partitionKey_; + 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.asset.v1p7beta1.PartitionSpec) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.PartitionSpec) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.PartitionSpec other) { + if (other == com.google.cloud.asset.v1p7beta1.PartitionSpec.getDefaultInstance()) return this; + if (other.partitionKey_ != 0) { + setPartitionKeyValue(other.getPartitionKeyValue()); + } + 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.asset.v1p7beta1.PartitionSpec parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.PartitionSpec) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int partitionKey_ = 0; + /** + * + * + *
+     * The partition key for BigQuery partitioned table.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return The enum numeric value on the wire for partitionKey. + */ + @java.lang.Override + public int getPartitionKeyValue() { + return partitionKey_; + } + /** + * + * + *
+     * The partition key for BigQuery partitioned table.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @param value The enum numeric value on the wire for partitionKey to set. + * @return This builder for chaining. + */ + public Builder setPartitionKeyValue(int value) { + + partitionKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The partition key for BigQuery partitioned table.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return The partitionKey. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey getPartitionKey() { + @SuppressWarnings("deprecation") + com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey result = + com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey.valueOf(partitionKey_); + return result == null + ? com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The partition key for BigQuery partitioned table.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @param value The partitionKey to set. + * @return This builder for chaining. + */ + public Builder setPartitionKey( + com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey value) { + if (value == null) { + throw new NullPointerException(); + } + + partitionKey_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The partition key for BigQuery partitioned table.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return This builder for chaining. + */ + public Builder clearPartitionKey() { + + partitionKey_ = 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.asset.v1p7beta1.PartitionSpec) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.PartitionSpec) + private static final com.google.cloud.asset.v1p7beta1.PartitionSpec DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.PartitionSpec(); + } + + public static com.google.cloud.asset.v1p7beta1.PartitionSpec getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PartitionSpec parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PartitionSpec(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.asset.v1p7beta1.PartitionSpec getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpecOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpecOrBuilder.java new file mode 100644 index 000000000..80414f9af --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/PartitionSpecOrBuilder.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/asset/v1p7beta1/asset_service.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface PartitionSpecOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.PartitionSpec) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The partition key for BigQuery partitioned table.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return The enum numeric value on the wire for partitionKey. + */ + int getPartitionKeyValue(); + /** + * + * + *
+   * The partition key for BigQuery partitioned table.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey partition_key = 1; + * + * @return The partitionKey. + */ + com.google.cloud.asset.v1p7beta1.PartitionSpec.PartitionKey getPartitionKey(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAsset.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAsset.java new file mode 100644 index 000000000..9e0f23cb2 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAsset.java @@ -0,0 +1,1208 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * An asset identify in Google Cloud which contains its name, type and
+ * ancestors. An asset can be any resource in the Google Cloud [resource
+ * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+ * a resource outside the Google Cloud resource hierarchy (such as Google
+ * Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
+ * See [Supported asset
+ * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+ * for more information.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.RelatedAsset} + */ +public final class RelatedAsset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.RelatedAsset) + RelatedAssetOrBuilder { + private static final long serialVersionUID = 0L; + // Use RelatedAsset.newBuilder() to construct. + private RelatedAsset(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RelatedAsset() { + asset_ = ""; + assetType_ = ""; + ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RelatedAsset(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RelatedAsset( + 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(); + + asset_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + assetType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + ancestors_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + ancestors_.add(s); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + ancestors_ = ancestors_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.RelatedAsset.class, + com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder.class); + } + + public static final int ASSET_FIELD_NUMBER = 1; + private volatile java.lang.Object asset_; + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The asset. + */ + @java.lang.Override + public java.lang.String getAsset() { + java.lang.Object ref = asset_; + 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(); + asset_ = s; + return s; + } + } + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for asset. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetBytes() { + java.lang.Object ref = asset_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + asset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASSET_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object assetType_; + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + @java.lang.Override + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + 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(); + assetType_ = s; + return s; + } + } + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANCESTORS_FIELD_NUMBER = 3; + private com.google.protobuf.LazyStringList ancestors_; + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @return A list containing the ancestors. + */ + public com.google.protobuf.ProtocolStringList getAncestorsList() { + return ancestors_; + } + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @return The count of ancestors. + */ + public int getAncestorsCount() { + return ancestors_.size(); + } + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @param index The index of the element to return. + * @return The ancestors at the given index. + */ + public java.lang.String getAncestors(int index) { + return ancestors_.get(index); + } + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @param index The index of the value to return. + * @return The bytes of the ancestors at the given index. + */ + public com.google.protobuf.ByteString getAncestorsBytes(int index) { + return ancestors_.getByteString(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getAssetBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, asset_); + } + if (!getAssetTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, assetType_); + } + for (int i = 0; i < ancestors_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ancestors_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAssetBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, asset_); + } + if (!getAssetTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, assetType_); + } + { + int dataSize = 0; + for (int i = 0; i < ancestors_.size(); i++) { + dataSize += computeStringSizeNoTag(ancestors_.getRaw(i)); + } + size += dataSize; + size += 1 * getAncestorsList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.asset.v1p7beta1.RelatedAsset)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.RelatedAsset other = + (com.google.cloud.asset.v1p7beta1.RelatedAsset) obj; + + if (!getAsset().equals(other.getAsset())) return false; + if (!getAssetType().equals(other.getAssetType())) return false; + if (!getAncestorsList().equals(other.getAncestorsList())) 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) + ASSET_FIELD_NUMBER; + hash = (53 * hash) + getAsset().hashCode(); + hash = (37 * hash) + ASSET_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getAssetType().hashCode(); + if (getAncestorsCount() > 0) { + hash = (37 * hash) + ANCESTORS_FIELD_NUMBER; + hash = (53 * hash) + getAncestorsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset 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.asset.v1p7beta1.RelatedAsset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset 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.asset.v1p7beta1.RelatedAsset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset 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.asset.v1p7beta1.RelatedAsset parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset 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.asset.v1p7beta1.RelatedAsset parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset 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.asset.v1p7beta1.RelatedAsset 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; + } + /** + * + * + *
+   * An asset identify in Google Cloud which contains its name, type and
+   * ancestors. An asset can be any resource in the Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * a resource outside the Google Cloud resource hierarchy (such as Google
+   * Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy).
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.RelatedAsset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.RelatedAsset) + com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.RelatedAsset.class, + com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.RelatedAsset.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(); + asset_ = ""; + + assetType_ = ""; + + ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAsset_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAsset getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.RelatedAsset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAsset build() { + com.google.cloud.asset.v1p7beta1.RelatedAsset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAsset buildPartial() { + com.google.cloud.asset.v1p7beta1.RelatedAsset result = + new com.google.cloud.asset.v1p7beta1.RelatedAsset(this); + int from_bitField0_ = bitField0_; + result.asset_ = asset_; + result.assetType_ = assetType_; + if (((bitField0_ & 0x00000001) != 0)) { + ancestors_ = ancestors_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.ancestors_ = ancestors_; + 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.asset.v1p7beta1.RelatedAsset) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.RelatedAsset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.RelatedAsset other) { + if (other == com.google.cloud.asset.v1p7beta1.RelatedAsset.getDefaultInstance()) return this; + if (!other.getAsset().isEmpty()) { + asset_ = other.asset_; + onChanged(); + } + if (!other.getAssetType().isEmpty()) { + assetType_ = other.assetType_; + onChanged(); + } + if (!other.ancestors_.isEmpty()) { + if (ancestors_.isEmpty()) { + ancestors_ = other.ancestors_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAncestorsIsMutable(); + ancestors_.addAll(other.ancestors_); + } + 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.asset.v1p7beta1.RelatedAsset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.RelatedAsset) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object asset_ = ""; + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The asset. + */ + public java.lang.String getAsset() { + java.lang.Object ref = asset_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + asset_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for asset. + */ + public com.google.protobuf.ByteString getAssetBytes() { + java.lang.Object ref = asset_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + asset_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The asset to set. + * @return This builder for chaining. + */ + public Builder setAsset(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + asset_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return This builder for chaining. + */ + public Builder clearAsset() { + + asset_ = getDefaultInstance().getAsset(); + onChanged(); + return this; + } + /** + * + * + *
+     * The full name of the asset. Example:
+     * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+     * See [Resource
+     * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @param value The bytes for asset to set. + * @return This builder for chaining. + */ + public Builder setAssetBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + asset_ = value; + onChanged(); + return this; + } + + private java.lang.Object assetType_ = ""; + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + public java.lang.String getAssetType() { + java.lang.Object ref = assetType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + assetType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + public com.google.protobuf.ByteString getAssetTypeBytes() { + java.lang.Object ref = assetType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + assetType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @param value The assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + assetType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearAssetType() { + + assetType_ = getDefaultInstance().getAssetType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The type of the asset. Example: `compute.googleapis.com/Disk`
+     * See [Supported asset
+     * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+     * for more information.
+     * 
+ * + * string asset_type = 2; + * + * @param value The bytes for assetType to set. + * @return This builder for chaining. + */ + public Builder setAssetTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + assetType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList ancestors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAncestorsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + ancestors_ = new com.google.protobuf.LazyStringArrayList(ancestors_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @return A list containing the ancestors. + */ + public com.google.protobuf.ProtocolStringList getAncestorsList() { + return ancestors_.getUnmodifiableView(); + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @return The count of ancestors. + */ + public int getAncestorsCount() { + return ancestors_.size(); + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @param index The index of the element to return. + * @return The ancestors at the given index. + */ + public java.lang.String getAncestors(int index) { + return ancestors_.get(index); + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @param index The index of the value to return. + * @return The bytes of the ancestors at the given index. + */ + public com.google.protobuf.ByteString getAncestorsBytes(int index) { + return ancestors_.getByteString(index); + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @param index The index to set the value at. + * @param value The ancestors to set. + * @return This builder for chaining. + */ + public Builder setAncestors(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAncestorsIsMutable(); + ancestors_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @param value The ancestors to add. + * @return This builder for chaining. + */ + public Builder addAncestors(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAncestorsIsMutable(); + ancestors_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @param values The ancestors to add. + * @return This builder for chaining. + */ + public Builder addAllAncestors(java.lang.Iterable values) { + ensureAncestorsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, ancestors_); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @return This builder for chaining. + */ + public Builder clearAncestors() { + ancestors_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * The ancestors of an asset in Google Cloud [resource
+     * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+     * represented as a list of relative resource names. An ancestry path starts
+     * with the closest ancestor in the hierarchy and ends at root.
+     * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+     * 
+ * + * repeated string ancestors = 3; + * + * @param value The bytes of the ancestors to add. + * @return This builder for chaining. + */ + public Builder addAncestorsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAncestorsIsMutable(); + ancestors_.add(value); + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p7beta1.RelatedAsset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.RelatedAsset) + private static final com.google.cloud.asset.v1p7beta1.RelatedAsset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.RelatedAsset(); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAsset getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelatedAsset parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RelatedAsset(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.asset.v1p7beta1.RelatedAsset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetOrBuilder.java new file mode 100644 index 000000000..8e4a2d70e --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetOrBuilder.java @@ -0,0 +1,156 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface RelatedAssetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.RelatedAsset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The asset. + */ + java.lang.String getAsset(); + /** + * + * + *
+   * The full name of the asset. Example:
+   * `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`
+   * See [Resource
+   * names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * 
+ * + * string asset = 1 [(.google.api.resource_reference) = { ... } + * + * @return The bytes for asset. + */ + com.google.protobuf.ByteString getAssetBytes(); + + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + java.lang.String getAssetType(); + /** + * + * + *
+   * The type of the asset. Example: `compute.googleapis.com/Disk`
+   * See [Supported asset
+   * types](https://cloud.google.com/asset-inventory/docs/supported-asset-types)
+   * for more information.
+   * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + com.google.protobuf.ByteString getAssetTypeBytes(); + + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @return A list containing the ancestors. + */ + java.util.List getAncestorsList(); + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @return The count of ancestors. + */ + int getAncestorsCount(); + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @param index The index of the element to return. + * @return The ancestors at the given index. + */ + java.lang.String getAncestors(int index); + /** + * + * + *
+   * The ancestors of an asset in Google Cloud [resource
+   * hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy),
+   * represented as a list of relative resource names. An ancestry path starts
+   * with the closest ancestor in the hierarchy and ends at root.
+   * Example: `["projects/123456789", "folders/5432", "organizations/1234"]`
+   * 
+ * + * repeated string ancestors = 3; + * + * @param index The index of the value to return. + * @return The bytes of the ancestors at the given index. + */ + com.google.protobuf.ByteString getAncestorsBytes(int index); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssets.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssets.java new file mode 100644 index 000000000..4fd283656 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssets.java @@ -0,0 +1,1243 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * The detailed related assets with the `relationship_type`.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.RelatedAssets} + */ +public final class RelatedAssets extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.RelatedAssets) + RelatedAssetsOrBuilder { + private static final long serialVersionUID = 0L; + // Use RelatedAssets.newBuilder() to construct. + private RelatedAssets(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RelatedAssets() { + assets_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RelatedAssets(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RelatedAssets( + 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.asset.v1p7beta1.RelationshipAttributes.Builder subBuilder = null; + if (relationshipAttributes_ != null) { + subBuilder = relationshipAttributes_.toBuilder(); + } + relationshipAttributes_ = + input.readMessage( + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(relationshipAttributes_); + relationshipAttributes_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + assets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + assets_.add( + input.readMessage( + com.google.cloud.asset.v1p7beta1.RelatedAsset.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)) { + assets_ = java.util.Collections.unmodifiableList(assets_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.RelatedAssets.class, + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder.class); + } + + public static final int RELATIONSHIP_ATTRIBUTES_FIELD_NUMBER = 1; + private com.google.cloud.asset.v1p7beta1.RelationshipAttributes relationshipAttributes_; + /** + * + * + *
+   * The detailed relation attributes.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + * @return Whether the relationshipAttributes field is set. + */ + @java.lang.Override + public boolean hasRelationshipAttributes() { + return relationshipAttributes_ != null; + } + /** + * + * + *
+   * The detailed relation attributes.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + * @return The relationshipAttributes. + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelationshipAttributes getRelationshipAttributes() { + return relationshipAttributes_ == null + ? com.google.cloud.asset.v1p7beta1.RelationshipAttributes.getDefaultInstance() + : relationshipAttributes_; + } + /** + * + * + *
+   * The detailed relation attributes.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder + getRelationshipAttributesOrBuilder() { + return getRelationshipAttributes(); + } + + public static final int ASSETS_FIELD_NUMBER = 2; + private java.util.List assets_; + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + @java.lang.Override + public java.util.List getAssetsList() { + return assets_; + } + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + @java.lang.Override + public java.util.List + getAssetsOrBuilderList() { + return assets_; + } + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + @java.lang.Override + public int getAssetsCount() { + return assets_.size(); + } + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAsset getAssets(int index) { + return assets_.get(index); + } + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder getAssetsOrBuilder(int index) { + return assets_.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 (relationshipAttributes_ != null) { + output.writeMessage(1, getRelationshipAttributes()); + } + for (int i = 0; i < assets_.size(); i++) { + output.writeMessage(2, assets_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (relationshipAttributes_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRelationshipAttributes()); + } + for (int i = 0; i < assets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, assets_.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.asset.v1p7beta1.RelatedAssets)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.RelatedAssets other = + (com.google.cloud.asset.v1p7beta1.RelatedAssets) obj; + + if (hasRelationshipAttributes() != other.hasRelationshipAttributes()) return false; + if (hasRelationshipAttributes()) { + if (!getRelationshipAttributes().equals(other.getRelationshipAttributes())) return false; + } + if (!getAssetsList().equals(other.getAssetsList())) 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 (hasRelationshipAttributes()) { + hash = (37 * hash) + RELATIONSHIP_ATTRIBUTES_FIELD_NUMBER; + hash = (53 * hash) + getRelationshipAttributes().hashCode(); + } + if (getAssetsCount() > 0) { + hash = (37 * hash) + ASSETS_FIELD_NUMBER; + hash = (53 * hash) + getAssetsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets 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.asset.v1p7beta1.RelatedAssets parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets 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.asset.v1p7beta1.RelatedAssets parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets 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.asset.v1p7beta1.RelatedAssets parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets 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.asset.v1p7beta1.RelatedAssets parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets 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.asset.v1p7beta1.RelatedAssets 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; + } + /** + * + * + *
+   * The detailed related assets with the `relationship_type`.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.RelatedAssets} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.RelatedAssets) + com.google.cloud.asset.v1p7beta1.RelatedAssetsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.RelatedAssets.class, + com.google.cloud.asset.v1p7beta1.RelatedAssets.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.RelatedAssets.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getAssetsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (relationshipAttributesBuilder_ == null) { + relationshipAttributes_ = null; + } else { + relationshipAttributes_ = null; + relationshipAttributesBuilder_ = null; + } + if (assetsBuilder_ == null) { + assets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + assetsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelatedAssets_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAssets getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.RelatedAssets.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAssets build() { + com.google.cloud.asset.v1p7beta1.RelatedAssets result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelatedAssets buildPartial() { + com.google.cloud.asset.v1p7beta1.RelatedAssets result = + new com.google.cloud.asset.v1p7beta1.RelatedAssets(this); + int from_bitField0_ = bitField0_; + if (relationshipAttributesBuilder_ == null) { + result.relationshipAttributes_ = relationshipAttributes_; + } else { + result.relationshipAttributes_ = relationshipAttributesBuilder_.build(); + } + if (assetsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + assets_ = java.util.Collections.unmodifiableList(assets_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.assets_ = assets_; + } else { + result.assets_ = assetsBuilder_.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.asset.v1p7beta1.RelatedAssets) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.RelatedAssets) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.RelatedAssets other) { + if (other == com.google.cloud.asset.v1p7beta1.RelatedAssets.getDefaultInstance()) return this; + if (other.hasRelationshipAttributes()) { + mergeRelationshipAttributes(other.getRelationshipAttributes()); + } + if (assetsBuilder_ == null) { + if (!other.assets_.isEmpty()) { + if (assets_.isEmpty()) { + assets_ = other.assets_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAssetsIsMutable(); + assets_.addAll(other.assets_); + } + onChanged(); + } + } else { + if (!other.assets_.isEmpty()) { + if (assetsBuilder_.isEmpty()) { + assetsBuilder_.dispose(); + assetsBuilder_ = null; + assets_ = other.assets_; + bitField0_ = (bitField0_ & ~0x00000001); + assetsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAssetsFieldBuilder() + : null; + } else { + assetsBuilder_.addAllMessages(other.assets_); + } + } + } + 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.asset.v1p7beta1.RelatedAssets parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.RelatedAssets) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.cloud.asset.v1p7beta1.RelationshipAttributes relationshipAttributes_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelationshipAttributes, + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder, + com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder> + relationshipAttributesBuilder_; + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + * + * @return Whether the relationshipAttributes field is set. + */ + public boolean hasRelationshipAttributes() { + return relationshipAttributesBuilder_ != null || relationshipAttributes_ != null; + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + * + * @return The relationshipAttributes. + */ + public com.google.cloud.asset.v1p7beta1.RelationshipAttributes getRelationshipAttributes() { + if (relationshipAttributesBuilder_ == null) { + return relationshipAttributes_ == null + ? com.google.cloud.asset.v1p7beta1.RelationshipAttributes.getDefaultInstance() + : relationshipAttributes_; + } else { + return relationshipAttributesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + public Builder setRelationshipAttributes( + com.google.cloud.asset.v1p7beta1.RelationshipAttributes value) { + if (relationshipAttributesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + relationshipAttributes_ = value; + onChanged(); + } else { + relationshipAttributesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + public Builder setRelationshipAttributes( + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder builderForValue) { + if (relationshipAttributesBuilder_ == null) { + relationshipAttributes_ = builderForValue.build(); + onChanged(); + } else { + relationshipAttributesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + public Builder mergeRelationshipAttributes( + com.google.cloud.asset.v1p7beta1.RelationshipAttributes value) { + if (relationshipAttributesBuilder_ == null) { + if (relationshipAttributes_ != null) { + relationshipAttributes_ = + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.newBuilder( + relationshipAttributes_) + .mergeFrom(value) + .buildPartial(); + } else { + relationshipAttributes_ = value; + } + onChanged(); + } else { + relationshipAttributesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + public Builder clearRelationshipAttributes() { + if (relationshipAttributesBuilder_ == null) { + relationshipAttributes_ = null; + onChanged(); + } else { + relationshipAttributes_ = null; + relationshipAttributesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + public com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder + getRelationshipAttributesBuilder() { + + onChanged(); + return getRelationshipAttributesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + public com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder + getRelationshipAttributesOrBuilder() { + if (relationshipAttributesBuilder_ != null) { + return relationshipAttributesBuilder_.getMessageOrBuilder(); + } else { + return relationshipAttributes_ == null + ? com.google.cloud.asset.v1p7beta1.RelationshipAttributes.getDefaultInstance() + : relationshipAttributes_; + } + } + /** + * + * + *
+     * The detailed relation attributes.
+     * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelationshipAttributes, + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder, + com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder> + getRelationshipAttributesFieldBuilder() { + if (relationshipAttributesBuilder_ == null) { + relationshipAttributesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelationshipAttributes, + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder, + com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder>( + getRelationshipAttributes(), getParentForChildren(), isClean()); + relationshipAttributes_ = null; + } + return relationshipAttributesBuilder_; + } + + private java.util.List assets_ = + java.util.Collections.emptyList(); + + private void ensureAssetsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + assets_ = new java.util.ArrayList(assets_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelatedAsset, + com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder, + com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder> + assetsBuilder_; + + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public java.util.List getAssetsList() { + if (assetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(assets_); + } else { + return assetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public int getAssetsCount() { + if (assetsBuilder_ == null) { + return assets_.size(); + } else { + return assetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAsset getAssets(int index) { + if (assetsBuilder_ == null) { + return assets_.get(index); + } else { + return assetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder setAssets(int index, com.google.cloud.asset.v1p7beta1.RelatedAsset value) { + if (assetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetsIsMutable(); + assets_.set(index, value); + onChanged(); + } else { + assetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder setAssets( + int index, com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder builderForValue) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.set(index, builderForValue.build()); + onChanged(); + } else { + assetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder addAssets(com.google.cloud.asset.v1p7beta1.RelatedAsset value) { + if (assetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetsIsMutable(); + assets_.add(value); + onChanged(); + } else { + assetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder addAssets(int index, com.google.cloud.asset.v1p7beta1.RelatedAsset value) { + if (assetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetsIsMutable(); + assets_.add(index, value); + onChanged(); + } else { + assetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder addAssets( + com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder builderForValue) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.add(builderForValue.build()); + onChanged(); + } else { + assetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder addAssets( + int index, com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder builderForValue) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.add(index, builderForValue.build()); + onChanged(); + } else { + assetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder addAllAssets( + java.lang.Iterable values) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, assets_); + onChanged(); + } else { + assetsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder clearAssets() { + if (assetsBuilder_ == null) { + assets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + assetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public Builder removeAssets(int index) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.remove(index); + onChanged(); + } else { + assetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder getAssetsBuilder(int index) { + return getAssetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder getAssetsOrBuilder(int index) { + if (assetsBuilder_ == null) { + return assets_.get(index); + } else { + return assetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public java.util.List + getAssetsOrBuilderList() { + if (assetsBuilder_ != null) { + return assetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(assets_); + } + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder addAssetsBuilder() { + return getAssetsFieldBuilder() + .addBuilder(com.google.cloud.asset.v1p7beta1.RelatedAsset.getDefaultInstance()); + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder addAssetsBuilder(int index) { + return getAssetsFieldBuilder() + .addBuilder(index, com.google.cloud.asset.v1p7beta1.RelatedAsset.getDefaultInstance()); + } + /** + * + * + *
+     * The peer resources of the relationship.
+     * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + public java.util.List + getAssetsBuilderList() { + return getAssetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelatedAsset, + com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder, + com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder> + getAssetsFieldBuilder() { + if (assetsBuilder_ == null) { + assetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1p7beta1.RelatedAsset, + com.google.cloud.asset.v1p7beta1.RelatedAsset.Builder, + com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder>( + assets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + assets_ = null; + } + return assetsBuilder_; + } + + @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.asset.v1p7beta1.RelatedAssets) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.RelatedAssets) + private static final com.google.cloud.asset.v1p7beta1.RelatedAssets DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.RelatedAssets(); + } + + public static com.google.cloud.asset.v1p7beta1.RelatedAssets getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelatedAssets parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RelatedAssets(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.asset.v1p7beta1.RelatedAssets getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetsOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetsOrBuilder.java new file mode 100644 index 000000000..a3ac416cd --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelatedAssetsOrBuilder.java @@ -0,0 +1,113 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface RelatedAssetsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.RelatedAssets) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The detailed relation attributes.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + * @return Whether the relationshipAttributes field is set. + */ + boolean hasRelationshipAttributes(); + /** + * + * + *
+   * The detailed relation attributes.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + * + * @return The relationshipAttributes. + */ + com.google.cloud.asset.v1p7beta1.RelationshipAttributes getRelationshipAttributes(); + /** + * + * + *
+   * The detailed relation attributes.
+   * 
+ * + * .google.cloud.asset.v1p7beta1.RelationshipAttributes relationship_attributes = 1; + */ + com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder + getRelationshipAttributesOrBuilder(); + + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + java.util.List getAssetsList(); + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + com.google.cloud.asset.v1p7beta1.RelatedAsset getAssets(int index); + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + int getAssetsCount(); + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + java.util.List + getAssetsOrBuilderList(); + /** + * + * + *
+   * The peer resources of the relationship.
+   * 
+ * + * repeated .google.cloud.asset.v1p7beta1.RelatedAsset assets = 2; + */ + com.google.cloud.asset.v1p7beta1.RelatedAssetOrBuilder getAssetsOrBuilder(int index); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributes.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributes.java new file mode 100644 index 000000000..c32da37c6 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributes.java @@ -0,0 +1,1183 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * The relationship attributes which include  `type`, `source_resource_type`,
+ * `target_resource_type` and `action`.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.RelationshipAttributes} + */ +public final class RelationshipAttributes extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.RelationshipAttributes) + RelationshipAttributesOrBuilder { + private static final long serialVersionUID = 0L; + // Use RelationshipAttributes.newBuilder() to construct. + private RelationshipAttributes(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RelationshipAttributes() { + type_ = ""; + sourceResourceType_ = ""; + targetResourceType_ = ""; + action_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RelationshipAttributes(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private RelationshipAttributes( + 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(); + + sourceResourceType_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + targetResourceType_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = 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.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.class, + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object type_; + /** + * + * + *
+   * The unique identifier of the relationship type. Example:
+   * `INSTANCE_TO_INSTANCEGROUP`
+   * 
+ * + * string type = 4; + * + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + * + * + *
+   * The unique identifier of the relationship type. Example:
+   * `INSTANCE_TO_INSTANCEGROUP`
+   * 
+ * + * string type = 4; + * + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_RESOURCE_TYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object sourceResourceType_; + /** + * + * + *
+   * The source asset type. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string source_resource_type = 1; + * + * @return The sourceResourceType. + */ + @java.lang.Override + public java.lang.String getSourceResourceType() { + java.lang.Object ref = sourceResourceType_; + 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(); + sourceResourceType_ = s; + return s; + } + } + /** + * + * + *
+   * The source asset type. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string source_resource_type = 1; + * + * @return The bytes for sourceResourceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getSourceResourceTypeBytes() { + java.lang.Object ref = sourceResourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceResourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TARGET_RESOURCE_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object targetResourceType_; + /** + * + * + *
+   * The target asset type. Example: `compute.googleapis.com/Disk`
+   * 
+ * + * string target_resource_type = 2; + * + * @return The targetResourceType. + */ + @java.lang.Override + public java.lang.String getTargetResourceType() { + java.lang.Object ref = targetResourceType_; + 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(); + targetResourceType_ = s; + return s; + } + } + /** + * + * + *
+   * The target asset type. Example: `compute.googleapis.com/Disk`
+   * 
+ * + * string target_resource_type = 2; + * + * @return The bytes for targetResourceType. + */ + @java.lang.Override + public com.google.protobuf.ByteString getTargetResourceTypeBytes() { + java.lang.Object ref = targetResourceType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 3; + private volatile java.lang.Object action_; + /** + * + * + *
+   * The detail of the relationship, e.g. `contains`, `attaches`
+   * 
+ * + * string action = 3; + * + * @return The action. + */ + @java.lang.Override + public java.lang.String getAction() { + java.lang.Object ref = action_; + 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(); + action_ = s; + return s; + } + } + /** + * + * + *
+   * The detail of the relationship, e.g. `contains`, `attaches`
+   * 
+ * + * string action = 3; + * + * @return The bytes for action. + */ + @java.lang.Override + public com.google.protobuf.ByteString getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + action_ = 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 (!getSourceResourceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, sourceResourceType_); + } + if (!getTargetResourceTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, targetResourceType_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, action_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, type_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getSourceResourceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, sourceResourceType_); + } + if (!getTargetResourceTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, targetResourceType_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, action_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, type_); + } + 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.asset.v1p7beta1.RelationshipAttributes)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.RelationshipAttributes other = + (com.google.cloud.asset.v1p7beta1.RelationshipAttributes) obj; + + if (!getType().equals(other.getType())) return false; + if (!getSourceResourceType().equals(other.getSourceResourceType())) return false; + if (!getTargetResourceType().equals(other.getTargetResourceType())) return false; + if (!getAction().equals(other.getAction())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + SOURCE_RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSourceResourceType().hashCode(); + hash = (37 * hash) + TARGET_RESOURCE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getTargetResourceType().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes 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.asset.v1p7beta1.RelationshipAttributes parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes 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.asset.v1p7beta1.RelationshipAttributes parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes 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.asset.v1p7beta1.RelationshipAttributes parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes 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.asset.v1p7beta1.RelationshipAttributes parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes 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.asset.v1p7beta1.RelationshipAttributes 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; + } + /** + * + * + *
+   * The relationship attributes which include  `type`, `source_resource_type`,
+   * `target_resource_type` and `action`.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.RelationshipAttributes} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.RelationshipAttributes) + com.google.cloud.asset.v1p7beta1.RelationshipAttributesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.class, + com.google.cloud.asset.v1p7beta1.RelationshipAttributes.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.RelationshipAttributes.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(); + type_ = ""; + + sourceResourceType_ = ""; + + targetResourceType_ = ""; + + action_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_RelationshipAttributes_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelationshipAttributes getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.RelationshipAttributes.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelationshipAttributes build() { + com.google.cloud.asset.v1p7beta1.RelationshipAttributes result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.RelationshipAttributes buildPartial() { + com.google.cloud.asset.v1p7beta1.RelationshipAttributes result = + new com.google.cloud.asset.v1p7beta1.RelationshipAttributes(this); + result.type_ = type_; + result.sourceResourceType_ = sourceResourceType_; + result.targetResourceType_ = targetResourceType_; + result.action_ = action_; + 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.asset.v1p7beta1.RelationshipAttributes) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.RelationshipAttributes) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.RelationshipAttributes other) { + if (other == com.google.cloud.asset.v1p7beta1.RelationshipAttributes.getDefaultInstance()) + return this; + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getSourceResourceType().isEmpty()) { + sourceResourceType_ = other.sourceResourceType_; + onChanged(); + } + if (!other.getTargetResourceType().isEmpty()) { + targetResourceType_ = other.targetResourceType_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + 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.asset.v1p7beta1.RelationshipAttributes parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p7beta1.RelationshipAttributes) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object type_ = ""; + /** + * + * + *
+     * The unique identifier of the relationship type. Example:
+     * `INSTANCE_TO_INSTANCEGROUP`
+     * 
+ * + * string type = 4; + * + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The unique identifier of the relationship type. Example:
+     * `INSTANCE_TO_INSTANCEGROUP`
+     * 
+ * + * string type = 4; + * + * @return The bytes for type. + */ + public com.google.protobuf.ByteString getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The unique identifier of the relationship type. Example:
+     * `INSTANCE_TO_INSTANCEGROUP`
+     * 
+ * + * string type = 4; + * + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the relationship type. Example:
+     * `INSTANCE_TO_INSTANCEGROUP`
+     * 
+ * + * string type = 4; + * + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The unique identifier of the relationship type. Example:
+     * `INSTANCE_TO_INSTANCEGROUP`
+     * 
+ * + * string type = 4; + * + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object sourceResourceType_ = ""; + /** + * + * + *
+     * The source asset type. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string source_resource_type = 1; + * + * @return The sourceResourceType. + */ + public java.lang.String getSourceResourceType() { + java.lang.Object ref = sourceResourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + sourceResourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The source asset type. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string source_resource_type = 1; + * + * @return The bytes for sourceResourceType. + */ + public com.google.protobuf.ByteString getSourceResourceTypeBytes() { + java.lang.Object ref = sourceResourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + sourceResourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The source asset type. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string source_resource_type = 1; + * + * @param value The sourceResourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceResourceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + sourceResourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The source asset type. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string source_resource_type = 1; + * + * @return This builder for chaining. + */ + public Builder clearSourceResourceType() { + + sourceResourceType_ = getDefaultInstance().getSourceResourceType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The source asset type. Example: `compute.googleapis.com/Instance`
+     * 
+ * + * string source_resource_type = 1; + * + * @param value The bytes for sourceResourceType to set. + * @return This builder for chaining. + */ + public Builder setSourceResourceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + sourceResourceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object targetResourceType_ = ""; + /** + * + * + *
+     * The target asset type. Example: `compute.googleapis.com/Disk`
+     * 
+ * + * string target_resource_type = 2; + * + * @return The targetResourceType. + */ + public java.lang.String getTargetResourceType() { + java.lang.Object ref = targetResourceType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + targetResourceType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The target asset type. Example: `compute.googleapis.com/Disk`
+     * 
+ * + * string target_resource_type = 2; + * + * @return The bytes for targetResourceType. + */ + public com.google.protobuf.ByteString getTargetResourceTypeBytes() { + java.lang.Object ref = targetResourceType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + targetResourceType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The target asset type. Example: `compute.googleapis.com/Disk`
+     * 
+ * + * string target_resource_type = 2; + * + * @param value The targetResourceType to set. + * @return This builder for chaining. + */ + public Builder setTargetResourceType(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + targetResourceType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The target asset type. Example: `compute.googleapis.com/Disk`
+     * 
+ * + * string target_resource_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetResourceType() { + + targetResourceType_ = getDefaultInstance().getTargetResourceType(); + onChanged(); + return this; + } + /** + * + * + *
+     * The target asset type. Example: `compute.googleapis.com/Disk`
+     * 
+ * + * string target_resource_type = 2; + * + * @param value The bytes for targetResourceType to set. + * @return This builder for chaining. + */ + public Builder setTargetResourceTypeBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + targetResourceType_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * + * + *
+     * The detail of the relationship, e.g. `contains`, `attaches`
+     * 
+ * + * string action = 3; + * + * @return The action. + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The detail of the relationship, e.g. `contains`, `attaches`
+     * 
+ * + * string action = 3; + * + * @return The bytes for action. + */ + public com.google.protobuf.ByteString getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The detail of the relationship, e.g. `contains`, `attaches`
+     * 
+ * + * string action = 3; + * + * @param value The action to set. + * @return This builder for chaining. + */ + public Builder setAction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The detail of the relationship, e.g. `contains`, `attaches`
+     * 
+ * + * string action = 3; + * + * @return This builder for chaining. + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * + * + *
+     * The detail of the relationship, e.g. `contains`, `attaches`
+     * 
+ * + * string action = 3; + * + * @param value The bytes for action to set. + * @return This builder for chaining. + */ + public Builder setActionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = 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.asset.v1p7beta1.RelationshipAttributes) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.RelationshipAttributes) + private static final com.google.cloud.asset.v1p7beta1.RelationshipAttributes DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.RelationshipAttributes(); + } + + public static com.google.cloud.asset.v1p7beta1.RelationshipAttributes getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RelationshipAttributes parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RelationshipAttributes(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.asset.v1p7beta1.RelationshipAttributes getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributesOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributesOrBuilder.java new file mode 100644 index 000000000..8df443f22 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/RelationshipAttributesOrBuilder.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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface RelationshipAttributesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.RelationshipAttributes) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The unique identifier of the relationship type. Example:
+   * `INSTANCE_TO_INSTANCEGROUP`
+   * 
+ * + * string type = 4; + * + * @return The type. + */ + java.lang.String getType(); + /** + * + * + *
+   * The unique identifier of the relationship type. Example:
+   * `INSTANCE_TO_INSTANCEGROUP`
+   * 
+ * + * string type = 4; + * + * @return The bytes for type. + */ + com.google.protobuf.ByteString getTypeBytes(); + + /** + * + * + *
+   * The source asset type. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string source_resource_type = 1; + * + * @return The sourceResourceType. + */ + java.lang.String getSourceResourceType(); + /** + * + * + *
+   * The source asset type. Example: `compute.googleapis.com/Instance`
+   * 
+ * + * string source_resource_type = 1; + * + * @return The bytes for sourceResourceType. + */ + com.google.protobuf.ByteString getSourceResourceTypeBytes(); + + /** + * + * + *
+   * The target asset type. Example: `compute.googleapis.com/Disk`
+   * 
+ * + * string target_resource_type = 2; + * + * @return The targetResourceType. + */ + java.lang.String getTargetResourceType(); + /** + * + * + *
+   * The target asset type. Example: `compute.googleapis.com/Disk`
+   * 
+ * + * string target_resource_type = 2; + * + * @return The bytes for targetResourceType. + */ + com.google.protobuf.ByteString getTargetResourceTypeBytes(); + + /** + * + * + *
+   * The detail of the relationship, e.g. `contains`, `attaches`
+   * 
+ * + * string action = 3; + * + * @return The action. + */ + java.lang.String getAction(); + /** + * + * + *
+   * The detail of the relationship, e.g. `contains`, `attaches`
+   * 
+ * + * string action = 3; + * + * @return The bytes for action. + */ + com.google.protobuf.ByteString getActionBytes(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Resource.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Resource.java new file mode 100644 index 000000000..4db3546bd --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/Resource.java @@ -0,0 +1,1946 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +/** + * + * + *
+ * A representation of a Google Cloud resource.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.Resource} + */ +public final class Resource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p7beta1.Resource) + ResourceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Resource.newBuilder() to construct. + private Resource(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Resource() { + version_ = ""; + discoveryDocumentUri_ = ""; + discoveryName_ = ""; + resourceUrl_ = ""; + parent_ = ""; + location_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Resource(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Resource( + 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(); + + version_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + discoveryDocumentUri_ = s; + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + discoveryName_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + resourceUrl_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 50: + { + com.google.protobuf.Struct.Builder subBuilder = null; + if (data_ != null) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(com.google.protobuf.Struct.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = subBuilder.buildPartial(); + } + + break; + } + case 66: + { + java.lang.String s = input.readStringRequireUtf8(); + + location_ = 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.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.Resource.class, + com.google.cloud.asset.v1p7beta1.Resource.Builder.class); + } + + public static final int VERSION_FIELD_NUMBER = 1; + private volatile java.lang.Object version_; + /** + * + * + *
+   * The API version. Example: `v1`
+   * 
+ * + * string version = 1; + * + * @return The version. + */ + @java.lang.Override + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } + } + /** + * + * + *
+   * The API version. Example: `v1`
+   * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + @java.lang.Override + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISCOVERY_DOCUMENT_URI_FIELD_NUMBER = 2; + private volatile java.lang.Object discoveryDocumentUri_; + /** + * + * + *
+   * The URL of the discovery document containing the resource's JSON schema.
+   * Example:
+   * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_document_uri = 2; + * + * @return The discoveryDocumentUri. + */ + @java.lang.Override + public java.lang.String getDiscoveryDocumentUri() { + java.lang.Object ref = discoveryDocumentUri_; + 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(); + discoveryDocumentUri_ = s; + return s; + } + } + /** + * + * + *
+   * The URL of the discovery document containing the resource's JSON schema.
+   * Example:
+   * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_document_uri = 2; + * + * @return The bytes for discoveryDocumentUri. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiscoveryDocumentUriBytes() { + java.lang.Object ref = discoveryDocumentUri_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + discoveryDocumentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DISCOVERY_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object discoveryName_; + /** + * + * + *
+   * The JSON schema name listed in the discovery document. Example:
+   * `Project`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_name = 3; + * + * @return The discoveryName. + */ + @java.lang.Override + public java.lang.String getDiscoveryName() { + java.lang.Object ref = discoveryName_; + 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(); + discoveryName_ = s; + return s; + } + } + /** + * + * + *
+   * The JSON schema name listed in the discovery document. Example:
+   * `Project`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_name = 3; + * + * @return The bytes for discoveryName. + */ + @java.lang.Override + public com.google.protobuf.ByteString getDiscoveryNameBytes() { + java.lang.Object ref = discoveryName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + discoveryName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_URL_FIELD_NUMBER = 4; + private volatile java.lang.Object resourceUrl_; + /** + * + * + *
+   * The REST URL for accessing the resource. An HTTP `GET` request using this
+   * URL returns the resource itself. Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+   * This value is unspecified for resources without a REST API.
+   * 
+ * + * string resource_url = 4; + * + * @return The resourceUrl. + */ + @java.lang.Override + public java.lang.String getResourceUrl() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUrl_ = s; + return s; + } + } + /** + * + * + *
+   * The REST URL for accessing the resource. An HTTP `GET` request using this
+   * URL returns the resource itself. Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+   * This value is unspecified for resources without a REST API.
+   * 
+ * + * string resource_url = 4; + * + * @return The bytes for resourceUrl. + */ + @java.lang.Override + public com.google.protobuf.ByteString getResourceUrlBytes() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PARENT_FIELD_NUMBER = 5; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * The full name of the immediate parent of this resource. See
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * For Google Cloud assets, this value is the parent resource defined in the
+   * [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * Example:
+   * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+   * For third-party assets, this field may be set differently.
+   * 
+ * + * string parent = 5; + * + * @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; + } + } + /** + * + * + *
+   * The full name of the immediate parent of this resource. See
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * For Google Cloud assets, this value is the parent resource defined in the
+   * [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * Example:
+   * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+   * For third-party assets, this field may be set differently.
+   * 
+ * + * string parent = 5; + * + * @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 DATA_FIELD_NUMBER = 6; + private com.google.protobuf.Struct data_; + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are removed
+   * and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + * + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return data_ != null; + } + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are removed
+   * and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + * + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.Struct getData() { + return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; + } + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are removed
+   * and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDataOrBuilder() { + return getData(); + } + + public static final int LOCATION_FIELD_NUMBER = 8; + private volatile java.lang.Object location_; + /** + * + * + *
+   * The location of the resource in Google Cloud, such as its zone and region.
+   * For more information, see https://cloud.google.com/about/locations/.
+   * 
+ * + * string location = 8; + * + * @return The location. + */ + @java.lang.Override + public java.lang.String getLocation() { + java.lang.Object ref = location_; + 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(); + location_ = s; + return s; + } + } + /** + * + * + *
+   * The location of the resource in Google Cloud, such as its zone and region.
+   * For more information, see https://cloud.google.com/about/locations/.
+   * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + @java.lang.Override + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = 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 (!getVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, version_); + } + if (!getDiscoveryDocumentUriBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, discoveryDocumentUri_); + } + if (!getDiscoveryNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, discoveryName_); + } + if (!getResourceUrlBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, resourceUrl_); + } + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, parent_); + } + if (data_ != null) { + output.writeMessage(6, getData()); + } + if (!getLocationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, location_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, version_); + } + if (!getDiscoveryDocumentUriBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, discoveryDocumentUri_); + } + if (!getDiscoveryNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, discoveryName_); + } + if (!getResourceUrlBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, resourceUrl_); + } + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, parent_); + } + if (data_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getData()); + } + if (!getLocationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, location_); + } + 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.asset.v1p7beta1.Resource)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p7beta1.Resource other = + (com.google.cloud.asset.v1p7beta1.Resource) obj; + + if (!getVersion().equals(other.getVersion())) return false; + if (!getDiscoveryDocumentUri().equals(other.getDiscoveryDocumentUri())) return false; + if (!getDiscoveryName().equals(other.getDiscoveryName())) return false; + if (!getResourceUrl().equals(other.getResourceUrl())) return false; + if (!getParent().equals(other.getParent())) return false; + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData().equals(other.getData())) return false; + } + if (!getLocation().equals(other.getLocation())) 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) + VERSION_FIELD_NUMBER; + hash = (53 * hash) + getVersion().hashCode(); + hash = (37 * hash) + DISCOVERY_DOCUMENT_URI_FIELD_NUMBER; + hash = (53 * hash) + getDiscoveryDocumentUri().hashCode(); + hash = (37 * hash) + DISCOVERY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDiscoveryName().hashCode(); + hash = (37 * hash) + RESOURCE_URL_FIELD_NUMBER; + hash = (53 * hash) + getResourceUrl().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (37 * hash) + LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getLocation().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p7beta1.Resource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.Resource 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.asset.v1p7beta1.Resource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.Resource 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.asset.v1p7beta1.Resource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p7beta1.Resource parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p7beta1.Resource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.Resource 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.asset.v1p7beta1.Resource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.Resource 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.asset.v1p7beta1.Resource parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p7beta1.Resource 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.asset.v1p7beta1.Resource 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 representation of a Google Cloud resource.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p7beta1.Resource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p7beta1.Resource) + com.google.cloud.asset.v1p7beta1.ResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p7beta1.Resource.class, + com.google.cloud.asset.v1p7beta1.Resource.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p7beta1.Resource.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(); + version_ = ""; + + discoveryDocumentUri_ = ""; + + discoveryName_ = ""; + + resourceUrl_ = ""; + + parent_ = ""; + + if (dataBuilder_ == null) { + data_ = null; + } else { + data_ = null; + dataBuilder_ = null; + } + location_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p7beta1.AssetProto + .internal_static_google_cloud_asset_v1p7beta1_Resource_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Resource getDefaultInstanceForType() { + return com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Resource build() { + com.google.cloud.asset.v1p7beta1.Resource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p7beta1.Resource buildPartial() { + com.google.cloud.asset.v1p7beta1.Resource result = + new com.google.cloud.asset.v1p7beta1.Resource(this); + result.version_ = version_; + result.discoveryDocumentUri_ = discoveryDocumentUri_; + result.discoveryName_ = discoveryName_; + result.resourceUrl_ = resourceUrl_; + result.parent_ = parent_; + if (dataBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = dataBuilder_.build(); + } + result.location_ = location_; + 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.asset.v1p7beta1.Resource) { + return mergeFrom((com.google.cloud.asset.v1p7beta1.Resource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p7beta1.Resource other) { + if (other == com.google.cloud.asset.v1p7beta1.Resource.getDefaultInstance()) return this; + if (!other.getVersion().isEmpty()) { + version_ = other.version_; + onChanged(); + } + if (!other.getDiscoveryDocumentUri().isEmpty()) { + discoveryDocumentUri_ = other.discoveryDocumentUri_; + onChanged(); + } + if (!other.getDiscoveryName().isEmpty()) { + discoveryName_ = other.discoveryName_; + onChanged(); + } + if (!other.getResourceUrl().isEmpty()) { + resourceUrl_ = other.resourceUrl_; + onChanged(); + } + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasData()) { + mergeData(other.getData()); + } + if (!other.getLocation().isEmpty()) { + location_ = other.location_; + 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.asset.v1p7beta1.Resource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p7beta1.Resource) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object version_ = ""; + /** + * + * + *
+     * The API version. Example: `v1`
+     * 
+ * + * string version = 1; + * + * @return The version. + */ + public java.lang.String getVersion() { + java.lang.Object ref = version_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + version_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The API version. Example: `v1`
+     * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + public com.google.protobuf.ByteString getVersionBytes() { + java.lang.Object ref = version_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + version_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The API version. Example: `v1`
+     * 
+ * + * string version = 1; + * + * @param value The version to set. + * @return This builder for chaining. + */ + public Builder setVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + version_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The API version. Example: `v1`
+     * 
+ * + * string version = 1; + * + * @return This builder for chaining. + */ + public Builder clearVersion() { + + version_ = getDefaultInstance().getVersion(); + onChanged(); + return this; + } + /** + * + * + *
+     * The API version. Example: `v1`
+     * 
+ * + * string version = 1; + * + * @param value The bytes for version to set. + * @return This builder for chaining. + */ + public Builder setVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + version_ = value; + onChanged(); + return this; + } + + private java.lang.Object discoveryDocumentUri_ = ""; + /** + * + * + *
+     * The URL of the discovery document containing the resource's JSON schema.
+     * Example:
+     * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_document_uri = 2; + * + * @return The discoveryDocumentUri. + */ + public java.lang.String getDiscoveryDocumentUri() { + java.lang.Object ref = discoveryDocumentUri_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + discoveryDocumentUri_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The URL of the discovery document containing the resource's JSON schema.
+     * Example:
+     * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_document_uri = 2; + * + * @return The bytes for discoveryDocumentUri. + */ + public com.google.protobuf.ByteString getDiscoveryDocumentUriBytes() { + java.lang.Object ref = discoveryDocumentUri_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + discoveryDocumentUri_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The URL of the discovery document containing the resource's JSON schema.
+     * Example:
+     * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_document_uri = 2; + * + * @param value The discoveryDocumentUri to set. + * @return This builder for chaining. + */ + public Builder setDiscoveryDocumentUri(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + discoveryDocumentUri_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The URL of the discovery document containing the resource's JSON schema.
+     * Example:
+     * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_document_uri = 2; + * + * @return This builder for chaining. + */ + public Builder clearDiscoveryDocumentUri() { + + discoveryDocumentUri_ = getDefaultInstance().getDiscoveryDocumentUri(); + onChanged(); + return this; + } + /** + * + * + *
+     * The URL of the discovery document containing the resource's JSON schema.
+     * Example:
+     * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_document_uri = 2; + * + * @param value The bytes for discoveryDocumentUri to set. + * @return This builder for chaining. + */ + public Builder setDiscoveryDocumentUriBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + discoveryDocumentUri_ = value; + onChanged(); + return this; + } + + private java.lang.Object discoveryName_ = ""; + /** + * + * + *
+     * The JSON schema name listed in the discovery document. Example:
+     * `Project`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_name = 3; + * + * @return The discoveryName. + */ + public java.lang.String getDiscoveryName() { + java.lang.Object ref = discoveryName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + discoveryName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The JSON schema name listed in the discovery document. Example:
+     * `Project`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_name = 3; + * + * @return The bytes for discoveryName. + */ + public com.google.protobuf.ByteString getDiscoveryNameBytes() { + java.lang.Object ref = discoveryName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + discoveryName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The JSON schema name listed in the discovery document. Example:
+     * `Project`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_name = 3; + * + * @param value The discoveryName to set. + * @return This builder for chaining. + */ + public Builder setDiscoveryName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + discoveryName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The JSON schema name listed in the discovery document. Example:
+     * `Project`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_name = 3; + * + * @return This builder for chaining. + */ + public Builder clearDiscoveryName() { + + discoveryName_ = getDefaultInstance().getDiscoveryName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The JSON schema name listed in the discovery document. Example:
+     * `Project`
+     * This value is unspecified for resources that do not have an API based on a
+     * discovery document, such as Cloud Bigtable.
+     * 
+ * + * string discovery_name = 3; + * + * @param value The bytes for discoveryName to set. + * @return This builder for chaining. + */ + public Builder setDiscoveryNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + discoveryName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceUrl_ = ""; + /** + * + * + *
+     * The REST URL for accessing the resource. An HTTP `GET` request using this
+     * URL returns the resource itself. Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+     * This value is unspecified for resources without a REST API.
+     * 
+ * + * string resource_url = 4; + * + * @return The resourceUrl. + */ + public java.lang.String getResourceUrl() { + java.lang.Object ref = resourceUrl_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceUrl_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The REST URL for accessing the resource. An HTTP `GET` request using this
+     * URL returns the resource itself. Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+     * This value is unspecified for resources without a REST API.
+     * 
+ * + * string resource_url = 4; + * + * @return The bytes for resourceUrl. + */ + public com.google.protobuf.ByteString getResourceUrlBytes() { + java.lang.Object ref = resourceUrl_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + resourceUrl_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The REST URL for accessing the resource. An HTTP `GET` request using this
+     * URL returns the resource itself. Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+     * This value is unspecified for resources without a REST API.
+     * 
+ * + * string resource_url = 4; + * + * @param value The resourceUrl to set. + * @return This builder for chaining. + */ + public Builder setResourceUrl(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceUrl_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The REST URL for accessing the resource. An HTTP `GET` request using this
+     * URL returns the resource itself. Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+     * This value is unspecified for resources without a REST API.
+     * 
+ * + * string resource_url = 4; + * + * @return This builder for chaining. + */ + public Builder clearResourceUrl() { + + resourceUrl_ = getDefaultInstance().getResourceUrl(); + onChanged(); + return this; + } + /** + * + * + *
+     * The REST URL for accessing the resource. An HTTP `GET` request using this
+     * URL returns the resource itself. Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+     * This value is unspecified for resources without a REST API.
+     * 
+ * + * string resource_url = 4; + * + * @param value The bytes for resourceUrl to set. + * @return This builder for chaining. + */ + public Builder setResourceUrlBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceUrl_ = value; + onChanged(); + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * The full name of the immediate parent of this resource. See
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * For Google Cloud assets, this value is the parent resource defined in the
+     * [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * Example:
+     * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+     * For third-party assets, this field may be set differently.
+     * 
+ * + * string parent = 5; + * + * @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; + } + } + /** + * + * + *
+     * The full name of the immediate parent of this resource. See
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * For Google Cloud assets, this value is the parent resource defined in the
+     * [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * Example:
+     * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+     * For third-party assets, this field may be set differently.
+     * 
+ * + * string parent = 5; + * + * @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; + } + } + /** + * + * + *
+     * The full name of the immediate parent of this resource. See
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * For Google Cloud assets, this value is the parent resource defined in the
+     * [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * Example:
+     * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+     * For third-party assets, this field may be set differently.
+     * 
+ * + * string parent = 5; + * + * @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; + } + /** + * + * + *
+     * The full name of the immediate parent of this resource. See
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * For Google Cloud assets, this value is the parent resource defined in the
+     * [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * Example:
+     * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+     * For third-party assets, this field may be set differently.
+     * 
+ * + * string parent = 5; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * The full name of the immediate parent of this resource. See
+     * [Resource
+     * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+     * for more information.
+     * For Google Cloud assets, this value is the parent resource defined in the
+     * [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * Example:
+     * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+     * For third-party assets, this field may be set differently.
+     * 
+ * + * string parent = 5; + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Struct data_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + dataBuilder_; + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + * + * @return Whether the data field is set. + */ + public boolean hasData() { + return dataBuilder_ != null || data_ != null; + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + * + * @return The data. + */ + public com.google.protobuf.Struct getData() { + if (dataBuilder_ == null) { + return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + public Builder setData(com.google.protobuf.Struct value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + public Builder setData(com.google.protobuf.Struct.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + public Builder mergeData(com.google.protobuf.Struct value) { + if (dataBuilder_ == null) { + if (data_ != null) { + data_ = com.google.protobuf.Struct.newBuilder(data_).mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + dataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + data_ = null; + onChanged(); + } else { + data_ = null; + dataBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + public com.google.protobuf.Struct.Builder getDataBuilder() { + + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + public com.google.protobuf.StructOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? com.google.protobuf.Struct.getDefaultInstance() : data_; + } + } + /** + * + * + *
+     * The content of the resource, in which some sensitive fields are removed
+     * and may not be present.
+     * 
+ * + * .google.protobuf.Struct data = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Struct, + com.google.protobuf.Struct.Builder, + com.google.protobuf.StructOrBuilder>(getData(), getParentForChildren(), isClean()); + data_ = null; + } + return dataBuilder_; + } + + private java.lang.Object location_ = ""; + /** + * + * + *
+     * The location of the resource in Google Cloud, such as its zone and region.
+     * For more information, see https://cloud.google.com/about/locations/.
+     * 
+ * + * string location = 8; + * + * @return The location. + */ + public java.lang.String getLocation() { + java.lang.Object ref = location_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + location_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The location of the resource in Google Cloud, such as its zone and region.
+     * For more information, see https://cloud.google.com/about/locations/.
+     * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + public com.google.protobuf.ByteString getLocationBytes() { + java.lang.Object ref = location_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + location_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The location of the resource in Google Cloud, such as its zone and region.
+     * For more information, see https://cloud.google.com/about/locations/.
+     * 
+ * + * string location = 8; + * + * @param value The location to set. + * @return This builder for chaining. + */ + public Builder setLocation(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + location_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the resource in Google Cloud, such as its zone and region.
+     * For more information, see https://cloud.google.com/about/locations/.
+     * 
+ * + * string location = 8; + * + * @return This builder for chaining. + */ + public Builder clearLocation() { + + location_ = getDefaultInstance().getLocation(); + onChanged(); + return this; + } + /** + * + * + *
+     * The location of the resource in Google Cloud, such as its zone and region.
+     * For more information, see https://cloud.google.com/about/locations/.
+     * 
+ * + * string location = 8; + * + * @param value The bytes for location to set. + * @return This builder for chaining. + */ + public Builder setLocationBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + location_ = 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.asset.v1p7beta1.Resource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p7beta1.Resource) + private static final com.google.cloud.asset.v1p7beta1.Resource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p7beta1.Resource(); + } + + public static com.google.cloud.asset.v1p7beta1.Resource getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Resource parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Resource(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.asset.v1p7beta1.Resource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ResourceOrBuilder.java b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ResourceOrBuilder.java new file mode 100644 index 000000000..d6250c22f --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/java/com/google/cloud/asset/v1p7beta1/ResourceOrBuilder.java @@ -0,0 +1,253 @@ +/* + * 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/asset/v1p7beta1/assets.proto + +package com.google.cloud.asset.v1p7beta1; + +public interface ResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p7beta1.Resource) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The API version. Example: `v1`
+   * 
+ * + * string version = 1; + * + * @return The version. + */ + java.lang.String getVersion(); + /** + * + * + *
+   * The API version. Example: `v1`
+   * 
+ * + * string version = 1; + * + * @return The bytes for version. + */ + com.google.protobuf.ByteString getVersionBytes(); + + /** + * + * + *
+   * The URL of the discovery document containing the resource's JSON schema.
+   * Example:
+   * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_document_uri = 2; + * + * @return The discoveryDocumentUri. + */ + java.lang.String getDiscoveryDocumentUri(); + /** + * + * + *
+   * The URL of the discovery document containing the resource's JSON schema.
+   * Example:
+   * `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_document_uri = 2; + * + * @return The bytes for discoveryDocumentUri. + */ + com.google.protobuf.ByteString getDiscoveryDocumentUriBytes(); + + /** + * + * + *
+   * The JSON schema name listed in the discovery document. Example:
+   * `Project`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_name = 3; + * + * @return The discoveryName. + */ + java.lang.String getDiscoveryName(); + /** + * + * + *
+   * The JSON schema name listed in the discovery document. Example:
+   * `Project`
+   * This value is unspecified for resources that do not have an API based on a
+   * discovery document, such as Cloud Bigtable.
+   * 
+ * + * string discovery_name = 3; + * + * @return The bytes for discoveryName. + */ + com.google.protobuf.ByteString getDiscoveryNameBytes(); + + /** + * + * + *
+   * The REST URL for accessing the resource. An HTTP `GET` request using this
+   * URL returns the resource itself. Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+   * This value is unspecified for resources without a REST API.
+   * 
+ * + * string resource_url = 4; + * + * @return The resourceUrl. + */ + java.lang.String getResourceUrl(); + /** + * + * + *
+   * The REST URL for accessing the resource. An HTTP `GET` request using this
+   * URL returns the resource itself. Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`
+   * This value is unspecified for resources without a REST API.
+   * 
+ * + * string resource_url = 4; + * + * @return The bytes for resourceUrl. + */ + com.google.protobuf.ByteString getResourceUrlBytes(); + + /** + * + * + *
+   * The full name of the immediate parent of this resource. See
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * For Google Cloud assets, this value is the parent resource defined in the
+   * [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * Example:
+   * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+   * For third-party assets, this field may be set differently.
+   * 
+ * + * string parent = 5; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * The full name of the immediate parent of this resource. See
+   * [Resource
+   * Names](https://cloud.google.com/apis/design/resource_names#full_resource_name)
+   * for more information.
+   * For Google Cloud assets, this value is the parent resource defined in the
+   * [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * Example:
+   * `//cloudresourcemanager.googleapis.com/projects/my_project_123`
+   * For third-party assets, this field may be set differently.
+   * 
+ * + * string parent = 5; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are removed
+   * and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + * + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are removed
+   * and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + * + * @return The data. + */ + com.google.protobuf.Struct getData(); + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are removed
+   * and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + */ + com.google.protobuf.StructOrBuilder getDataOrBuilder(); + + /** + * + * + *
+   * The location of the resource in Google Cloud, such as its zone and region.
+   * For more information, see https://cloud.google.com/about/locations/.
+   * 
+ * + * string location = 8; + * + * @return The location. + */ + java.lang.String getLocation(); + /** + * + * + *
+   * The location of the resource in Google Cloud, such as its zone and region.
+   * For more information, see https://cloud.google.com/about/locations/.
+   * 
+ * + * string location = 8; + * + * @return The bytes for location. + */ + com.google.protobuf.ByteString getLocationBytes(); +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/asset_service.proto b/proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/asset_service.proto new file mode 100644 index 000000000..e9d7805d4 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/asset_service.proto @@ -0,0 +1,315 @@ +// 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.asset.v1p7beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/asset/v1p7beta1/assets.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P7Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p7beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p7beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p7beta1"; + +// Asset service definition. +service AssetService { + option (google.api.default_host) = "cloudasset.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Exports assets with time and resource types to a given Cloud Storage + // location/BigQuery table. For Cloud Storage location destinations, the + // output format is newline-delimited JSON. Each line represents a + // [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in + // the JSON format; for BigQuery table destinations, the output table stores + // the fields in asset proto as columns. This API implements the + // [google.longrunning.Operation][google.longrunning.Operation] API , which + // allows you to keep track of the export. We recommend intervals of at least + // 2 seconds with exponential retry to poll the export operation result. For + // regular-size resource parent, the export operation usually finishes within + // 5 minutes. + rpc ExportAssets(ExportAssetsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1p7beta1/{parent=*/*}:exportAssets" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "google.cloud.asset.v1p7beta1.ExportAssetsResponse" + metadata_type: "google.cloud.asset.v1p7beta1.ExportAssetsRequest" + }; + } +} + +// Export asset request. +message ExportAssetsRequest { + // Required. The relative name of the root asset. This can only be an + // organization number (such as "organizations/123"), a project ID (such as + // "projects/my-project-id"), or a project number (such as "projects/12345"), + // or a folder number (such as "folders/123"). + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "cloudasset.googleapis.com/Asset" + } + ]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between the current time and the current time minus 35 days (inclusive). + // If not specified, the current time will be used. Due to delays in resource + // data collection and indexing, there is a volatile window during which + // running the same query may get different results. + google.protobuf.Timestamp read_time = 2; + + // A list of asset types to take a snapshot for. For example: + // "compute.googleapis.com/Disk". + // + // Regular expressions are also supported. For example: + // + // * "compute.googleapis.com.*" snapshots resources whose asset type starts + // with "compute.googleapis.com". + // * ".*Instance" snapshots resources whose asset type ends with "Instance". + // * ".*Instance.*" snapshots resources whose asset type contains "Instance". + // + // See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported + // regular expression syntax. If the regular expression does not match any + // supported asset type, an INVALID_ARGUMENT error will be returned. + // + // If specified, only matching assets will be returned, otherwise, it will + // snapshot all asset types. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) + // for all supported asset types. + repeated string asset_types = 3; + + // Asset content type. If not specified, no content but the asset name will be + // returned. + ContentType content_type = 4; + + // Required. Output configuration indicating where the results will be output + // to. + OutputConfig output_config = 5 [(google.api.field_behavior) = REQUIRED]; + + // A list of relationship types to export, for example: + // `INSTANCE_TO_INSTANCEGROUP`. This field should only be specified if + // content_type=RELATIONSHIP. If specified, it will snapshot [asset_types]' + // specified relationships, or give errors if any relationship_types' + // supported types are not in [asset_types]. If not specified, it will + // snapshot all [asset_types]' supported relationships. An unspecified + // [asset_types] field means all supported asset_types. See [Introduction to + // Cloud Asset + // Inventory](https://cloud.google.com/asset-inventory/docs/overview) for all + // supported asset types and relationship types. + repeated string relationship_types = 6; +} + +// The export asset response. This message is returned by the +// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] +// method in the returned +// [google.longrunning.Operation.response][google.longrunning.Operation.response] +// field. +message ExportAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Output configuration indicating where the results were output to. + OutputConfig output_config = 2; + + // Output result indicating where the assets were exported to. For example, a + // set of actual Google Cloud Storage object uris where the assets are + // exported to. The uris can be different from what [output_config] has + // specified, as the service will split the output object into multiple ones + // once it exceeds a single Google Cloud Storage object limit. + OutputResult output_result = 3; +} + +// Output configuration for export assets destination. +message OutputConfig { + // Asset export destination. + oneof destination { + // Destination on Cloud Storage. + GcsDestination gcs_destination = 1; + + // Destination on BigQuery. The output table stores the fields in asset + // proto as columns in BigQuery. + BigQueryDestination bigquery_destination = 2; + } +} + +// Output result of export assets. +message OutputResult { + // Asset export result. + oneof result { + // Export result on Cloud Storage. + GcsOutputResult gcs_result = 1; + } +} + +// A Cloud Storage output result. +message GcsOutputResult { + // List of uris of the Cloud Storage objects. Example: + // "gs://bucket_name/object_name". + repeated string uris = 1; +} + +// A Cloud Storage location. +message GcsDestination { + // Required. + oneof object_uri { + // The uri of the Cloud Storage object. It's the same uri that is used by + // gsutil. Example: "gs://bucket_name/object_name". See [Viewing and + // Editing Object + // Metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata) + // for more information. + string uri = 1; + + // The uri prefix of all generated Cloud Storage objects. Example: + // "gs://bucket_name/object_name_prefix". Each object uri is in format: + // "gs://bucket_name/object_name_prefix/{ASSET_TYPE}/{SHARD_NUMBER} and only + // contains assets for that type. starts from 0. Example: + // "gs://bucket_name/object_name_prefix/compute.googleapis.com/Disk/0" is + // the first shard of output objects containing all + // compute.googleapis.com/Disk assets. An INVALID_ARGUMENT error will be + // returned if file with the same name "gs://bucket_name/object_name_prefix" + // already exists. + string uri_prefix = 2; + } +} + +// A BigQuery destination for exporting assets to. +message BigQueryDestination { + // Required. The BigQuery dataset in format + // "projects/projectId/datasets/datasetId", to which the snapshot result + // should be exported. If this dataset does not exist, the export call returns + // an INVALID_ARGUMENT error. + string dataset = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The BigQuery table to which the snapshot result should be + // written. If this table does not exist, a new table with the given name + // will be created. + string table = 2 [(google.api.field_behavior) = REQUIRED]; + + // If the destination table already exists and this flag is `TRUE`, the + // table will be overwritten by the contents of assets snapshot. If the flag + // is `FALSE` or unset and the destination table already exists, the export + // call returns an INVALID_ARGUMEMT error. + bool force = 3; + + // [partition_spec] determines whether to export to partitioned table(s) and + // how to partition the data. + // + // If [partition_spec] is unset or [partition_spec.partition_key] is unset or + // `PARTITION_KEY_UNSPECIFIED`, the snapshot results will be exported to + // non-partitioned table(s). [force] will decide whether to overwrite existing + // table(s). + // + // If [partition_spec] is specified. First, the snapshot results will be + // written to partitioned table(s) with two additional timestamp columns, + // readTime and requestTime, one of which will be the partition key. Secondly, + // in the case when any destination table already exists, it will first try to + // update existing table's schema as necessary by appending additional + // columns. Then, if [force] is `TRUE`, the corresponding partition will be + // overwritten by the snapshot results (data in different partitions will + // remain intact); if [force] is unset or `FALSE`, it will append the data. An + // error will be returned if the schema update or data appension fails. + PartitionSpec partition_spec = 4; + + // If this flag is `TRUE`, the snapshot results will be written to one or + // multiple tables, each of which contains results of one asset type. The + // [force] and [partition_spec] fields will apply to each of them. + // + // Field [table] will be concatenated with "_" and the asset type names (see + // https://cloud.google.com/asset-inventory/docs/supported-asset-types for + // supported asset types) to construct per-asset-type table names, in which + // all non-alphanumeric characters like "." and "/" will be substituted by + // "_". Example: if field [table] is "mytable" and snapshot results + // contain "storage.googleapis.com/Bucket" assets, the corresponding table + // name will be "mytable_storage_googleapis_com_Bucket". If any of these + // tables does not exist, a new table with the concatenated name will be + // created. + // + // When [content_type] in the ExportAssetsRequest is `RESOURCE`, the schema of + // each table will include RECORD-type columns mapped to the nested fields in + // the Asset.resource.data field of that asset type (up to the 15 nested level + // BigQuery supports + // (https://cloud.google.com/bigquery/docs/nested-repeated#limitations)). The + // fields in >15 nested levels will be stored in JSON format string as a child + // column of its parent RECORD column. + // + // If error occurs when exporting to any table, the whole export call will + // return an error but the export results that already succeed will persist. + // Example: if exporting to table_type_A succeeds when exporting to + // table_type_B fails during one export call, the results in table_type_A will + // persist and there will not be partial results persisting in a table. + bool separate_tables_per_asset_type = 5; +} + +// Specifications of BigQuery partitioned table as export destination. +message PartitionSpec { + // This enum is used to determine the partition key column when exporting + // assets to BigQuery partitioned table(s). Note that, if the partition key is + // a timestamp column, the actual partition is based on its date value + // (expressed in UTC. see details in + // https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables). + enum PartitionKey { + // Unspecified partition key. If used, it means using non-partitioned table. + PARTITION_KEY_UNSPECIFIED = 0; + + // The time when the snapshot is taken. If specified as partition key, the + // result table(s) is partitoned by the additional timestamp column, + // readTime. If [read_time] in ExportAssetsRequest is specified, the + // readTime column's value will be the same as it. Otherwise, its value will + // be the current time that is used to take the snapshot. + READ_TIME = 1; + + // The time when the request is received and started to be processed. If + // specified as partition key, the result table(s) is partitoned by the + // requestTime column, an additional timestamp column representing when the + // request was received. + REQUEST_TIME = 2; + } + + // The partition key for BigQuery partitioned table. + PartitionKey partition_key = 1; +} + +// Asset content type. +enum ContentType { + // Unspecified content type. + CONTENT_TYPE_UNSPECIFIED = 0; + + // Resource metadata. + RESOURCE = 1; + + // The actual IAM policy set on a resource. + IAM_POLICY = 2; + + // The Cloud Organization Policy set on an asset. + ORG_POLICY = 4; + + // The Cloud Access context manager Policy set on an asset. + ACCESS_POLICY = 5; + + // The related resources. + RELATIONSHIP = 7; +} diff --git a/proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/assets.proto b/proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/assets.proto new file mode 100644 index 000000000..506bbea22 --- /dev/null +++ b/proto-google-cloud-asset-v1p7beta1/src/main/proto/google/cloud/asset/v1p7beta1/assets.proto @@ -0,0 +1,235 @@ +// 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.asset.v1p7beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.proto"; +import "google/cloud/osconfig/v1/inventory.proto"; +import "google/iam/v1/policy.proto"; +import "google/identity/accesscontextmanager/v1/access_level.proto"; +import "google/identity/accesscontextmanager/v1/access_policy.proto"; +import "google/identity/accesscontextmanager/v1/service_perimeter.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Asset.V1P7Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p7beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p7beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p7beta1"; + +// The Cloud Asset API. + +// An asset in Google Cloud. An asset can be any resource in the Google Cloud +// [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The last update timestamp of an asset. update_time is updated when + // create/update/delete operation is performed. + google.protobuf.Timestamp update_time = 11; + + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string name = 1; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // A representation of the resource. + Resource resource = 3; + + // A representation of the Cloud IAM policy set on a Google Cloud resource. + // There can be a maximum of one Cloud IAM policy set on any given resource. + // In addition, Cloud IAM policies inherit their granted access scope from any + // policies set on parent resources in the resource hierarchy. Therefore, the + // effectively policy is the union of both the policy set on this resource + // and each policy set on all of the resource's ancestry resource levels in + // the hierarchy. See + // [this topic](https://cloud.google.com/iam/docs/policies#inheritance) for + // more information. + google.iam.v1.Policy iam_policy = 4; + + // A representation of an [organization + // policy](https://cloud.google.com/resource-manager/docs/organization-policy/overview#organization_policy). + // There can be more than one organization policy with different constraints + // set on a given resource. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // A representation of an [access + // policy](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + oneof access_context_policy { + // Please also refer to the [access policy user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-policies). + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + // Please also refer to the [access level user + // guide](https://cloud.google.com/access-context-manager/docs/overview#access-levels). + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + // Please also refer to the [service perimeter user + // guide](https://cloud.google.com/vpc-service-controls/docs/overview). + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // The related assets of the asset of one relationship type. + // One asset only represents one type of relationship. + RelatedAssets related_assets = 13; + + // The ancestry path of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. If the asset + // is a project, folder, or organization, the ancestry path starts from the + // asset itself. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 10; +} + +// A representation of a Google Cloud resource. +message Resource { + // The API version. Example: `v1` + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // Example: + // `https://www.googleapis.com/discovery/v1/apis/compute/v1/rest` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. Example: + // `Project` + // + // This value is unspecified for resources that do not have an API based on a + // discovery document, such as Cloud Bigtable. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP `GET` request using this + // URL returns the resource itself. Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123` + // + // This value is unspecified for resources without a REST API. + string resource_url = 4; + + // The full name of the immediate parent of this resource. See + // [Resource + // Names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + // + // For Google Cloud assets, this value is the parent resource defined in the + // [Cloud IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // Example: + // `//cloudresourcemanager.googleapis.com/projects/my_project_123` + // + // For third-party assets, this field may be set differently. + string parent = 5; + + // The content of the resource, in which some sensitive fields are removed + // and may not be present. + google.protobuf.Struct data = 6; + + // The location of the resource in Google Cloud, such as its zone and region. + // For more information, see https://cloud.google.com/about/locations/. + string location = 8; +} + +// The detailed related assets with the `relationship_type`. +message RelatedAssets { + // The detailed relation attributes. + RelationshipAttributes relationship_attributes = 1; + + // The peer resources of the relationship. + repeated RelatedAsset assets = 2; +} + +// The relationship attributes which include `type`, `source_resource_type`, +// `target_resource_type` and `action`. +message RelationshipAttributes { + // The unique identifier of the relationship type. Example: + // `INSTANCE_TO_INSTANCEGROUP` + string type = 4; + + // The source asset type. Example: `compute.googleapis.com/Instance` + string source_resource_type = 1; + + // The target asset type. Example: `compute.googleapis.com/Disk` + string target_resource_type = 2; + + // The detail of the relationship, e.g. `contains`, `attaches` + string action = 3; +} + +// An asset identify in Google Cloud which contains its name, type and +// ancestors. An asset can be any resource in the Google Cloud [resource +// hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), +// a resource outside the Google Cloud resource hierarchy (such as Google +// Kubernetes Engine clusters and objects), or a policy (e.g. Cloud IAM policy). +// See [Supported asset +// types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) +// for more information. +message RelatedAsset { + // The full name of the asset. Example: + // `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1` + // + // See [Resource + // names](https://cloud.google.com/apis/design/resource_names#full_resource_name) + // for more information. + string asset = 1 [(google.api.resource_reference) = { + type: "cloudasset.googleapis.com/Asset" + }]; + + // The type of the asset. Example: `compute.googleapis.com/Disk` + // + // See [Supported asset + // types](https://cloud.google.com/asset-inventory/docs/supported-asset-types) + // for more information. + string asset_type = 2; + + // The ancestors of an asset in Google Cloud [resource + // hierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy), + // represented as a list of relative resource names. An ancestry path starts + // with the closest ancestor in the hierarchy and ends at root. + // + // Example: `["projects/123456789", "folders/5432", "organizations/1234"]` + repeated string ancestors = 3; +} diff --git a/samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java b/samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java index 9963abeb5..e244bfe76 100644 --- a/samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java +++ b/samples/snippets/src/main/java/com/example/asset/BatchGetAssetsHistoryExample.java @@ -42,12 +42,13 @@ public static void main(String... args) throws Exception { ProjectName parent = ProjectName.of(projectId); ContentType contentType = ContentType.CONTENT_TYPE_UNSPECIFIED; TimeWindow readTimeWindow = TimeWindow.newBuilder().build(); - BatchGetAssetsHistoryRequest request = BatchGetAssetsHistoryRequest.newBuilder() - .setParent(parent.toString()) - .addAllAssetNames(Arrays.asList(assetNames)) - .setContentType(contentType) - .setReadTimeWindow(readTimeWindow) - .build(); + BatchGetAssetsHistoryRequest request = + BatchGetAssetsHistoryRequest.newBuilder() + .setParent(parent.toString()) + .addAllAssetNames(Arrays.asList(assetNames)) + .setContentType(contentType) + .setReadTimeWindow(readTimeWindow) + .build(); BatchGetAssetsHistoryResponse response = client.batchGetAssetsHistory(request); System.out.println(response); } diff --git a/samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java b/samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java index fe99cc16e..fd66425de 100644 --- a/samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java +++ b/samples/snippets/src/main/java/com/example/asset/CreateFeedExample.java @@ -27,22 +27,26 @@ public class CreateFeedExample { // Create a feed - public static void createFeed( - String[] assetNames, String feedId, String topic, String projectId) throws Exception { + public static void createFeed(String[] assetNames, String feedId, String topic, String projectId) + throws Exception { // String[] assetNames = {"MY_ASSET_NAME"} // String FeedId = "MY_FEED_ID" // String topic = "projects/[PROJECT_ID]/topics/[TOPIC_NAME]" // String projectID = "MY_PROJECT_ID" - Feed feed = Feed.newBuilder() - .addAllAssetNames(Arrays.asList(assetNames)) - .setFeedOutputConfig( - FeedOutputConfig.newBuilder().setPubsubDestination( - PubsubDestination.newBuilder().setTopic(topic).build()).build()).build(); - CreateFeedRequest request = CreateFeedRequest.newBuilder() - .setParent(String.format(ProjectName.of(projectId).toString())) - .setFeedId(feedId) - .setFeed(feed) - .build(); + Feed feed = + Feed.newBuilder() + .addAllAssetNames(Arrays.asList(assetNames)) + .setFeedOutputConfig( + FeedOutputConfig.newBuilder() + .setPubsubDestination(PubsubDestination.newBuilder().setTopic(topic).build()) + .build()) + .build(); + CreateFeedRequest request = + CreateFeedRequest.newBuilder() + .setParent(String.format(ProjectName.of(projectId).toString())) + .setFeedId(feedId) + .setFeed(feed) + .build(); // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call // the "close" method on the client to safely clean up any remaining background resources. diff --git a/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java b/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java index b315aef72..b9de8b1fc 100644 --- a/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java +++ b/samples/snippets/src/main/java/com/example/asset/ListAssetsExample.java @@ -49,18 +49,18 @@ public static void listAssets(String projectId, String[] assetTypes, ContentType ProjectName parent = ProjectName.of(projectId); // Build initial ListAssetsRequest without setting page token. - ListAssetsRequest request = ListAssetsRequest.newBuilder() - .setParent(parent.toString()) - .addAllAssetTypes(Arrays.asList(assetTypes)) - .setContentType(contentType) - .build(); + ListAssetsRequest request = + ListAssetsRequest.newBuilder() + .setParent(parent.toString()) + .addAllAssetTypes(Arrays.asList(assetTypes)) + .setContentType(contentType) + .build(); // Repeatedly call ListAssets until page token is empty. ListAssetsPagedResponse response = client.listAssets(request); System.out.println(response); while (!response.getNextPageToken().isEmpty()) { - request = request.toBuilder() - .setPageToken(response.getNextPageToken()).build(); + request = request.toBuilder().setPageToken(response.getNextPageToken()).build(); response = client.listAssets(request); System.out.println(response); } diff --git a/samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java b/samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java index fa961008c..428965754 100644 --- a/samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java +++ b/samples/snippets/src/main/java/com/example/asset/SearchAllResourcesExample.java @@ -54,9 +54,9 @@ public static void searchAllResources(String scope, String query) { } catch (IOException e) { System.out.println(String.format("Failed to create client:%n%s", e.toString())); } catch (InvalidArgumentException e) { - System.out.println(String.format("Invalid request:%n%s", e.toString())); + System.out.println(String.format("Invalid request:%n%s", e.toString())); } catch (ApiException e) { - System.out.println(String.format("Error during SearchAllResources:%n%s", e.toString())); + System.out.println(String.format("Error during SearchAllResources:%n%s", e.toString())); } } } diff --git a/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java b/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java index d3e651723..1719d5a15 100644 --- a/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java +++ b/samples/snippets/src/main/java/com/example/asset/UpdateFeedExample.java @@ -30,16 +30,22 @@ public class UpdateFeedExample { public static void updateFeed(String feedName, String topic) throws Exception { // String feedName = "MY_FEED_NAME" // String topic = "projects/[PROJECT_ID]/topics/[TOPIC_NAME]" - Feed feed = Feed.newBuilder() - .setName(feedName) - .setFeedOutputConfig( - FeedOutputConfig.newBuilder().setPubsubDestination( - PubsubDestination.newBuilder().setTopic(topic).build()).build()).build(); - UpdateFeedRequest request = UpdateFeedRequest.newBuilder() - .setFeed(feed) - .setUpdateMask( - FieldMask.newBuilder().addPaths("feed_output_config.pubsub_destination.topic").build()) - .build(); + Feed feed = + Feed.newBuilder() + .setName(feedName) + .setFeedOutputConfig( + FeedOutputConfig.newBuilder() + .setPubsubDestination(PubsubDestination.newBuilder().setTopic(topic).build()) + .build()) + .build(); + UpdateFeedRequest request = + UpdateFeedRequest.newBuilder() + .setFeed(feed) + .setUpdateMask( + FieldMask.newBuilder() + .addPaths("feed_output_config.pubsub_destination.topic") + .build()) + .build(); // Initialize client that will be used to send requests. This client only needs to be created // once, and can be reused for multiple requests. After completing all of your requests, call // the "close" method on the client to safely clean up any remaining background resources. diff --git a/synth.metadata b/synth.metadata index c43ac7319..4404abcf0 100644 --- a/synth.metadata +++ b/synth.metadata @@ -3,55 +3,63 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/java-asset.git", - "sha": "22ae64211f53312f1dff43aa49fe41dc419b0eeb" + "remote": "git@github.com:googleapis/java-asset.git", + "sha": "5036a1172fc6910ba820cf1f29a1f359048cf06d" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "de04592991247b9b617d06d4ec68f7e90adf2b81", - "internalRef": "375731640" + "sha": "1c20dcfd8052a2bea026bda36875e5b7606028db", + "internalRef": "376207067" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "de04592991247b9b617d06d4ec68f7e90adf2b81", - "internalRef": "375731640" + "sha": "1c20dcfd8052a2bea026bda36875e5b7606028db", + "internalRef": "376207067" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "de04592991247b9b617d06d4ec68f7e90adf2b81", - "internalRef": "375731640" + "sha": "1c20dcfd8052a2bea026bda36875e5b7606028db", + "internalRef": "376207067" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "de04592991247b9b617d06d4ec68f7e90adf2b81", - "internalRef": "375731640" + "sha": "1c20dcfd8052a2bea026bda36875e5b7606028db", + "internalRef": "376207067" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "de04592991247b9b617d06d4ec68f7e90adf2b81", - "internalRef": "375731640" + "sha": "1c20dcfd8052a2bea026bda36875e5b7606028db", + "internalRef": "376207067" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "1c20dcfd8052a2bea026bda36875e5b7606028db", + "internalRef": "376207067" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8eae0234a16b26c2ff616d305dbd9786c8b10a47" + "sha": "7c50355dbd51333f43f53211d586a173b02d26df" } } ], @@ -100,313 +108,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p7beta1", + "language": "java", + "generator": "bazel" + } } - ], - "generatedFiles": [ - ".github/CODEOWNERS", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/blunderbuss.yml", - ".github/generated-files-bot.yml", - ".github/readme/synth.py", - ".github/release-please.yml", - ".github/snippet-bot.yml", - ".github/sync-repo-settings.yaml", - ".github/trusted-contribution.yml", - ".github/workflows/approve-readme.yaml", - ".github/workflows/auto-release.yaml", - ".github/workflows/ci.yaml", - ".github/workflows/samples.yaml", - ".kokoro/build.bat", - ".kokoro/build.sh", - ".kokoro/coerce_logs.sh", - ".kokoro/common.cfg", - ".kokoro/common.sh", - ".kokoro/continuous/common.cfg", - ".kokoro/continuous/java8.cfg", - ".kokoro/continuous/readme.cfg", - ".kokoro/dependencies.sh", - ".kokoro/nightly/common.cfg", - ".kokoro/nightly/integration.cfg", - ".kokoro/nightly/java11.cfg", - ".kokoro/nightly/java7.cfg", - ".kokoro/nightly/java8-osx.cfg", - ".kokoro/nightly/java8-win.cfg", - ".kokoro/nightly/java8.cfg", - ".kokoro/nightly/samples.cfg", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/clirr.cfg", - ".kokoro/presubmit/common.cfg", - ".kokoro/presubmit/dependencies.cfg", - ".kokoro/presubmit/integration.cfg", - ".kokoro/presubmit/java11.cfg", - ".kokoro/presubmit/java7.cfg", - ".kokoro/presubmit/java8-osx.cfg", - ".kokoro/presubmit/java8-win.cfg", - ".kokoro/presubmit/java8.cfg", - ".kokoro/presubmit/linkage-monitor.cfg", - ".kokoro/presubmit/lint.cfg", - ".kokoro/presubmit/samples.cfg", - ".kokoro/readme.sh", - ".kokoro/release/bump_snapshot.cfg", - ".kokoro/release/common.cfg", - ".kokoro/release/common.sh", - ".kokoro/release/drop.cfg", - ".kokoro/release/drop.sh", - ".kokoro/release/promote.cfg", - ".kokoro/release/promote.sh", - ".kokoro/release/publish_javadoc.cfg", - ".kokoro/release/publish_javadoc.sh", - ".kokoro/release/publish_javadoc11.cfg", - ".kokoro/release/publish_javadoc11.sh", - ".kokoro/release/snapshot.cfg", - ".kokoro/release/snapshot.sh", - ".kokoro/release/stage.cfg", - ".kokoro/release/stage.sh", - ".kokoro/trampoline.sh", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "codecov.yaml", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceClient.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/AssetServiceSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/gapic_metadata.json", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/package-info.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/AssetServiceStubSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceCallableFactory.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1/stub/GrpcAssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceClient.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/gapic_metadata.json", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/package-info.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/AssetServiceStubSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceCallableFactory.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p1beta1/stub/GrpcAssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceClient.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/gapic_metadata.json", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/package-info.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/AssetServiceStubSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceCallableFactory.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p2beta1/stub/GrpcAssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceClient.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/gapic_metadata.json", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/package-info.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/AssetServiceStubSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceCallableFactory.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p4beta1/stub/GrpcAssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/gapic_metadata.json", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java", - "google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1/AssetServiceClientTest.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetService.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1/MockAssetServiceImpl.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/AssetServiceClientTest.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetService.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p1beta1/MockAssetServiceImpl.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/AssetServiceClientTest.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetService.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p2beta1/MockAssetServiceImpl.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/AssetServiceClientTest.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetService.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p4beta1/MockAssetServiceImpl.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java", - "google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java", - "grpc-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceGrpc.java", - "grpc-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceGrpc.java", - "grpc-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceGrpc.java", - "grpc-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceGrpc.java", - "grpc-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceGrpc.java", - "java.header", - "license-checks.xml", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyLongrunningResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AnalyzeIamPolicyResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/Asset.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetProto.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/AssetServiceProto.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BatchGetAssetsHistoryResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestination.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/BigQueryDestinationOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ConditionEvaluation.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ConditionEvaluationOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ContentType.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/CreateFeedRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/CreateFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/DeleteFeedRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/DeleteFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ExportAssetsResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/Feed.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedName.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedOutputConfig.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/FeedOutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GcsDestination.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GcsDestinationOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GcsOutputResult.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GcsOutputResultOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GetFeedRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/GetFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisOutputConfig.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisOutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisQuery.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisQueryOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisResult.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisResultOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisState.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicyAnalysisStateOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicySearchResult.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/IamPolicySearchResultOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListAssetsRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListAssetsRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListAssetsResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListAssetsResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ListFeedsResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/OutputConfig.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/OutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/OutputResult.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/OutputResultOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PartitionSpec.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PartitionSpecOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PubsubDestination.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/PubsubDestinationOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/Resource.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResult.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/ResourceSearchResultOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllIamPoliciesRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllIamPoliciesRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllIamPoliciesResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllIamPoliciesResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllResourcesRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllResourcesRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllResourcesResponse.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/SearchAllResourcesResponseOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TemporalAsset.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TemporalAssetOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TimeWindow.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/TimeWindowOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/UpdateFeedRequest.java", - "proto-google-cloud-asset-v1/src/main/java/com/google/cloud/asset/v1/UpdateFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/asset_service.proto", - "proto-google-cloud-asset-v1/src/main/proto/google/cloud/asset/v1/assets.proto", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetProto.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/AssetServiceProto.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResult.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/IamPolicySearchResultOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/Permissions.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/PermissionsOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequest.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesRequestOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesResponse.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllIamPoliciesResponseOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequest.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesRequestOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesResponse.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/SearchAllResourcesResponseOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadata.java", - "proto-google-cloud-asset-v1p1beta1/src/main/java/com/google/cloud/asset/v1p1beta1/StandardResourceMetadataOrBuilder.java", - "proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/asset_service.proto", - "proto-google-cloud-asset-v1p1beta1/src/main/proto/google/cloud/asset/v1p1beta1/assets.proto", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/Asset.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetProto.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/AssetServiceProto.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ContentType.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/CreateFeedRequest.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/CreateFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/DeleteFeedRequest.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/DeleteFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/Feed.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedName.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedOutputConfig.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/FeedOutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GcsDestination.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GcsDestinationOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GetFeedRequest.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/GetFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsRequest.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsRequestOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsResponse.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ListFeedsResponseOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/OutputConfig.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/OutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/PubsubDestination.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/PubsubDestinationOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/Resource.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/ResourceOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TemporalAsset.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TemporalAssetOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TimeWindow.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/TimeWindowOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/UpdateFeedRequest.java", - "proto-google-cloud-asset-v1p2beta1/src/main/java/com/google/cloud/asset/v1p2beta1/UpdateFeedRequestOrBuilder.java", - "proto-google-cloud-asset-v1p2beta1/src/main/proto/google/cloud/asset/v1p2beta1/asset_service.proto", - "proto-google-cloud-asset-v1p2beta1/src/main/proto/google/cloud/asset/v1p2beta1/assets.proto", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AnalyzeIamPolicyRequest.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AnalyzeIamPolicyRequestOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AnalyzeIamPolicyResponse.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AnalyzeIamPolicyResponseOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AssetProto.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/AssetServiceProto.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/ExportIamPolicyAnalysisRequest.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/ExportIamPolicyAnalysisRequestOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/ExportIamPolicyAnalysisResponse.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/ExportIamPolicyAnalysisResponseOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/IamPolicyAnalysisOutputConfig.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/IamPolicyAnalysisOutputConfigOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/IamPolicyAnalysisQuery.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/IamPolicyAnalysisQueryOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/IamPolicyAnalysisResult.java", - "proto-google-cloud-asset-v1p4beta1/src/main/java/com/google/cloud/asset/v1p4beta1/IamPolicyAnalysisResultOrBuilder.java", - "proto-google-cloud-asset-v1p4beta1/src/main/proto/google/cloud/asset/v1p4beta1/asset_service.proto", - "proto-google-cloud-asset-v1p4beta1/src/main/proto/google/cloud/asset/v1p4beta1/assets.proto", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Asset.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetOrBuilder.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetProto.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceProto.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ContentType.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequest.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequestOrBuilder.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponse.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponseOrBuilder.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Resource.java", - "proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ResourceOrBuilder.java", - "proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/asset_service.proto", - "proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/assets.proto", - "renovate.json", - "samples/install-without-bom/pom.xml", - "samples/pom.xml", - "samples/snapshot/pom.xml", - "samples/snippets/pom.xml" ] } \ No newline at end of file diff --git a/synth.py b/synth.py index 165dc7ad5..50bd24f88 100644 --- a/synth.py +++ b/synth.py @@ -19,7 +19,7 @@ AUTOSYNTH_MULTIPLE_COMMITS = True service = 'asset' -versions = ['v1', 'v1p2beta1', 'v1p1beta1', 'v1p4beta1', 'v1p5beta1'] +versions = ['v1', 'v1p2beta1', 'v1p1beta1', 'v1p4beta1', 'v1p5beta1','v1p7beta1'] for version in versions: library = java.bazel_library( diff --git a/versions.txt b/versions.txt index 8b009174d..d8bf399c9 100644 --- a/versions.txt +++ b/versions.txt @@ -1,16 +1,18 @@ # Format: # module:released-version:current-version -proto-google-cloud-asset-v1:2.3.6:2.3.7-SNAPSHOT -proto-google-cloud-asset-v1p1beta1:0.96.6:0.96.7-SNAPSHOT -proto-google-cloud-asset-v1p2beta1:0.96.6:0.96.7-SNAPSHOT -proto-google-cloud-asset-v1beta1:0.96.6:0.96.7-SNAPSHOT -proto-google-cloud-asset-v1p4beta1:0.96.6:0.96.7-SNAPSHOT -proto-google-cloud-asset-v1p5beta1:0.96.6:0.96.7-SNAPSHOT +google-cloud-asset:2.3.6:2.3.7-SNAPSHOT grpc-google-cloud-asset-v1:2.3.6:2.3.7-SNAPSHOT grpc-google-cloud-asset-v1beta1:0.96.6:0.96.7-SNAPSHOT grpc-google-cloud-asset-v1p1beta1:0.96.6:0.96.7-SNAPSHOT grpc-google-cloud-asset-v1p2beta1:0.96.6:0.96.7-SNAPSHOT grpc-google-cloud-asset-v1p4beta1:0.96.6:0.96.7-SNAPSHOT grpc-google-cloud-asset-v1p5beta1:0.96.6:0.96.7-SNAPSHOT -google-cloud-asset:2.3.6:2.3.7-SNAPSHOT \ No newline at end of file +grpc-google-cloud-asset-v1p7beta1:2.3.6:2.3.7-SNAPSHOT +proto-google-cloud-asset-v1:2.3.6:2.3.7-SNAPSHOT +proto-google-cloud-asset-v1p1beta1:0.96.6:0.96.7-SNAPSHOT +proto-google-cloud-asset-v1p2beta1:0.96.6:0.96.7-SNAPSHOT +proto-google-cloud-asset-v1beta1:0.96.6:0.96.7-SNAPSHOT +proto-google-cloud-asset-v1p4beta1:0.96.6:0.96.7-SNAPSHOT +proto-google-cloud-asset-v1p5beta1:0.96.6:0.96.7-SNAPSHOT +proto-google-cloud-asset-v1p7beta1:2.3.6:2.3.7-SNAPSHOT