From c5777f91741b439c9396d50c778739fbab719551 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Tue, 7 Jul 2020 13:58:25 -0700 Subject: [PATCH] feat(v1p5beta1): add v1p5beta1 client (#246) * feat(v1p5beta1): add v1p5beta1 client * chore: remove unused dependency --- google-cloud-asset-bom/pom.xml | 10 + google-cloud-asset/pom.xml | 9 + .../asset/v1p5beta1/AssetServiceClient.java | 351 ++ .../asset/v1p5beta1/AssetServiceSettings.java | 184 + .../cloud/asset/v1p5beta1/package-info.java | 43 + .../v1p5beta1/stub/AssetServiceStub.java | 47 + .../stub/AssetServiceStubSettings.java | 338 ++ .../stub/GrpcAssetServiceCallableFactory.java | 115 + .../v1p5beta1/stub/GrpcAssetServiceStub.java | 162 + .../v1p5beta1/AssetServiceClientTest.java | 129 + .../asset/v1p5beta1/MockAssetService.java | 57 + .../asset/v1p5beta1/MockAssetServiceImpl.java | 73 + .../clirr-ignored-differences.xml | 10 - grpc-google-cloud-asset-v1p5beta1/pom.xml | 65 + .../asset/v1p5beta1/AssetServiceGrpc.java | 366 ++ pom.xml | 12 + .../clirr-ignored-differences.xml | 19 + proto-google-cloud-asset-v1p5beta1/pom.xml | 46 + .../google/cloud/asset/v1p5beta1/Asset.java | 3050 +++++++++++++++++ .../cloud/asset/v1p5beta1/AssetOrBuilder.java | 336 ++ .../cloud/asset/v1p5beta1/AssetProto.java | 141 + .../asset/v1p5beta1/AssetServiceProto.java | 120 + .../cloud/asset/v1p5beta1/ContentType.java | 220 ++ .../asset/v1p5beta1/ListAssetsRequest.java | 1751 ++++++++++ .../v1p5beta1/ListAssetsRequestOrBuilder.java | 240 ++ .../asset/v1p5beta1/ListAssetsResponse.java | 1402 ++++++++ .../ListAssetsResponseOrBuilder.java | 139 + .../cloud/asset/v1p5beta1/Resource.java | 1753 ++++++++++ .../asset/v1p5beta1/ResourceOrBuilder.java | 224 ++ .../cloud/asset/v1p5beta1/asset_service.proto | 112 + .../google/cloud/asset/v1p5beta1/assets.proto | 127 + synth.metadata | 41 +- synth.py | 2 +- versions.txt | 2 + 34 files changed, 11673 insertions(+), 23 deletions(-) create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java create mode 100644 google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java create mode 100644 google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java create mode 100644 google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java create mode 100644 google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java delete mode 100644 grpc-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml create mode 100644 grpc-google-cloud-asset-v1p5beta1/pom.xml create mode 100644 grpc-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceGrpc.java create mode 100644 proto-google-cloud-asset-v1p5beta1/clirr-ignored-differences.xml create mode 100644 proto-google-cloud-asset-v1p5beta1/pom.xml create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Asset.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetProto.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceProto.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ContentType.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequest.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequestOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponse.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponseOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Resource.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ResourceOrBuilder.java create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/asset_service.proto create mode 100644 proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/assets.proto diff --git a/google-cloud-asset-bom/pom.xml b/google-cloud-asset-bom/pom.xml index ef5d9f1bb..c8a580211 100644 --- a/google-cloud-asset-bom/pom.xml +++ b/google-cloud-asset-bom/pom.xml @@ -91,6 +91,11 @@ grpc-google-cloud-asset-v1p4beta1 0.89.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-asset-v1p5beta1 + 0.89.1-SNAPSHOT + com.google.api.grpc proto-google-cloud-asset-v1p1beta1 @@ -111,6 +116,11 @@ proto-google-cloud-asset-v1p4beta1 0.89.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-asset-v1p5beta1 + 0.89.1-SNAPSHOT + com.google.cloud google-cloud-asset diff --git a/google-cloud-asset/pom.xml b/google-cloud-asset/pom.xml index f297cbfed..8d5886e85 100644 --- a/google-cloud-asset/pom.xml +++ b/google-cloud-asset/pom.xml @@ -62,6 +62,10 @@ com.google.api.grpc proto-google-cloud-asset-v1p4beta1 + + com.google.api.grpc + proto-google-cloud-asset-v1p5beta1 + com.google.guava guava @@ -130,6 +134,11 @@ grpc-google-cloud-asset-v1p4beta1 test + + com.google.api.grpc + grpc-google-cloud-asset-v1p5beta1 + test + com.google.api diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java new file mode 100644 index 000000000..75dd57b21 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceClient.java @@ -0,0 +1,351 @@ +/* + * 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.v1p5beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p5beta1.stub.AssetServiceStub; +import com.google.cloud.asset.v1p5beta1.stub.AssetServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * 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: + * + *

+ * 
+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+ *   String parent = "";
+ *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+ *     .setParent(parent)
+ *     .build();
+ *   ApiFuture<ListAssetsPagedResponse> future = assetServiceClient.listAssetsPagedCallable().futureCall(request);
+ *   // Do something
+ *   for (Asset element : future.get().iterateAll()) {
+ *     // doThingsWith(element);
+ *   }
+ * }
+ * 
+ * 
+ * + *

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

+ * 
+ * AssetServiceSettings assetServiceSettings =
+ *     AssetServiceSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * AssetServiceClient assetServiceClient =
+ *     AssetServiceClient.create(assetServiceSettings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * AssetServiceSettings assetServiceSettings =
+ *     AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AssetServiceClient assetServiceClient =
+ *     AssetServiceClient.create(assetServiceSettings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssetServiceClient implements BackgroundResource { + private final AssetServiceSettings settings; + private final AssetServiceStub stub; + + /** 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 to use 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(); + } + + @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; + } + + 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; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assets with time and resource types and returns paged results in response. + * + *

Sample code: + * + *


+   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+   *   String parent = "";
+   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   for (Asset element : assetServiceClient.listAssets(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListAssetsPagedResponse listAssets(ListAssetsRequest request) { + return listAssetsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assets with time and resource types and returns paged results in response. + * + *

Sample code: + * + *


+   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+   *   String parent = "";
+   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   ApiFuture<ListAssetsPagedResponse> future = assetServiceClient.listAssetsPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Asset element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listAssetsPagedCallable() { + return stub.listAssetsPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Lists assets with time and resource types and returns paged results in response. + * + *

Sample code: + * + *


+   * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+   *   String parent = "";
+   *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+   *     .setParent(parent)
+   *     .build();
+   *   while (true) {
+   *     ListAssetsResponse response = assetServiceClient.listAssetsCallable().call(request);
+   *     for (Asset element : response.getAssetsList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listAssetsCallable() { + return stub.listAssetsCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } + + public static class ListAssetsPagedResponse + extends AbstractPagedListResponse< + ListAssetsRequest, + ListAssetsResponse, + Asset, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListAssetsPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListAssetsPagedResponse apply(ListAssetsPage input) { + return new ListAssetsPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListAssetsPagedResponse(ListAssetsPage page) { + super(page, ListAssetsFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListAssetsPage + extends AbstractPage { + + private ListAssetsPage( + PageContext context, + ListAssetsResponse response) { + super(context, response); + } + + private static ListAssetsPage createEmptyPage() { + return new ListAssetsPage(null, null); + } + + @Override + protected ListAssetsPage createPage( + PageContext context, + ListAssetsResponse response) { + return new ListAssetsPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListAssetsFixedSizeCollection + extends AbstractFixedSizeCollection< + ListAssetsRequest, + ListAssetsResponse, + Asset, + ListAssetsPage, + ListAssetsFixedSizeCollection> { + + private ListAssetsFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListAssetsFixedSizeCollection createEmptyCollection() { + return new ListAssetsFixedSizeCollection(null, 0); + } + + @Override + protected ListAssetsFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListAssetsFixedSizeCollection(pages, collectionSize); + } + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java new file mode 100644 index 000000000..97381e769 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceSettings.java @@ -0,0 +1,184 @@ +/* + * 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.v1p5beta1; + +import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.asset.v1p5beta1.stub.AssetServiceStubSettings; +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 listAssetsPagedCallable to 30 seconds: + * + *

+ * 
+ * AssetServiceSettings.Builder assetServiceSettingsBuilder =
+ *     AssetServiceSettings.newBuilder();
+ * assetServiceSettingsBuilder
+ *     .listAssetsSettings()
+ *     .setRetrySettings(
+ *         assetServiceSettingsBuilder.listAssetsSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class AssetServiceSettings extends ClientSettings { + /** Returns the object with the settings used for calls to listAssets. */ + public PagedCallSettings + listAssetsSettings() { + return ((AssetServiceStubSettings) getStubSettings()).listAssetsSettings(); + } + + 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)); + } + + private static Builder createDefault() { + return new Builder(AssetServiceStubSettings.newBuilder()); + } + + protected Builder(AssetServiceSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(AssetServiceStubSettings.Builder stubSettings) { + super(stubSettings); + } + + 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 listAssets. */ + public PagedCallSettings.Builder + listAssetsSettings() { + return getStubSettingsBuilder().listAssetsSettings(); + } + + @Override + public AssetServiceSettings build() throws IOException { + return new AssetServiceSettings(this); + } + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java new file mode 100644 index 000000000..cdff7128a --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to Cloud Asset API. + * + *

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

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

Service Description: Asset service definition. + * + *

Sample for AssetServiceClient: + * + *

+ * 
+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+ *   String parent = "";
+ *   ListAssetsRequest request = ListAssetsRequest.newBuilder()
+ *     .setParent(parent)
+ *     .build();
+ *   ListAssetsPagedResponse response = assetServiceClient.listAssetsPagedCallable(request);
+ * }
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +package com.google.cloud.asset.v1p5beta1; + +import javax.annotation.Generated; diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java new file mode 100644 index 000000000..8fc2992a7 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStub.java @@ -0,0 +1,47 @@ +/* + * 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.v1p5beta1.stub; + +import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p5beta1.ListAssetsRequest; +import com.google.cloud.asset.v1p5beta1.ListAssetsResponse; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for Cloud Asset API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class AssetServiceStub implements BackgroundResource { + + public UnaryCallable listAssetsPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listAssetsPagedCallable()"); + } + + public UnaryCallable listAssetsCallable() { + throw new UnsupportedOperationException("Not implemented: listAssetsCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java new file mode 100644 index 000000000..3598ea9a5 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/AssetServiceStubSettings.java @@ -0,0 +1,338 @@ +/* + * 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.v1p5beta1.stub; + +import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiCallContext; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p5beta1.Asset; +import com.google.cloud.asset.v1p5beta1.ListAssetsRequest; +import com.google.cloud.asset.v1p5beta1.ListAssetsResponse; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link 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 listAssetsPagedCallable to 30 seconds: + * + *

+ * 
+ * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
+ *     AssetServiceStubSettings.newBuilder();
+ * assetServiceSettingsBuilder
+ *     .listAssetsSettings()
+ *     .setRetrySettings(
+ *         assetServiceSettingsBuilder.listAssetsSettings().getRetrySettings().toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +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 PagedCallSettings + listAssetsSettings; + + /** Returns the object with the settings used for calls to listAssets. */ + public PagedCallSettings + listAssetsSettings() { + return listAssetsSettings; + } + + @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); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "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); + + listAssetsSettings = settingsBuilder.listAssetsSettings().build(); + } + + private static final PagedListDescriptor + LIST_ASSETS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListAssetsRequest injectToken(ListAssetsRequest payload, String token) { + return ListAssetsRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListAssetsRequest injectPageSize(ListAssetsRequest payload, int pageSize) { + return ListAssetsRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListAssetsRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListAssetsResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListAssetsResponse payload) { + return payload.getAssetsList() != null + ? payload.getAssetsList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + LIST_ASSETS_PAGE_STR_FACT = + new PagedListResponseFactory< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListAssetsRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_ASSETS_PAGE_STR_DESC, request, context); + return ListAssetsPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + /** Builder for AssetServiceStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final PagedCallSettings.Builder< + ListAssetsRequest, ListAssetsResponse, ListAssetsPagedResponse> + listAssetsSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + listAssetsSettings = PagedCallSettings.newBuilder(LIST_ASSETS_PAGE_STR_FACT); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listAssetsSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .listAssetsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(AssetServiceStubSettings settings) { + super(settings); + + listAssetsSettings = settings.listAssetsSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of(listAssetsSettings); + } + + // 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 listAssets. */ + public PagedCallSettings.Builder + listAssetsSettings() { + return listAssetsSettings; + } + + @Override + public AssetServiceStubSettings build() throws IOException { + return new AssetServiceStubSettings(this); + } + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java new file mode 100644 index 000000000..be2d2af03 --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.asset.v1p5beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for Cloud Asset API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class 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 pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java new file mode 100644 index 000000000..fd740561d --- /dev/null +++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p5beta1/stub/GrpcAssetServiceStub.java @@ -0,0 +1,162 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.asset.v1p5beta1.stub; + +import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.asset.v1p5beta1.ListAssetsRequest; +import com.google.cloud.asset.v1p5beta1.ListAssetsResponse; +import com.google.common.collect.ImmutableMap; +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 Cloud Asset API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcAssetServiceStub extends AssetServiceStub { + + private static final MethodDescriptor + listAssetsMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.asset.v1p5beta1.AssetService/ListAssets") + .setRequestMarshaller(ProtoUtils.marshaller(ListAssetsRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListAssetsResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable listAssetsCallable; + private final UnaryCallable listAssetsPagedCallable; + + 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; + + GrpcCallSettings listAssetsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listAssetsMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListAssetsRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + + this.listAssetsCallable = + callableFactory.createUnaryCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + this.listAssetsPagedCallable = + callableFactory.createPagedCallable( + listAssetsTransportSettings, settings.listAssetsSettings(), clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable listAssetsPagedCallable() { + return listAssetsPagedCallable; + } + + public UnaryCallable listAssetsCallable() { + return listAssetsCallable; + } + + @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/v1p5beta1/AssetServiceClientTest.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java new file mode 100644 index 000000000..8519ef138 --- /dev/null +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/AssetServiceClientTest.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.asset.v1p5beta1; + +import static com.google.cloud.asset.v1p5beta1.AssetServiceClient.ListAssetsPagedResponse; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.common.collect.Lists; +import com.google.protobuf.AbstractMessage; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.UUID; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class AssetServiceClientTest { + private static MockAssetService mockAssetService; + private static MockServiceHelper serviceHelper; + private AssetServiceClient client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockAssetService = new MockAssetService(); + serviceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), Arrays.asList(mockAssetService)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + AssetServiceSettings settings = + AssetServiceSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = AssetServiceClient.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void listAssetsTest() { + String nextPageToken = ""; + Asset assetsElement = Asset.newBuilder().build(); + List assets = Arrays.asList(assetsElement); + ListAssetsResponse expectedResponse = + ListAssetsResponse.newBuilder() + .setNextPageToken(nextPageToken) + .addAllAssets(assets) + .build(); + mockAssetService.addResponse(expectedResponse); + + String parent = "parent-995424086"; + ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent).build(); + + ListAssetsPagedResponse pagedListResponse = client.listAssets(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getAssetsList().get(0), resources.get(0)); + + List actualRequests = mockAssetService.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + ListAssetsRequest actualRequest = (ListAssetsRequest) actualRequests.get(0); + + Assert.assertEquals(parent, actualRequest.getParent()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void listAssetsExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockAssetService.addException(exception); + + try { + String parent = "parent-995424086"; + ListAssetsRequest request = ListAssetsRequest.newBuilder().setParent(parent).build(); + + client.listAssets(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java new file mode 100644 index 000000000..ff9f7272a --- /dev/null +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetService.java @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.asset.v1p5beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class 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/v1p5beta1/MockAssetServiceImpl.java b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java new file mode 100644 index 000000000..3ab35b893 --- /dev/null +++ b/google-cloud-asset/src/test/java/com/google/cloud/asset/v1p5beta1/MockAssetServiceImpl.java @@ -0,0 +1,73 @@ +/* + * 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.v1p5beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.asset.v1p5beta1.AssetServiceGrpc.AssetServiceImplBase; +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; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +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 listAssets( + ListAssetsRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListAssetsResponse) { + requests.add(request); + responseObserver.onNext((ListAssetsResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/grpc-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml b/grpc-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml deleted file mode 100644 index 805825c7f..000000000 --- a/grpc-google-cloud-asset-v1p4beta1/clirr-ignored-differences.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - 6001 - com/google/cloud/asset/v1p4beta1/*Grpc - METHOD_* - - diff --git a/grpc-google-cloud-asset-v1p5beta1/pom.xml b/grpc-google-cloud-asset-v1p5beta1/pom.xml new file mode 100644 index 000000000..431efec95 --- /dev/null +++ b/grpc-google-cloud-asset-v1p5beta1/pom.xml @@ -0,0 +1,65 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-asset-v1p5beta1 + 0.89.1-SNAPSHOT + grpc-google-cloud-asset-v1p5beta1 + GRPC library for grpc-google-cloud-asset-v1p5beta1 + + com.google.cloud + google-cloud-asset-parent + 1.4.1-SNAPSHOT + + + + io.grpc + grpc-api + + + io.grpc + grpc-stub + + + io.grpc + grpc-protobuf + + + com.google.protobuf + protobuf-java + + + com.google.api.grpc + proto-google-cloud-asset-v1p5beta1 + + + 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-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceGrpc.java b/grpc-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceGrpc.java new file mode 100644 index 000000000..00299eb56 --- /dev/null +++ b/grpc-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceGrpc.java @@ -0,0 +1,366 @@ +/* + * 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.v1p5beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Asset service definition.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/asset/v1p5beta1/asset_service.proto") +public final class AssetServiceGrpc { + + private AssetServiceGrpc() {} + + public static final String SERVICE_NAME = "google.cloud.asset.v1p5beta1.AssetService"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.asset.v1p5beta1.ListAssetsRequest, + com.google.cloud.asset.v1p5beta1.ListAssetsResponse> + getListAssetsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListAssets", + requestType = com.google.cloud.asset.v1p5beta1.ListAssetsRequest.class, + responseType = com.google.cloud.asset.v1p5beta1.ListAssetsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.asset.v1p5beta1.ListAssetsRequest, + com.google.cloud.asset.v1p5beta1.ListAssetsResponse> + getListAssetsMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.asset.v1p5beta1.ListAssetsRequest, + com.google.cloud.asset.v1p5beta1.ListAssetsResponse> + getListAssetsMethod; + if ((getListAssetsMethod = AssetServiceGrpc.getListAssetsMethod) == null) { + synchronized (AssetServiceGrpc.class) { + if ((getListAssetsMethod = AssetServiceGrpc.getListAssetsMethod) == null) { + AssetServiceGrpc.getListAssetsMethod = + getListAssetsMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListAssets")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.asset.v1p5beta1.ListAssetsRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.asset.v1p5beta1.ListAssetsResponse + .getDefaultInstance())) + .setSchemaDescriptor(new AssetServiceMethodDescriptorSupplier("ListAssets")) + .build(); + } + } + } + return getListAssetsMethod; + } + + /** 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 { + + /** + * + * + *
+     * Lists assets with time and resource types and returns paged results in
+     * response.
+     * 
+ */ + public void listAssets( + com.google.cloud.asset.v1p5beta1.ListAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListAssetsMethod(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListAssetsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.cloud.asset.v1p5beta1.ListAssetsRequest, + com.google.cloud.asset.v1p5beta1.ListAssetsResponse>( + this, METHODID_LIST_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); + } + + /** + * + * + *
+     * Lists assets with time and resource types and returns paged results in
+     * response.
+     * 
+ */ + public void listAssets( + com.google.cloud.asset.v1p5beta1.ListAssetsRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListAssetsMethod(), 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); + } + + /** + * + * + *
+     * Lists assets with time and resource types and returns paged results in
+     * response.
+     * 
+ */ + public com.google.cloud.asset.v1p5beta1.ListAssetsResponse listAssets( + com.google.cloud.asset.v1p5beta1.ListAssetsRequest request) { + return blockingUnaryCall(getChannel(), getListAssetsMethod(), 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); + } + + /** + * + * + *
+     * Lists assets with time and resource types and returns paged results in
+     * response.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.asset.v1p5beta1.ListAssetsResponse> + listAssets(com.google.cloud.asset.v1p5beta1.ListAssetsRequest request) { + return futureUnaryCall( + getChannel().newCall(getListAssetsMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_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_LIST_ASSETS: + serviceImpl.listAssets( + (com.google.cloud.asset.v1p5beta1.ListAssetsRequest) 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.v1p5beta1.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(getListAssetsMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/pom.xml b/pom.xml index 3397e28e1..b57c83eb5 100644 --- a/pom.xml +++ b/pom.xml @@ -92,6 +92,11 @@ proto-google-cloud-asset-v1p4beta1 0.89.1-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-asset-v1p5beta1 + 0.89.1-SNAPSHOT + com.google.api.grpc grpc-google-cloud-asset-v1 @@ -117,6 +122,11 @@ grpc-google-cloud-asset-v1p4beta1 0.89.1-SNAPSHOT + + com.google.api.grpc + grpc-google-cloud-asset-v1p5beta1 + 0.89.1-SNAPSHOT + com.google.cloud google-cloud-asset @@ -188,11 +198,13 @@ proto-google-cloud-asset-v1p2beta1 proto-google-cloud-asset-v1beta1 proto-google-cloud-asset-v1p4beta1 + proto-google-cloud-asset-v1p5beta1 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 google-cloud-asset-bom diff --git a/proto-google-cloud-asset-v1p5beta1/clirr-ignored-differences.xml b/proto-google-cloud-asset-v1p5beta1/clirr-ignored-differences.xml new file mode 100644 index 000000000..51a307f5c --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/asset/v1p5beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/asset/v1p5beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/asset/v1p5beta1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-asset-v1p5beta1/pom.xml b/proto-google-cloud-asset-v1p5beta1/pom.xml new file mode 100644 index 000000000..03c955319 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-asset-v1p5beta1 + 0.89.1-SNAPSHOT + proto-google-cloud-asset-v1p5beta1 + PROTO library for proto-google-cloud-asset-v1p4beta1 + + com.google.cloud + google-cloud-asset-parent + 1.4.1-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 + + + + + + + org.codehaus.mojo + flatten-maven-plugin + + + + \ No newline at end of file diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Asset.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Asset.java new file mode 100644 index 000000000..d13b6ede6 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Asset.java @@ -0,0 +1,3050 @@ +/* + * 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/v1p5beta1/assets.proto + +package com.google.cloud.asset.v1p5beta1; + +/** + * + * + *
+ * Cloud asset. This includes all Google Cloud Platform resources,
+ * Cloud IAM policies, and other non-GCP assets.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.Asset} + */ +public final class Asset extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource.Builder subBuilder = null; + if (resource_ != null) { + subBuilder = resource_.toBuilder(); + } + resource_ = + input.readMessage( + com.google.cloud.asset.v1p5beta1.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; + } + 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.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.Asset.class, + com.google.cloud.asset.v1p5beta1.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 NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The full name of the asset. For 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. For 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_; + /** + * + * + *
+   * Type of the asset. Example: "compute.googleapis.com/Disk".
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Type of the asset. Example: "compute.googleapis.com/Disk".
+   * 
+ * + * 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.v1p5beta1.Resource resource_; + /** + * + * + *
+   * Representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + * + * @return Whether the resource field is set. + */ + @java.lang.Override + public boolean hasResource() { + return resource_ != null; + } + /** + * + * + *
+   * Representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + * + * @return The resource. + */ + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Resource getResource() { + return resource_ == null + ? com.google.cloud.asset.v1p5beta1.Resource.getDefaultInstance() + : resource_; + } + /** + * + * + *
+   * Representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ResourceOrBuilder getResourceOrBuilder() { + return getResource(); + } + + public static final int IAM_POLICY_FIELD_NUMBER = 4; + private com.google.iam.v1.Policy iamPolicy_; + /** + * + * + *
+   * Representation of the actual Cloud IAM policy set on a cloud resource. For
+   * each resource, there must be at most one Cloud IAM policy set on it.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return Whether the iamPolicy field is set. + */ + @java.lang.Override + public boolean hasIamPolicy() { + return iamPolicy_ != null; + } + /** + * + * + *
+   * Representation of the actual Cloud IAM policy set on a cloud resource. For
+   * each resource, there must be at most one Cloud IAM policy set on it.
+   * 
+ * + * .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_; + } + /** + * + * + *
+   * Representation of the actual Cloud IAM policy set on a cloud resource. For
+   * each resource, there must be at most one Cloud IAM policy set on it.
+   * 
+ * + * .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_; + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public java.util.List getOrgPolicyList() { + return orgPolicy_; + } + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public java.util.List + getOrgPolicyOrBuilderList() { + return orgPolicy_; + } + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + @java.lang.Override + public int getOrgPolicyCount() { + return orgPolicy_.size(); + } + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * 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); + } + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * 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; + /** + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return Whether the accessPolicy field is set. + */ + @java.lang.Override + public boolean hasAccessPolicy() { + return accessContextPolicyCase_ == 7; + } + /** + * .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(); + } + /** .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; + /** + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return Whether the accessLevel field is set. + */ + @java.lang.Override + public boolean hasAccessLevel() { + return accessContextPolicyCase_ == 8; + } + /** + * .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(); + } + /** .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; + /** + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return Whether the servicePerimeter field is set. + */ + @java.lang.Override + public boolean hasServicePerimeter() { + return accessContextPolicyCase_ == 9; + } + /** + * .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(); + } + /** + * .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 ANCESTORS_FIELD_NUMBER = 10; + private com.google.protobuf.LazyStringList ancestors_; + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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_; + } + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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(); + } + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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); + } + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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)); + } + 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(); + } + 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.v1p5beta1.Asset)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p5beta1.Asset other = (com.google.cloud.asset.v1p5beta1.Asset) obj; + + 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 (!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(); + 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 (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.v1p5beta1.Asset parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Asset parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Asset parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Asset parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Asset parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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; + } + /** + * + * + *
+   * Cloud asset. This includes all Google Cloud Platform resources,
+   * Cloud IAM policies, and other non-GCP assets.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.Asset} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p5beta1.Asset) + com.google.cloud.asset.v1p5beta1.AssetOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Asset_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Asset_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.Asset.class, + com.google.cloud.asset.v1p5beta1.Asset.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p5beta1.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(); + 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(); + } + 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.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Asset_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Asset getDefaultInstanceForType() { + return com.google.cloud.asset.v1p5beta1.Asset.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Asset build() { + com.google.cloud.asset.v1p5beta1.Asset result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Asset buildPartial() { + com.google.cloud.asset.v1p5beta1.Asset result = + new com.google.cloud.asset.v1p5beta1.Asset(this); + int from_bitField0_ = bitField0_; + 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 (((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.v1p5beta1.Asset) { + return mergeFrom((com.google.cloud.asset.v1p5beta1.Asset) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p5beta1.Asset other) { + if (other == com.google.cloud.asset.v1p5beta1.Asset.getDefaultInstance()) return this; + 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.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.v1p5beta1.Asset parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p5beta1.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 java.lang.Object name_ = ""; + /** + * + * + *
+     * The full name of the asset. For 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. For 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. For 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. For 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. For 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_ = ""; + /** + * + * + *
+     * Type of the asset. Example: "compute.googleapis.com/Disk".
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Type of the asset. Example: "compute.googleapis.com/Disk".
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Type of the asset. Example: "compute.googleapis.com/Disk".
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Type of the asset. Example: "compute.googleapis.com/Disk".
+     * 
+ * + * string asset_type = 2; + * + * @return This builder for chaining. + */ + public Builder clearAssetType() { + + assetType_ = getDefaultInstance().getAssetType(); + onChanged(); + return this; + } + /** + * + * + *
+     * Type of the asset. Example: "compute.googleapis.com/Disk".
+     * 
+ * + * 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.v1p5beta1.Resource resource_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p5beta1.Resource, + com.google.cloud.asset.v1p5beta1.Resource.Builder, + com.google.cloud.asset.v1p5beta1.ResourceOrBuilder> + resourceBuilder_; + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + * + * @return Whether the resource field is set. + */ + public boolean hasResource() { + return resourceBuilder_ != null || resource_ != null; + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + * + * @return The resource. + */ + public com.google.cloud.asset.v1p5beta1.Resource getResource() { + if (resourceBuilder_ == null) { + return resource_ == null + ? com.google.cloud.asset.v1p5beta1.Resource.getDefaultInstance() + : resource_; + } else { + return resourceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + public Builder setResource(com.google.cloud.asset.v1p5beta1.Resource value) { + if (resourceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + resource_ = value; + onChanged(); + } else { + resourceBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + public Builder setResource(com.google.cloud.asset.v1p5beta1.Resource.Builder builderForValue) { + if (resourceBuilder_ == null) { + resource_ = builderForValue.build(); + onChanged(); + } else { + resourceBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + public Builder mergeResource(com.google.cloud.asset.v1p5beta1.Resource value) { + if (resourceBuilder_ == null) { + if (resource_ != null) { + resource_ = + com.google.cloud.asset.v1p5beta1.Resource.newBuilder(resource_) + .mergeFrom(value) + .buildPartial(); + } else { + resource_ = value; + } + onChanged(); + } else { + resourceBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + public Builder clearResource() { + if (resourceBuilder_ == null) { + resource_ = null; + onChanged(); + } else { + resource_ = null; + resourceBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + public com.google.cloud.asset.v1p5beta1.Resource.Builder getResourceBuilder() { + + onChanged(); + return getResourceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + public com.google.cloud.asset.v1p5beta1.ResourceOrBuilder getResourceOrBuilder() { + if (resourceBuilder_ != null) { + return resourceBuilder_.getMessageOrBuilder(); + } else { + return resource_ == null + ? com.google.cloud.asset.v1p5beta1.Resource.getDefaultInstance() + : resource_; + } + } + /** + * + * + *
+     * Representation of the resource.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p5beta1.Resource, + com.google.cloud.asset.v1p5beta1.Resource.Builder, + com.google.cloud.asset.v1p5beta1.ResourceOrBuilder> + getResourceFieldBuilder() { + if (resourceBuilder_ == null) { + resourceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.asset.v1p5beta1.Resource, + com.google.cloud.asset.v1p5beta1.Resource.Builder, + com.google.cloud.asset.v1p5beta1.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_; + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return Whether the iamPolicy field is set. + */ + public boolean hasIamPolicy() { + return iamPolicyBuilder_ != null || iamPolicy_ != null; + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .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(); + } + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .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; + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .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; + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .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; + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public Builder clearIamPolicy() { + if (iamPolicyBuilder_ == null) { + iamPolicy_ = null; + onChanged(); + } else { + iamPolicy_ = null; + iamPolicyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + public com.google.iam.v1.Policy.Builder getIamPolicyBuilder() { + + onChanged(); + return getIamPolicyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .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_; + } + } + /** + * + * + *
+     * Representation of the actual Cloud IAM policy set on a cloud resource. For
+     * each resource, there must be at most one Cloud IAM policy set on it.
+     * 
+ * + * .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_; + + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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(); + } + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public int getOrgPolicyCount() { + if (orgPolicyBuilder_ == null) { + return orgPolicy_.size(); + } else { + return orgPolicyBuilder_.getCount(); + } + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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); + } + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + public com.google.cloud.orgpolicy.v1.Policy.Builder getOrgPolicyBuilder(int index) { + return getOrgPolicyFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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); + } + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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_); + } + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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()); + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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()); + } + /** + * + * + *
+     * Representation of the Cloud Organization Policy set on an asset. For each
+     * asset, there could be multiple Organization policies with different
+     * constraints.
+     * 
+ * + * 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_; + /** + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return Whether the accessPolicy field is set. + */ + @java.lang.Override + public boolean hasAccessPolicy() { + return accessContextPolicyCase_ == 7; + } + /** + * .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(); + } + } + /** .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; + } + /** .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; + } + /** .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; + } + /** .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; + } + /** .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; */ + public com.google.identity.accesscontextmanager.v1.AccessPolicy.Builder + getAccessPolicyBuilder() { + return getAccessPolicyFieldBuilder().getBuilder(); + } + /** .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(); + } + } + /** .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_; + /** + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return Whether the accessLevel field is set. + */ + @java.lang.Override + public boolean hasAccessLevel() { + return accessContextPolicyCase_ == 8; + } + /** + * .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(); + } + } + /** .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; + } + /** .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; + } + /** .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; + } + /** .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; + } + /** .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; */ + public com.google.identity.accesscontextmanager.v1.AccessLevel.Builder getAccessLevelBuilder() { + return getAccessLevelFieldBuilder().getBuilder(); + } + /** .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(); + } + } + /** .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_; + /** + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return Whether the servicePerimeter field is set. + */ + @java.lang.Override + public boolean hasServicePerimeter() { + return accessContextPolicyCase_ == 9; + } + /** + * .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(); + } + } + /** + * .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; + } + /** + * .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; + } + /** + * .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; + } + /** + * .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; + } + /** + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + public com.google.identity.accesscontextmanager.v1.ServicePerimeter.Builder + getServicePerimeterBuilder() { + return getServicePerimeterFieldBuilder().getBuilder(); + } + /** + * .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(); + } + } + /** + * .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.protobuf.LazyStringList ancestors_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAncestorsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + ancestors_ = new com.google.protobuf.LazyStringArrayList(ancestors_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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(); + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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(); + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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); + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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); + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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; + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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; + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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; + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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; + } + /** + * + * + *
+     * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+     * represented as a list of relative resource names. Ancestry path starts with
+     * the closest CRM ancestor and ends at root. If the asset is a CRM
+     * project/folder/organization, this 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.v1p5beta1.Asset) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p5beta1.Asset) + private static final com.google.cloud.asset.v1p5beta1.Asset DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p5beta1.Asset(); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Asset getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetOrBuilder.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetOrBuilder.java new file mode 100644 index 000000000..7deffbed1 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetOrBuilder.java @@ -0,0 +1,336 @@ +/* + * 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/v1p5beta1/assets.proto + +package com.google.cloud.asset.v1p5beta1; + +public interface AssetOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p5beta1.Asset) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The full name of the asset. For 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. For 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(); + + /** + * + * + *
+   * Type of the asset. Example: "compute.googleapis.com/Disk".
+   * 
+ * + * string asset_type = 2; + * + * @return The assetType. + */ + java.lang.String getAssetType(); + /** + * + * + *
+   * Type of the asset. Example: "compute.googleapis.com/Disk".
+   * 
+ * + * string asset_type = 2; + * + * @return The bytes for assetType. + */ + com.google.protobuf.ByteString getAssetTypeBytes(); + + /** + * + * + *
+   * Representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + * + * @return Whether the resource field is set. + */ + boolean hasResource(); + /** + * + * + *
+   * Representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + * + * @return The resource. + */ + com.google.cloud.asset.v1p5beta1.Resource getResource(); + /** + * + * + *
+   * Representation of the resource.
+   * 
+ * + * .google.cloud.asset.v1p5beta1.Resource resource = 3; + */ + com.google.cloud.asset.v1p5beta1.ResourceOrBuilder getResourceOrBuilder(); + + /** + * + * + *
+   * Representation of the actual Cloud IAM policy set on a cloud resource. For
+   * each resource, there must be at most one Cloud IAM policy set on it.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return Whether the iamPolicy field is set. + */ + boolean hasIamPolicy(); + /** + * + * + *
+   * Representation of the actual Cloud IAM policy set on a cloud resource. For
+   * each resource, there must be at most one Cloud IAM policy set on it.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + * + * @return The iamPolicy. + */ + com.google.iam.v1.Policy getIamPolicy(); + /** + * + * + *
+   * Representation of the actual Cloud IAM policy set on a cloud resource. For
+   * each resource, there must be at most one Cloud IAM policy set on it.
+   * 
+ * + * .google.iam.v1.Policy iam_policy = 4; + */ + com.google.iam.v1.PolicyOrBuilder getIamPolicyOrBuilder(); + + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + java.util.List getOrgPolicyList(); + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + com.google.cloud.orgpolicy.v1.Policy getOrgPolicy(int index); + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + int getOrgPolicyCount(); + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + java.util.List + getOrgPolicyOrBuilderList(); + /** + * + * + *
+   * Representation of the Cloud Organization Policy set on an asset. For each
+   * asset, there could be multiple Organization policies with different
+   * constraints.
+   * 
+ * + * repeated .google.cloud.orgpolicy.v1.Policy org_policy = 6; + */ + com.google.cloud.orgpolicy.v1.PolicyOrBuilder getOrgPolicyOrBuilder(int index); + + /** + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return Whether the accessPolicy field is set. + */ + boolean hasAccessPolicy(); + /** + * .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + * + * @return The accessPolicy. + */ + com.google.identity.accesscontextmanager.v1.AccessPolicy getAccessPolicy(); + /** .google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; */ + com.google.identity.accesscontextmanager.v1.AccessPolicyOrBuilder getAccessPolicyOrBuilder(); + + /** + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return Whether the accessLevel field is set. + */ + boolean hasAccessLevel(); + /** + * .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + * + * @return The accessLevel. + */ + com.google.identity.accesscontextmanager.v1.AccessLevel getAccessLevel(); + /** .google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; */ + com.google.identity.accesscontextmanager.v1.AccessLevelOrBuilder getAccessLevelOrBuilder(); + + /** + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return Whether the servicePerimeter field is set. + */ + boolean hasServicePerimeter(); + /** + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + * + * @return The servicePerimeter. + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeter getServicePerimeter(); + /** + * .google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = 9; + */ + com.google.identity.accesscontextmanager.v1.ServicePerimeterOrBuilder + getServicePerimeterOrBuilder(); + + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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(); + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this starts from the asset itself.
+   * Example: ["projects/123456789", "folders/5432", "organizations/1234"]
+   * 
+ * + * repeated string ancestors = 10; + * + * @return The count of ancestors. + */ + int getAncestorsCount(); + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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); + /** + * + * + *
+   * Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy,
+   * represented as a list of relative resource names. Ancestry path starts with
+   * the closest CRM ancestor and ends at root. If the asset is a CRM
+   * project/folder/organization, this 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.v1p5beta1.Asset.AccessContextPolicyCase + getAccessContextPolicyCase(); +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetProto.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetProto.java new file mode 100644 index 000000000..de33750c1 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetProto.java @@ -0,0 +1,141 @@ +/* + * 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/v1p5beta1/assets.proto + +package com.google.cloud.asset.v1p5beta1; + +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_v1p5beta1_Asset_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p5beta1_Asset_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p5beta1_Resource_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p5beta1_Resource_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/v1p5beta1/assets.pr" + + "oto\022\034google.cloud.asset.v1p5beta1\032\034googl" + + "e/api/annotations.proto\032\031google/api/reso" + + "urce.proto\032)google/cloud/orgpolicy/v1/or" + + "gpolicy.proto\032\032google/iam/v1/policy.prot" + + "o\032:google/identity/accesscontextmanager/" + + "v1/access_level.proto\032;google/identity/a" + + "ccesscontextmanager/v1/access_policy.pro" + + "to\032?google/identity/accesscontextmanager" + + "/v1/service_perimeter.proto\032\031google/prot" + + "obuf/any.proto\032\034google/protobuf/struct.p" + + "roto\032\037google/protobuf/timestamp.proto\"\220\004" + + "\n\005Asset\022\014\n\004name\030\001 \001(\t\022\022\n\nasset_type\030\002 \001(" + + "\t\0228\n\010resource\030\003 \001(\0132&.google.cloud.asset" + + ".v1p5beta1.Resource\022)\n\niam_policy\030\004 \001(\0132" + + "\025.google.iam.v1.Policy\0225\n\norg_policy\030\006 \003" + + "(\0132!.google.cloud.orgpolicy.v1.Policy\022N\n" + + "\raccess_policy\030\007 \001(\01325.google.identity.a" + + "ccesscontextmanager.v1.AccessPolicyH\000\022L\n" + + "\014access_level\030\010 \001(\01324.google.identity.ac" + + "cesscontextmanager.v1.AccessLevelH\000\022V\n\021s" + + "ervice_perimeter\030\t \001(\01329.google.identity" + + ".accesscontextmanager.v1.ServicePerimete" + + "rH\000\022\021\n\tancestors\030\n \003(\t:\'\352A$\n\037cloudasset." + + "googleapis.com/Asset\022\001*B\027\n\025access_contex" + + "t_policy\"\240\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.StructB\264\001\n com.google.cloud.asset.v" + + "1p5beta1B\nAssetProtoP\001ZAgoogle.golang.or" + + "g/genproto/googleapis/cloud/asset/v1p5be" + + "ta1;asset\370\001\001\252\002\034Google.Cloud.Asset.V1p5Be" + + "ta1\312\002\034Google\\Cloud\\Asset\\V1p5beta1b\006prot" + + "o3" + }; + 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.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_v1p5beta1_Asset_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_asset_v1p5beta1_Asset_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p5beta1_Asset_descriptor, + new java.lang.String[] { + "Name", + "AssetType", + "Resource", + "IamPolicy", + "OrgPolicy", + "AccessPolicy", + "AccessLevel", + "ServicePerimeter", + "Ancestors", + "AccessContextPolicy", + }); + internal_static_google_cloud_asset_v1p5beta1_Resource_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_asset_v1p5beta1_Resource_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p5beta1_Resource_descriptor, + new java.lang.String[] { + "Version", "DiscoveryDocumentUri", "DiscoveryName", "ResourceUrl", "Parent", "Data", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.ResourceProto.resource); + 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.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-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceProto.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceProto.java new file mode 100644 index 000000000..608622bdb --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/AssetServiceProto.java @@ -0,0 +1,120 @@ +/* + * 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/v1p5beta1/asset_service.proto + +package com.google.cloud.asset.v1p5beta1; + +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_v1p5beta1_ListAssetsRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_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/v1p5beta1/asset_ser" + + "vice.proto\022\034google.cloud.asset.v1p5beta1" + + "\032\034google/api/annotations.proto\032\027google/a" + + "pi/client.proto\032\037google/api/field_behavi" + + "or.proto\032)google/cloud/asset/v1p5beta1/a" + + "ssets.proto\032\037google/protobuf/timestamp.p" + + "roto\"\324\001\n\021ListAssetsRequest\022\023\n\006parent\030\001 \001" + + "(\tB\003\340A\002\022-\n\tread_time\030\002 \001(\0132\032.google.prot" + + "obuf.Timestamp\022\023\n\013asset_types\030\003 \003(\t\022?\n\014c" + + "ontent_type\030\004 \001(\0162).google.cloud.asset.v" + + "1p5beta1.ContentType\022\021\n\tpage_size\030\005 \001(\005\022" + + "\022\n\npage_token\030\006 \001(\t\"\221\001\n\022ListAssetsRespon" + + "se\022-\n\tread_time\030\001 \001(\0132\032.google.protobuf." + + "Timestamp\0223\n\006assets\030\002 \003(\0132#.google.cloud" + + ".asset.v1p5beta1.Asset\022\027\n\017next_page_toke" + + "n\030\003 \001(\t*l\n\013ContentType\022\034\n\030CONTENT_TYPE_U" + + "NSPECIFIED\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\0052\367\001" + + "\n\014AssetService\022\227\001\n\nListAssets\022/.google.c" + + "loud.asset.v1p5beta1.ListAssetsRequest\0320" + + ".google.cloud.asset.v1p5beta1.ListAssets" + + "Response\"&\202\323\344\223\002 \022\036/v1p5beta1/{parent=*/*" + + "}/assets\032M\312A\031cloudasset.googleapis.com\322A" + + ".https://www.googleapis.com/auth/cloud-p" + + "latformB\270\001\n com.google.cloud.asset.v1p5b" + + "eta1B\021AssetServiceProtoP\001ZAgoogle.golang" + + ".org/genproto/googleapis/cloud/asset/v1p" + + "5beta1;asset\252\002\034Google.Cloud.Asset.V1P5Be" + + "ta1\312\002\034Google\\Cloud\\Asset\\V1p5beta1b\006prot" + + "o3" + }; + 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.cloud.asset.v1p5beta1.AssetProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_descriptor, + new java.lang.String[] { + "Parent", "ReadTime", "AssetTypes", "ContentType", "PageSize", "PageToken", + }); + internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_descriptor, + new java.lang.String[] { + "ReadTime", "Assets", "NextPageToken", + }); + 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); + 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.cloud.asset.v1p5beta1.AssetProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ContentType.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ContentType.java new file mode 100644 index 000000000..fed8739eb --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ContentType.java @@ -0,0 +1,220 @@ +/* + * 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/v1p5beta1/asset_service.proto + +package com.google.cloud.asset.v1p5beta1; + +/** + * + * + *
+ * Asset content type.
+ * 
+ * + * Protobuf enum {@code google.cloud.asset.v1p5beta1.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 mananger Policy set on an asset.
+   * 
+ * + * ACCESS_POLICY = 5; + */ + ACCESS_POLICY(5), + 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 mananger Policy set on an asset.
+   * 
+ * + * ACCESS_POLICY = 5; + */ + public static final int ACCESS_POLICY_VALUE = 5; + + 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; + 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.v1p5beta1.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.v1p5beta1.ContentType) +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequest.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequest.java new file mode 100644 index 000000000..38cd8c887 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequest.java @@ -0,0 +1,1751 @@ +/* + * 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/v1p5beta1/asset_service.proto + +package com.google.cloud.asset.v1p5beta1; + +/** + * + * + *
+ * ListAssets request.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.ListAssetsRequest} + */ +public final class ListAssetsRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p5beta1.ListAssetsRequest) + ListAssetsRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsRequest.newBuilder() to construct. + private ListAssetsRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsRequest() { + parent_ = ""; + assetTypes_ = com.google.protobuf.LazyStringArrayList.EMPTY; + contentType_ = 0; + pageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssetsRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsRequest( + 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 40: + { + pageSize_ = input.readInt32(); + break; + } + case 50: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = 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(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.ListAssetsRequest.class, + com.google.cloud.asset.v1p5beta1.ListAssetsRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. Name of the organization or project the assets belong to. Format:
+   * "organizations/[organization-number]" (such as "organizations/123"),
+   * "projects/[project-number]" (such as "projects/my-project-id"), or
+   * "projects/[project-id]" (such as "projects/12345").
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. Name of the organization or project the assets belong to. Format:
+   * "organizations/[organization-number]" (such as "organizations/123"),
+   * "projects/[project-number]" (such as "projects/my-project-id"), or
+   * "projects/[project-id]" (such as "projects/12345").
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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.v1p5beta1.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.v1p5beta1.ContentType content_type = 4; + * + * @return The contentType. + */ + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ContentType getContentType() { + @SuppressWarnings("deprecation") + com.google.cloud.asset.v1p5beta1.ContentType result = + com.google.cloud.asset.v1p5beta1.ContentType.valueOf(contentType_); + return result == null ? com.google.cloud.asset.v1p5beta1.ContentType.UNRECOGNIZED : result; + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 5; + private int pageSize_; + /** + * + * + *
+   * The maximum number of assets to be returned in a single response. Default
+   * is 100, minimum is 1, and maximum is 1000.
+   * 
+ * + * int32 page_size = 5; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 6; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+   * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+   * prior `ListAssets` call, and the API should return the next page of assets.
+   * 
+ * + * string page_token = 6; + * + * @return The pageToken. + */ + @java.lang.Override + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+   * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+   * prior `ListAssets` call, and the API should return the next page of assets.
+   * 
+ * + * string page_token = 6; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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.v1p5beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, contentType_); + } + if (pageSize_ != 0) { + output.writeInt32(5, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, pageToken_); + } + 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.v1p5beta1.ContentType.CONTENT_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, contentType_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, pageToken_); + } + 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.v1p5beta1.ListAssetsRequest)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p5beta1.ListAssetsRequest other = + (com.google.cloud.asset.v1p5beta1.ListAssetsRequest) 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 (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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_; + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest 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.v1p5beta1.ListAssetsRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest 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.v1p5beta1.ListAssetsRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest 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.v1p5beta1.ListAssetsRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest 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.v1p5beta1.ListAssetsRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest 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.v1p5beta1.ListAssetsRequest 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; + } + /** + * + * + *
+   * ListAssets request.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.ListAssetsRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p5beta1.ListAssetsRequest) + com.google.cloud.asset.v1p5beta1.ListAssetsRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.ListAssetsRequest.class, + com.google.cloud.asset.v1p5beta1.ListAssetsRequest.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p5beta1.ListAssetsRequest.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; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ListAssetsRequest getDefaultInstanceForType() { + return com.google.cloud.asset.v1p5beta1.ListAssetsRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ListAssetsRequest build() { + com.google.cloud.asset.v1p5beta1.ListAssetsRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ListAssetsRequest buildPartial() { + com.google.cloud.asset.v1p5beta1.ListAssetsRequest result = + new com.google.cloud.asset.v1p5beta1.ListAssetsRequest(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_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + 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.v1p5beta1.ListAssetsRequest) { + return mergeFrom((com.google.cloud.asset.v1p5beta1.ListAssetsRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p5beta1.ListAssetsRequest other) { + if (other == com.google.cloud.asset.v1p5beta1.ListAssetsRequest.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.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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.v1p5beta1.ListAssetsRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p5beta1.ListAssetsRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. Name of the organization or project the assets belong to. Format:
+     * "organizations/[organization-number]" (such as "organizations/123"),
+     * "projects/[project-number]" (such as "projects/my-project-id"), or
+     * "projects/[project-id]" (such as "projects/12345").
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. Name of the organization or project the assets belong to. Format:
+     * "organizations/[organization-number]" (such as "organizations/123"),
+     * "projects/[project-number]" (such as "projects/my-project-id"), or
+     * "projects/[project-id]" (such as "projects/12345").
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. Name of the organization or project the assets belong to. Format:
+     * "organizations/[organization-number]" (such as "organizations/123"),
+     * "projects/[project-number]" (such as "projects/my-project-id"), or
+     * "projects/[project-id]" (such as "projects/12345").
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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. Name of the organization or project the assets belong to. Format:
+     * "organizations/[organization-number]" (such as "organizations/123"),
+     * "projects/[project-number]" (such as "projects/my-project-id"), or
+     * "projects/[project-id]" (such as "projects/12345").
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Name of the organization or project the assets belong to. Format:
+     * "organizations/[organization-number]" (such as "organizations/123"),
+     * "projects/[project-number]" (such as "projects/my-project-id"), or
+     * "projects/[project-id]" (such as "projects/12345").
+     * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+     * "compute.googleapis.com/Disk". If specified, only matching assets will be
+     * returned. See [Introduction to Cloud Asset
+     * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.ContentType content_type = 4; + * + * @return The contentType. + */ + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ContentType getContentType() { + @SuppressWarnings("deprecation") + com.google.cloud.asset.v1p5beta1.ContentType result = + com.google.cloud.asset.v1p5beta1.ContentType.valueOf(contentType_); + return result == null ? com.google.cloud.asset.v1p5beta1.ContentType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Asset content type. If not specified, no content but the asset name will
+     * be returned.
+     * 
+ * + * .google.cloud.asset.v1p5beta1.ContentType content_type = 4; + * + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType(com.google.cloud.asset.v1p5beta1.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.v1p5beta1.ContentType content_type = 4; + * + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = 0; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * The maximum number of assets to be returned in a single response. Default
+     * is 100, minimum is 1, and maximum is 1000.
+     * 
+ * + * int32 page_size = 5; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of assets to be returned in a single response. Default
+     * is 100, minimum is 1, and maximum is 1000.
+     * 
+ * + * int32 page_size = 5; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The maximum number of assets to be returned in a single response. Default
+     * is 100, minimum is 1, and maximum is 1000.
+     * 
+ * + * int32 page_size = 5; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+     * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+     * prior `ListAssets` call, and the API should return the next page of assets.
+     * 
+ * + * string page_token = 6; + * + * @return The pageToken. + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+     * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+     * prior `ListAssets` call, and the API should return the next page of assets.
+     * 
+ * + * string page_token = 6; + * + * @return The bytes for pageToken. + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+     * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+     * prior `ListAssets` call, and the API should return the next page of assets.
+     * 
+ * + * string page_token = 6; + * + * @param value The pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+     * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+     * prior `ListAssets` call, and the API should return the next page of assets.
+     * 
+ * + * string page_token = 6; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+     * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+     * prior `ListAssets` call, and the API should return the next page of assets.
+     * 
+ * + * string page_token = 6; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = value; + onChanged(); + return this; + } + + @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.v1p5beta1.ListAssetsRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p5beta1.ListAssetsRequest) + private static final com.google.cloud.asset.v1p5beta1.ListAssetsRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p5beta1.ListAssetsRequest(); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsRequest(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.v1p5beta1.ListAssetsRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequestOrBuilder.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequestOrBuilder.java new file mode 100644 index 000000000..2268b978f --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsRequestOrBuilder.java @@ -0,0 +1,240 @@ +/* + * 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/v1p5beta1/asset_service.proto + +package com.google.cloud.asset.v1p5beta1; + +public interface ListAssetsRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p5beta1.ListAssetsRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Name of the organization or project the assets belong to. Format:
+   * "organizations/[organization-number]" (such as "organizations/123"),
+   * "projects/[project-number]" (such as "projects/my-project-id"), or
+   * "projects/[project-id]" (such as "projects/12345").
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. Name of the organization or project the assets belong to. Format:
+   * "organizations/[organization-number]" (such as "organizations/123"),
+   * "projects/[project-number]" (such as "projects/my-project-id"), or
+   * "projects/[project-id]" (such as "projects/12345").
+   * 
+ * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 2018-10-02 UTC (inclusive) and the current time. 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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/overview)
+   * for all supported asset types.
+   * 
+ * + * repeated string asset_types = 3; + * + * @return The count of assetTypes. + */ + int getAssetTypesCount(); + /** + * + * + *
+   * A list of asset types of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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 of which to take a snapshot for. For  example:
+   * "compute.googleapis.com/Disk". If specified, only matching assets will be
+   * returned. See [Introduction to Cloud Asset
+   * Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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.v1p5beta1.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.v1p5beta1.ContentType content_type = 4; + * + * @return The contentType. + */ + com.google.cloud.asset.v1p5beta1.ContentType getContentType(); + + /** + * + * + *
+   * The maximum number of assets to be returned in a single response. Default
+   * is 100, minimum is 1, and maximum is 1000.
+   * 
+ * + * int32 page_size = 5; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+   * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+   * prior `ListAssets` call, and the API should return the next page of assets.
+   * 
+ * + * string page_token = 6; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The `next_page_token` returned from the previous `ListAssetsResponse`, or
+   * unspecified for the first `ListAssetsRequest`. It is a continuation of a
+   * prior `ListAssets` call, and the API should return the next page of assets.
+   * 
+ * + * string page_token = 6; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponse.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponse.java new file mode 100644 index 000000000..ce21a98bf --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponse.java @@ -0,0 +1,1402 @@ +/* + * 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/v1p5beta1/asset_service.proto + +package com.google.cloud.asset.v1p5beta1; + +/** + * + * + *
+ * ListAssets response.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.ListAssetsResponse} + */ +public final class ListAssetsResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p5beta1.ListAssetsResponse) + ListAssetsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListAssetsResponse.newBuilder() to construct. + private ListAssetsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListAssetsResponse() { + assets_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListAssetsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListAssetsResponse( + 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.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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + assets_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + assets_.add( + input.readMessage( + com.google.cloud.asset.v1p5beta1.Asset.parser(), extensionRegistry)); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + 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.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.ListAssetsResponse.class, + com.google.cloud.asset.v1p5beta1.ListAssetsResponse.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 ASSETS_FIELD_NUMBER = 2; + private java.util.List assets_; + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + @java.lang.Override + public java.util.List getAssetsList() { + return assets_; + } + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + @java.lang.Override + public java.util.List + getAssetsOrBuilderList() { + return assets_; + } + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + @java.lang.Override + public int getAssetsCount() { + return assets_.size(); + } + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Asset getAssets(int index) { + return assets_.get(index); + } + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.AssetOrBuilder getAssetsOrBuilder(int index) { + return assets_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results. Set to empty if there are no
+   * remaining results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results. Set to empty if there are no
+   * remaining results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (readTime_ != null) { + output.writeMessage(1, getReadTime()); + } + for (int i = 0; i < assets_.size(); i++) { + output.writeMessage(2, assets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); + } + 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()); + } + for (int i = 0; i < assets_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, assets_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, nextPageToken_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.asset.v1p5beta1.ListAssetsResponse)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p5beta1.ListAssetsResponse other = + (com.google.cloud.asset.v1p5beta1.ListAssetsResponse) obj; + + if (hasReadTime() != other.hasReadTime()) return false; + if (hasReadTime()) { + if (!getReadTime().equals(other.getReadTime())) return false; + } + if (!getAssetsList().equals(other.getAssetsList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasReadTime()) { + hash = (37 * hash) + READ_TIME_FIELD_NUMBER; + hash = (53 * hash) + getReadTime().hashCode(); + } + if (getAssetsCount() > 0) { + hash = (37 * hash) + ASSETS_FIELD_NUMBER; + hash = (53 * hash) + getAssetsList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse 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.v1p5beta1.ListAssetsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse 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.v1p5beta1.ListAssetsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse 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.v1p5beta1.ListAssetsResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse 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.v1p5beta1.ListAssetsResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse 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.v1p5beta1.ListAssetsResponse 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; + } + /** + * + * + *
+   * ListAssets response.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.ListAssetsResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p5beta1.ListAssetsResponse) + com.google.cloud.asset.v1p5beta1.ListAssetsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.ListAssetsResponse.class, + com.google.cloud.asset.v1p5beta1.ListAssetsResponse.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p5beta1.ListAssetsResponse.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 (readTimeBuilder_ == null) { + readTime_ = null; + } else { + readTime_ = null; + readTimeBuilder_ = null; + } + if (assetsBuilder_ == null) { + assets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + assetsBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p5beta1.AssetServiceProto + .internal_static_google_cloud_asset_v1p5beta1_ListAssetsResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ListAssetsResponse getDefaultInstanceForType() { + return com.google.cloud.asset.v1p5beta1.ListAssetsResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ListAssetsResponse build() { + com.google.cloud.asset.v1p5beta1.ListAssetsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.ListAssetsResponse buildPartial() { + com.google.cloud.asset.v1p5beta1.ListAssetsResponse result = + new com.google.cloud.asset.v1p5beta1.ListAssetsResponse(this); + int from_bitField0_ = bitField0_; + if (readTimeBuilder_ == null) { + result.readTime_ = readTime_; + } else { + result.readTime_ = readTimeBuilder_.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(); + } + result.nextPageToken_ = nextPageToken_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.asset.v1p5beta1.ListAssetsResponse) { + return mergeFrom((com.google.cloud.asset.v1p5beta1.ListAssetsResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p5beta1.ListAssetsResponse other) { + if (other == com.google.cloud.asset.v1p5beta1.ListAssetsResponse.getDefaultInstance()) + return this; + if (other.hasReadTime()) { + mergeReadTime(other.getReadTime()); + } + 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_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.cloud.asset.v1p5beta1.ListAssetsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.cloud.asset.v1p5beta1.ListAssetsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + 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 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.v1p5beta1.Asset, + com.google.cloud.asset.v1p5beta1.Asset.Builder, + com.google.cloud.asset.v1p5beta1.AssetOrBuilder> + assetsBuilder_; + + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public java.util.List getAssetsList() { + if (assetsBuilder_ == null) { + return java.util.Collections.unmodifiableList(assets_); + } else { + return assetsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public int getAssetsCount() { + if (assetsBuilder_ == null) { + return assets_.size(); + } else { + return assetsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public com.google.cloud.asset.v1p5beta1.Asset getAssets(int index) { + if (assetsBuilder_ == null) { + return assets_.get(index); + } else { + return assetsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder setAssets(int index, com.google.cloud.asset.v1p5beta1.Asset value) { + if (assetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetsIsMutable(); + assets_.set(index, value); + onChanged(); + } else { + assetsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder setAssets( + int index, com.google.cloud.asset.v1p5beta1.Asset.Builder builderForValue) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.set(index, builderForValue.build()); + onChanged(); + } else { + assetsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder addAssets(com.google.cloud.asset.v1p5beta1.Asset value) { + if (assetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetsIsMutable(); + assets_.add(value); + onChanged(); + } else { + assetsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder addAssets(int index, com.google.cloud.asset.v1p5beta1.Asset value) { + if (assetsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAssetsIsMutable(); + assets_.add(index, value); + onChanged(); + } else { + assetsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder addAssets(com.google.cloud.asset.v1p5beta1.Asset.Builder builderForValue) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.add(builderForValue.build()); + onChanged(); + } else { + assetsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder addAssets( + int index, com.google.cloud.asset.v1p5beta1.Asset.Builder builderForValue) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.add(index, builderForValue.build()); + onChanged(); + } else { + assetsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset 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; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder clearAssets() { + if (assetsBuilder_ == null) { + assets_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + assetsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public Builder removeAssets(int index) { + if (assetsBuilder_ == null) { + ensureAssetsIsMutable(); + assets_.remove(index); + onChanged(); + } else { + assetsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public com.google.cloud.asset.v1p5beta1.Asset.Builder getAssetsBuilder(int index) { + return getAssetsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public com.google.cloud.asset.v1p5beta1.AssetOrBuilder getAssetsOrBuilder(int index) { + if (assetsBuilder_ == null) { + return assets_.get(index); + } else { + return assetsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public java.util.List + getAssetsOrBuilderList() { + if (assetsBuilder_ != null) { + return assetsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(assets_); + } + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public com.google.cloud.asset.v1p5beta1.Asset.Builder addAssetsBuilder() { + return getAssetsFieldBuilder() + .addBuilder(com.google.cloud.asset.v1p5beta1.Asset.getDefaultInstance()); + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public com.google.cloud.asset.v1p5beta1.Asset.Builder addAssetsBuilder(int index) { + return getAssetsFieldBuilder() + .addBuilder(index, com.google.cloud.asset.v1p5beta1.Asset.getDefaultInstance()); + } + /** + * + * + *
+     * Assets.
+     * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + public java.util.List getAssetsBuilderList() { + return getAssetsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1p5beta1.Asset, + com.google.cloud.asset.v1p5beta1.Asset.Builder, + com.google.cloud.asset.v1p5beta1.AssetOrBuilder> + getAssetsFieldBuilder() { + if (assetsBuilder_ == null) { + assetsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.asset.v1p5beta1.Asset, + com.google.cloud.asset.v1p5beta1.Asset.Builder, + com.google.cloud.asset.v1p5beta1.AssetOrBuilder>( + assets_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + assets_ = null; + } + return assetsBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results. Set to empty if there are no
+     * remaining results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results. Set to empty if there are no
+     * remaining results.
+     * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results. Set to empty if there are no
+     * remaining results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results. Set to empty if there are no
+     * remaining results.
+     * 
+ * + * string next_page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results. Set to empty if there are no
+     * remaining results.
+     * 
+ * + * string next_page_token = 3; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.asset.v1p5beta1.ListAssetsResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p5beta1.ListAssetsResponse) + private static final com.google.cloud.asset.v1p5beta1.ListAssetsResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p5beta1.ListAssetsResponse(); + } + + public static com.google.cloud.asset.v1p5beta1.ListAssetsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListAssetsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListAssetsResponse(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.v1p5beta1.ListAssetsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponseOrBuilder.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponseOrBuilder.java new file mode 100644 index 000000000..0e39d6a33 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ListAssetsResponseOrBuilder.java @@ -0,0 +1,139 @@ +/* + * 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/v1p5beta1/asset_service.proto + +package com.google.cloud.asset.v1p5beta1; + +public interface ListAssetsResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p5beta1.ListAssetsResponse) + 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(); + + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + java.util.List getAssetsList(); + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + com.google.cloud.asset.v1p5beta1.Asset getAssets(int index); + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + int getAssetsCount(); + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + java.util.List + getAssetsOrBuilderList(); + /** + * + * + *
+   * Assets.
+   * 
+ * + * repeated .google.cloud.asset.v1p5beta1.Asset assets = 2; + */ + com.google.cloud.asset.v1p5beta1.AssetOrBuilder getAssetsOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results. Set to empty if there are no
+   * remaining results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results. Set to empty if there are no
+   * remaining results.
+   * 
+ * + * string next_page_token = 3; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Resource.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Resource.java new file mode 100644 index 000000000..62a8155f3 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/Resource.java @@ -0,0 +1,1753 @@ +/* + * 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/v1p5beta1/assets.proto + +package com.google.cloud.asset.v1p5beta1; + +/** + * + * + *
+ * Representation of a cloud resource.
+ * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.Resource} + */ +public final class Resource extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.asset.v1p5beta1.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_ = ""; + } + + @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; + } + 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.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.Resource.class, + com.google.cloud.asset.v1p5beta1.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.
+   * For example:
+   * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+   * It will be left unspecified for resources without a discovery-based API,
+   * 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.
+   * For example:
+   * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+   * It will be left unspecified for resources without a discovery-based API,
+   * 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". It will be left unspecified for resources (such as
+   * Cloud Bigtable) without a discovery-based API.
+   * 
+ * + * 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". It will be left unspecified for resources (such as
+   * Cloud Bigtable) without a discovery-based API.
+   * 
+ * + * 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 operation using this
+   * URL returns the resource itself.
+   * Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+   * It will be left 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 operation using this
+   * URL returns the resource itself.
+   * Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+   * It will be left 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * For example:
+   * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+   * For third-party assets, it is up to the users to define.
+   * 
+ * + * 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * For example:
+   * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+   * For third-party assets, it is up to the users to define.
+   * 
+ * + * 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 scrubbed
+   * away 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 scrubbed
+   * away 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 scrubbed
+   * away and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + */ + @java.lang.Override + public com.google.protobuf.StructOrBuilder getDataOrBuilder() { + return getData(); + } + + 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()); + } + 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()); + } + 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.v1p5beta1.Resource)) { + return super.equals(obj); + } + com.google.cloud.asset.v1p5beta1.Resource other = + (com.google.cloud.asset.v1p5beta1.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 (!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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.asset.v1p5beta1.Resource parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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.v1p5beta1.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; + } + /** + * + * + *
+   * Representation of a cloud resource.
+   * 
+ * + * Protobuf type {@code google.cloud.asset.v1p5beta1.Resource} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.asset.v1p5beta1.Resource) + com.google.cloud.asset.v1p5beta1.ResourceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Resource_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Resource_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.asset.v1p5beta1.Resource.class, + com.google.cloud.asset.v1p5beta1.Resource.Builder.class); + } + + // Construct using com.google.cloud.asset.v1p5beta1.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; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.asset.v1p5beta1.AssetProto + .internal_static_google_cloud_asset_v1p5beta1_Resource_descriptor; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Resource getDefaultInstanceForType() { + return com.google.cloud.asset.v1p5beta1.Resource.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Resource build() { + com.google.cloud.asset.v1p5beta1.Resource result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.asset.v1p5beta1.Resource buildPartial() { + com.google.cloud.asset.v1p5beta1.Resource result = + new com.google.cloud.asset.v1p5beta1.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(); + } + 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.v1p5beta1.Resource) { + return mergeFrom((com.google.cloud.asset.v1p5beta1.Resource) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.asset.v1p5beta1.Resource other) { + if (other == com.google.cloud.asset.v1p5beta1.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()); + } + 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.v1p5beta1.Resource parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.cloud.asset.v1p5beta1.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.
+     * For example:
+     * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+     * It will be left unspecified for resources without a discovery-based API,
+     * 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.
+     * For example:
+     * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+     * It will be left unspecified for resources without a discovery-based API,
+     * 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.
+     * For example:
+     * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+     * It will be left unspecified for resources without a discovery-based API,
+     * 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.
+     * For example:
+     * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+     * It will be left unspecified for resources without a discovery-based API,
+     * 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.
+     * For example:
+     * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+     * It will be left unspecified for resources without a discovery-based API,
+     * 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". It will be left unspecified for resources (such as
+     * Cloud Bigtable) without a discovery-based API.
+     * 
+ * + * 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". It will be left unspecified for resources (such as
+     * Cloud Bigtable) without a discovery-based API.
+     * 
+ * + * 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". It will be left unspecified for resources (such as
+     * Cloud Bigtable) without a discovery-based API.
+     * 
+ * + * 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". It will be left unspecified for resources (such as
+     * Cloud Bigtable) without a discovery-based API.
+     * 
+ * + * 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". It will be left unspecified for resources (such as
+     * Cloud Bigtable) without a discovery-based API.
+     * 
+ * + * 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 operation using this
+     * URL returns the resource itself.
+     * Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+     * It will be left 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 operation using this
+     * URL returns the resource itself.
+     * Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+     * It will be left 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 operation using this
+     * URL returns the resource itself.
+     * Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+     * It will be left 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 operation using this
+     * URL returns the resource itself.
+     * Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+     * It will be left 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 operation using this
+     * URL returns the resource itself.
+     * Example:
+     * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+     * It will be left 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * For example:
+     * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+     * For third-party assets, it is up to the users to define.
+     * 
+ * + * 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * For example:
+     * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+     * For third-party assets, it is up to the users to define.
+     * 
+ * + * 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * For example:
+     * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+     * For third-party assets, it is up to the users to define.
+     * 
+ * + * 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * For example:
+     * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+     * For third-party assets, it is up to the users to define.
+     * 
+ * + * 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+     * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+     * For example:
+     * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+     * For third-party assets, it is up to the users to define.
+     * 
+ * + * 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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 scrubbed
+     * away 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_; + } + + @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.v1p5beta1.Resource) + } + + // @@protoc_insertion_point(class_scope:google.cloud.asset.v1p5beta1.Resource) + private static final com.google.cloud.asset.v1p5beta1.Resource DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.asset.v1p5beta1.Resource(); + } + + public static com.google.cloud.asset.v1p5beta1.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.v1p5beta1.Resource getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ResourceOrBuilder.java b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ResourceOrBuilder.java new file mode 100644 index 000000000..72bcad395 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/java/com/google/cloud/asset/v1p5beta1/ResourceOrBuilder.java @@ -0,0 +1,224 @@ +/* + * 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/v1p5beta1/assets.proto + +package com.google.cloud.asset.v1p5beta1; + +public interface ResourceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.asset.v1p5beta1.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.
+   * For example:
+   * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+   * It will be left unspecified for resources without a discovery-based API,
+   * 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.
+   * For example:
+   * `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`.
+   * It will be left unspecified for resources without a discovery-based API,
+   * 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". It will be left unspecified for resources (such as
+   * Cloud Bigtable) without a discovery-based API.
+   * 
+ * + * string discovery_name = 3; + * + * @return The discoveryName. + */ + java.lang.String getDiscoveryName(); + /** + * + * + *
+   * The JSON schema name listed in the discovery document.
+   * Example: "Project". It will be left unspecified for resources (such as
+   * Cloud Bigtable) without a discovery-based API.
+   * 
+ * + * string discovery_name = 3; + * + * @return The bytes for discoveryName. + */ + com.google.protobuf.ByteString getDiscoveryNameBytes(); + + /** + * + * + *
+   * The REST URL for accessing the resource. An HTTP GET operation using this
+   * URL returns the resource itself.
+   * Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+   * It will be left 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 operation using this
+   * URL returns the resource itself.
+   * Example:
+   * `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`.
+   * It will be left 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * For example:
+   * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+   * For third-party assets, it is up to the users to define.
+   * 
+ * + * 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy
+   * hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy).
+   * For example:
+   * `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`.
+   * For third-party assets, it is up to the users to define.
+   * 
+ * + * string parent = 5; + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The content of the resource, in which some sensitive fields are scrubbed
+   * away 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 scrubbed
+   * away 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 scrubbed
+   * away and may not be present.
+   * 
+ * + * .google.protobuf.Struct data = 6; + */ + com.google.protobuf.StructOrBuilder getDataOrBuilder(); +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/asset_service.proto b/proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/asset_service.proto new file mode 100644 index 000000000..52233ad05 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/asset_service.proto @@ -0,0 +1,112 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.asset.v1p5beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/cloud/asset/v1p5beta1/assets.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Asset.V1P5Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetServiceProto"; +option java_package = "com.google.cloud.asset.v1p5beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1"; + +// 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"; + + // Lists assets with time and resource types and returns paged results in + // response. + rpc ListAssets(ListAssetsRequest) returns (ListAssetsResponse) { + option (google.api.http) = { + get: "/v1p5beta1/{parent=*/*}/assets" + }; + } +} + +// ListAssets request. +message ListAssetsRequest { + // Required. Name of the organization or project the assets belong to. Format: + // "organizations/[organization-number]" (such as "organizations/123"), + // "projects/[project-number]" (such as "projects/my-project-id"), or + // "projects/[project-id]" (such as "projects/12345"). + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // Timestamp to take an asset snapshot. This can only be set to a timestamp + // between 2018-10-02 UTC (inclusive) and the current time. 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 of which to take a snapshot for. For example: + // "compute.googleapis.com/Disk". If specified, only matching assets will be + // returned. See [Introduction to Cloud Asset + // Inventory](https://cloud.google.com/resource-manager/docs/cloud-asset-inventory/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; + + // The maximum number of assets to be returned in a single response. Default + // is 100, minimum is 1, and maximum is 1000. + int32 page_size = 5; + + // The `next_page_token` returned from the previous `ListAssetsResponse`, or + // unspecified for the first `ListAssetsRequest`. It is a continuation of a + // prior `ListAssets` call, and the API should return the next page of assets. + string page_token = 6; +} + +// 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 mananger Policy set on an asset. + ACCESS_POLICY = 5; +} + +// ListAssets response. +message ListAssetsResponse { + // Time the snapshot was taken. + google.protobuf.Timestamp read_time = 1; + + // Assets. + repeated Asset assets = 2; + + // Token to retrieve the next page of results. Set to empty if there are no + // remaining results. + string next_page_token = 3; +} diff --git a/proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/assets.proto b/proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/assets.proto new file mode 100644 index 000000000..b9d1e1991 --- /dev/null +++ b/proto-google-cloud-asset-v1p5beta1/src/main/proto/google/cloud/asset/v1p5beta1/assets.proto @@ -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 +// +// 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.v1p5beta1; + +import "google/api/annotations.proto"; +import "google/api/resource.proto"; +import "google/cloud/orgpolicy/v1/orgpolicy.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.V1p5Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/asset/v1p5beta1;asset"; +option java_multiple_files = true; +option java_outer_classname = "AssetProto"; +option java_package = "com.google.cloud.asset.v1p5beta1"; +option php_namespace = "Google\\Cloud\\Asset\\V1p5beta1"; + +// Cloud asset. This includes all Google Cloud Platform resources, +// Cloud IAM policies, and other non-GCP assets. +message Asset { + option (google.api.resource) = { + type: "cloudasset.googleapis.com/Asset" + pattern: "*" + }; + + // The full name of the asset. For 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; + + // Type of the asset. Example: "compute.googleapis.com/Disk". + string asset_type = 2; + + // Representation of the resource. + Resource resource = 3; + + // Representation of the actual Cloud IAM policy set on a cloud resource. For + // each resource, there must be at most one Cloud IAM policy set on it. + google.iam.v1.Policy iam_policy = 4; + + // Representation of the Cloud Organization Policy set on an asset. For each + // asset, there could be multiple Organization policies with different + // constraints. + repeated google.cloud.orgpolicy.v1.Policy org_policy = 6; + + // Representation of the Cloud Organization access policy. + oneof access_context_policy { + google.identity.accesscontextmanager.v1.AccessPolicy access_policy = 7; + + google.identity.accesscontextmanager.v1.AccessLevel access_level = 8; + + google.identity.accesscontextmanager.v1.ServicePerimeter service_perimeter = + 9; + } + + // Asset's ancestry path in Cloud Resource Manager (CRM) hierarchy, + // represented as a list of relative resource names. Ancestry path starts with + // the closest CRM ancestor and ends at root. If the asset is a CRM + // project/folder/organization, this starts from the asset itself. + // + // Example: ["projects/123456789", "folders/5432", "organizations/1234"] + repeated string ancestors = 10; +} + +// Representation of a cloud resource. +message Resource { + // The API version. Example: "v1". + string version = 1; + + // The URL of the discovery document containing the resource's JSON schema. + // For example: + // `"https://www.googleapis.com/discovery/v1/apis/compute/v1/rest"`. + // It will be left unspecified for resources without a discovery-based API, + // such as Cloud Bigtable. + string discovery_document_uri = 2; + + // The JSON schema name listed in the discovery document. + // Example: "Project". It will be left unspecified for resources (such as + // Cloud Bigtable) without a discovery-based API. + string discovery_name = 3; + + // The REST URL for accessing the resource. An HTTP GET operation using this + // URL returns the resource itself. + // Example: + // `https://cloudresourcemanager.googleapis.com/v1/projects/my-project-123`. + // It will be left 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 GCP assets, it is the parent resource defined in the [Cloud IAM policy + // hierarchy](https://cloud.google.com/iam/docs/overview#policy_hierarchy). + // For example: + // `"//cloudresourcemanager.googleapis.com/projects/my_project_123"`. + // + // For third-party assets, it is up to the users to define. + string parent = 5; + + // The content of the resource, in which some sensitive fields are scrubbed + // away and may not be present. + google.protobuf.Struct data = 6; +} diff --git a/synth.metadata b/synth.metadata index f8b0d9379..f5aa503e6 100644 --- a/synth.metadata +++ b/synth.metadata @@ -4,54 +4,62 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/java-asset.git", - "sha": "5ea164b86c15ee444c285699e76ebc5ea2b64d62" + "sha": "0ff54327bffe1b7a74d822c78e90729f82a89956" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8385a4863e19248b71dd1cbe0df5ff51c7a3c3e", - "internalRef": "317872667" + "sha": "4d8706453bf6016ebf1bb241d78b4dc58c92064d", + "internalRef": "320022685" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8385a4863e19248b71dd1cbe0df5ff51c7a3c3e", - "internalRef": "317872667" + "sha": "4d8706453bf6016ebf1bb241d78b4dc58c92064d", + "internalRef": "320022685" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8385a4863e19248b71dd1cbe0df5ff51c7a3c3e", - "internalRef": "317872667" + "sha": "4d8706453bf6016ebf1bb241d78b4dc58c92064d", + "internalRef": "320022685" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8385a4863e19248b71dd1cbe0df5ff51c7a3c3e", - "internalRef": "317872667" + "sha": "4d8706453bf6016ebf1bb241d78b4dc58c92064d", + "internalRef": "320022685" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "e8385a4863e19248b71dd1cbe0df5ff51c7a3c3e", - "internalRef": "317872667" + "sha": "4d8706453bf6016ebf1bb241d78b4dc58c92064d", + "internalRef": "320022685" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4d8706453bf6016ebf1bb241d78b4dc58c92064d", + "internalRef": "320022685" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "c4f3059c27591eb24d6942a0e357ec94c80459f2" + "sha": "d53e4b70cf091cba04362c2fac3cda0546121641" } } ], @@ -100,6 +108,15 @@ "language": "java", "generator": "bazel" } + }, + { + "client": { + "source": "googleapis", + "apiName": "asset", + "apiVersion": "v1p5beta1", + "language": "java", + "generator": "bazel" + } } ] } \ No newline at end of file diff --git a/synth.py b/synth.py index e3445d4b8..ed6afd39b 100644 --- a/synth.py +++ b/synth.py @@ -19,7 +19,7 @@ AUTOSYNTH_MULTIPLE_COMMITS = True service = 'asset' -versions = ['v1', 'v1beta1', 'v1p2beta1', 'v1p1beta1', 'v1p4beta1'] +versions = ['v1', 'v1beta1', 'v1p2beta1', 'v1p1beta1', 'v1p4beta1', 'v1p5beta1'] for version in versions: library = java.bazel_library( diff --git a/versions.txt b/versions.txt index 913796481..eae161770 100644 --- a/versions.txt +++ b/versions.txt @@ -6,9 +6,11 @@ proto-google-cloud-asset-v1p1beta1:0.89.0:0.89.1-SNAPSHOT proto-google-cloud-asset-v1p2beta1:0.89.0:0.89.1-SNAPSHOT proto-google-cloud-asset-v1beta1:0.89.0:0.89.1-SNAPSHOT proto-google-cloud-asset-v1p4beta1:0.89.0:0.89.1-SNAPSHOT +proto-google-cloud-asset-v1p5beta1:0.89.0:0.89.1-SNAPSHOT grpc-google-cloud-asset-v1:1.4.0:1.4.1-SNAPSHOT grpc-google-cloud-asset-v1beta1:0.89.0:0.89.1-SNAPSHOT grpc-google-cloud-asset-v1p1beta1:0.89.0:0.89.1-SNAPSHOT grpc-google-cloud-asset-v1p2beta1:0.89.0:0.89.1-SNAPSHOT grpc-google-cloud-asset-v1p4beta1:0.89.0:0.89.1-SNAPSHOT +grpc-google-cloud-asset-v1p5beta1:0.89.0:0.89.1-SNAPSHOT google-cloud-asset:1.4.0:1.4.1-SNAPSHOT \ No newline at end of file