diff --git a/google-cloud-asset-bom/pom.xml b/google-cloud-asset-bom/pom.xml
index e3f7cfd5a..8829abb63 100644
--- a/google-cloud-asset-bom/pom.xml
+++ b/google-cloud-asset-bom/pom.xml
@@ -1,4 +1,4 @@
-
+
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ExportAssetsRequest request = + * ExportAssetsRequest.newBuilder() + * .setParent("ExportAssetsRequest-846449128".toString()) + * .setReadTime(Timestamp.newBuilder().build()) + * .addAllAssetTypes(new ArrayList+ * + *()) + * .setContentType(ContentType.forNumber(0)) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList ()) + * .build(); + * ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get(); + * } + * }
Note: close() needs to be called on the AssetServiceClient object to clean up resources such + * as threads. In the example above, try-with-resources is used, which automatically calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of AssetServiceSettings to + * create(). For example: + * + *
To customize credentials: + * + *
{@code + * AssetServiceSettings assetServiceSettings = + * AssetServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * AssetServiceSettings assetServiceSettings = + * AssetServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * AssetServiceClient assetServiceClient = AssetServiceClient.create(assetServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class AssetServiceClient implements BackgroundResource { + private final AssetServiceSettings settings; + private final AssetServiceStub stub; + private final OperationsClient operationsClient; + + /** Constructs an instance of AssetServiceClient with default settings. */ + public static final AssetServiceClient create() throws IOException { + return create(AssetServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of AssetServiceClient, using the given settings. The channels are + * created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final AssetServiceClient create(AssetServiceSettings settings) throws IOException { + return new AssetServiceClient(settings); + } + + /** + * Constructs an instance of AssetServiceClient, using the given stub for making calls. This is + * for advanced usage - prefer using create(AssetServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final AssetServiceClient create(AssetServiceStub stub) { + return new AssetServiceClient(stub); + } + + /** + * Constructs an instance of AssetServiceClient, using the given settings. This is protected so + * that it is easy to make a subclass, but otherwise, the static factory methods should be + * preferred. + */ + protected AssetServiceClient(AssetServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((AssetServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected AssetServiceClient(AssetServiceStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = OperationsClient.create(this.stub.getOperationsStub()); + } + + public final AssetServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public AssetServiceStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final OperationsClient getOperationsClient() { + return operationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. + * For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line + * represents a [google.cloud.asset.v1p7beta1.Asset][google.cloud.asset.v1p7beta1.Asset] in the + * JSON format; for BigQuery table destinations, the output table stores the fields in asset proto + * as columns. This API implements the + * [google.longrunning.Operation][google.longrunning.Operation] API , which allows you to keep + * track of the export. We recommend intervals of at least 2 seconds with exponential retry to + * poll the export operation result. For regular-size resource parent, the export operation + * usually finishes within 5 minutes. + * + *
Sample code: + * + *
{@code + * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ExportAssetsRequest request = + * ExportAssetsRequest.newBuilder() + * .setParent("ExportAssetsRequest-846449128".toString()) + * .setReadTime(Timestamp.newBuilder().build()) + * .addAllAssetTypes(new ArrayList+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture()) + * .setContentType(ContentType.forNumber(0)) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList ()) + * .build(); + * ExportAssetsResponse response = assetServiceClient.exportAssetsAsync(request).get(); + * } + * }
Sample code: + * + *
{@code + * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ExportAssetsRequest request = + * ExportAssetsRequest.newBuilder() + * .setParent("ExportAssetsRequest-846449128".toString()) + * .setReadTime(Timestamp.newBuilder().build()) + * .addAllAssetTypes(new ArrayList+ */ + public final OperationCallable()) + * .setContentType(ContentType.forNumber(0)) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList ()) + * .build(); + * OperationFuture future = + * assetServiceClient.exportAssetsOperationCallable().futureCall(request); + * // Do something. + * ExportAssetsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) { + * ExportAssetsRequest request = + * ExportAssetsRequest.newBuilder() + * .setParent("ExportAssetsRequest-846449128".toString()) + * .setReadTime(Timestamp.newBuilder().build()) + * .addAllAssetTypes(new ArrayList+ */ + public final UnaryCallable()) + * .setContentType(ContentType.forNumber(0)) + * .setOutputConfig(OutputConfig.newBuilder().build()) + * .addAllRelationshipTypes(new ArrayList ()) + * .build(); + * ApiFuture future = assetServiceClient.exportAssetsCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of exportAssets to 30 seconds: + * + *
{@code + * AssetServiceSettings.Builder assetServiceSettingsBuilder = AssetServiceSettings.newBuilder(); + * assetServiceSettingsBuilder + * .exportAssetsSettings() + * .setRetrySettings( + * assetServiceSettingsBuilder + * .exportAssetsSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * AssetServiceSettings assetServiceSettings = assetServiceSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class AssetServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= AssetServiceClient =======================
+ *
+ * Service Description: Asset service definition.
+ *
+ * Sample for AssetServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class AssetServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ throw new UnsupportedOperationException("Not implemented: getOperationsStub()");
+ }
+
+ public OperationCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of exportAssets to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcAssetServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcAssetServiceStub extends AssetServiceStub {
+ private static final MethodDescriptor{@code
+ * try (AssetServiceClient assetServiceClient = AssetServiceClient.create()) {
+ * ExportAssetsRequest request =
+ * ExportAssetsRequest.newBuilder()
+ * .setParent(ProjectName.of("[PROJECT]").toString())
+ * .setReadTime(Timestamp.newBuilder().build())
+ * .addAllAssetTypes(new ArrayList
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.asset.v1p7beta1;
+
+import javax.annotation.Generated;
diff --git a/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java
new file mode 100644
index 000000000..7846b8925
--- /dev/null
+++ b/google-cloud-asset/src/main/java/com/google/cloud/asset/v1p7beta1/stub/AssetServiceStub.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.asset.v1p7beta1.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.asset.v1p7beta1.ExportAssetsRequest;
+import com.google.cloud.asset.v1p7beta1.ExportAssetsResponse;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the AssetService service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * AssetServiceStubSettings.Builder assetServiceSettingsBuilder =
+ * AssetServiceStubSettings.newBuilder();
+ * assetServiceSettingsBuilder
+ * .exportAssetsSettings()
+ * .setRetrySettings(
+ * assetServiceSettingsBuilder
+ * .exportAssetsSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * AssetServiceStubSettings assetServiceSettings = assetServiceSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class AssetServiceStubSettings extends StubSettings