diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java new file mode 100644 index 00000000..ae1f417f --- /dev/null +++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/OsConfigZonalServiceClient.java @@ -0,0 +1,901 @@ +/* + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.osconfig.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.osconfig.v1.stub.OsConfigZonalServiceStub; +import com.google.cloud.osconfig.v1.stub.OsConfigZonalServiceStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Zonal OS Config API + * + *
The OS Config service is the server-side component that allows users to manage package + * installations and patch jobs for Compute Engine VM instances. + * + *
This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Inventory response = osConfigZonalServiceClient.getInventory(name); + * } + * }+ * + *
Note: close() needs to be called on the OsConfigZonalServiceClient object to clean up + * resources such as threads. In the example above, try-with-resources is used, which automatically + * calls close(). + * + *
The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *
See the individual methods for example code. + * + *
Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *
This class can be customized by passing in a custom instance of OsConfigZonalServiceSettings + * to create(). For example: + * + *
To customize credentials: + * + *
{@code + * OsConfigZonalServiceSettings osConfigZonalServiceSettings = + * OsConfigZonalServiceSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create(osConfigZonalServiceSettings); + * }+ * + *
To customize the endpoint: + * + *
{@code + * OsConfigZonalServiceSettings osConfigZonalServiceSettings = + * OsConfigZonalServiceSettings.newBuilder().setEndpoint(myEndpoint).build(); + * OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create(osConfigZonalServiceSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class OsConfigZonalServiceClient implements BackgroundResource { + private final OsConfigZonalServiceSettings settings; + private final OsConfigZonalServiceStub stub; + + /** Constructs an instance of OsConfigZonalServiceClient with default settings. */ + public static final OsConfigZonalServiceClient create() throws IOException { + return create(OsConfigZonalServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of OsConfigZonalServiceClient, using the given settings. The channels + * are created based on the settings passed in, or defaults for any settings that are not set. + */ + public static final OsConfigZonalServiceClient create(OsConfigZonalServiceSettings settings) + throws IOException { + return new OsConfigZonalServiceClient(settings); + } + + /** + * Constructs an instance of OsConfigZonalServiceClient, using the given stub for making calls. + * This is for advanced usage - prefer using create(OsConfigZonalServiceSettings). + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final OsConfigZonalServiceClient create(OsConfigZonalServiceStub stub) { + return new OsConfigZonalServiceClient(stub); + } + + /** + * Constructs an instance of OsConfigZonalServiceClient, using the given settings. This is + * protected so that it is easy to make a subclass, but otherwise, the static factory methods + * should be preferred. + */ + protected OsConfigZonalServiceClient(OsConfigZonalServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((OsConfigZonalServiceStubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected OsConfigZonalServiceClient(OsConfigZonalServiceStub stub) { + this.settings = null; + this.stub = stub; + } + + public final OsConfigZonalServiceSettings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public OsConfigZonalServiceStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * Inventory response = osConfigZonalServiceClient.getInventory(name); + * } + * }+ * + * @param name Required. API resource name for inventory resource. + *
Format: `projects/{project}/locations/{location}/instances/{instance}/inventory` + *
For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Inventory getInventory(InventoryName name) { + GetInventoryRequest request = + GetInventoryRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * String name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * Inventory response = osConfigZonalServiceClient.getInventory(name); + * } + * }+ * + * @param name Required. API resource name for inventory resource. + *
Format: `projects/{project}/locations/{location}/instances/{instance}/inventory` + *
For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Inventory getInventory(String name) { + GetInventoryRequest request = GetInventoryRequest.newBuilder().setName(name).build(); + return getInventory(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * GetInventoryRequest request = + * GetInventoryRequest.newBuilder() + * .setName(InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setView(InventoryView.forNumber(0)) + * .build(); + * Inventory response = osConfigZonalServiceClient.getInventory(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Inventory getInventory(GetInventoryRequest request) { + return getInventoryCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Get inventory data for the specified VM instance. If the VM has no associated inventory, the + * message `NOT_FOUND` is returned. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * GetInventoryRequest request = + * GetInventoryRequest.newBuilder() + * .setName(InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .setView(InventoryView.forNumber(0)) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * osConfigZonalServiceClient.getInventoryCallable().futureCall(request); + * // Do something. + * Inventory response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * InstanceName parent = + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]"); + * for (Inventory element : osConfigZonalServiceClient.listInventories(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent resource name. + *
Format: `projects/{project}/locations/{location}/instances/-` + *
For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInventoriesPagedResponse listInventories(InstanceName parent) { + ListInventoriesRequest request = + ListInventoriesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInventories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * String parent = + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]").toString(); + * for (Inventory element : osConfigZonalServiceClient.listInventories(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent resource name. + *
Format: `projects/{project}/locations/{location}/instances/-` + *
For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInventoriesPagedResponse listInventories(String parent) { + ListInventoriesRequest request = ListInventoriesRequest.newBuilder().setParent(parent).build(); + return listInventories(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * ListInventoriesRequest request = + * ListInventoriesRequest.newBuilder() + * .setParent( + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]") + * .toString()) + * .setView(InventoryView.forNumber(0)) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * for (Inventory element : osConfigZonalServiceClient.listInventories(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInventoriesPagedResponse listInventories(ListInventoriesRequest request) { + return listInventoriesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List inventory data for all VM instances in the specified zone. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * ListInventoriesRequest request = + * ListInventoriesRequest.newBuilder() + * .setParent( + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]") + * .toString()) + * .setView(InventoryView.forNumber(0)) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * osConfigZonalServiceClient.listInventoriesPagedCallable().futureCall(request); + * // Do something. + * for (Inventory element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * ListInventoriesRequest request = + * ListInventoriesRequest.newBuilder() + * .setParent( + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]") + * .toString()) + * .setView(InventoryView.forNumber(0)) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * while (true) { + * ListInventoriesResponse response = + * osConfigZonalServiceClient.listInventoriesCallable().call(request); + * for (Inventory element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * VulnerabilityReportName name = + * VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + * VulnerabilityReport response = osConfigZonalServiceClient.getVulnerabilityReport(name); + * } + * }+ * + * @param name Required. API resource name for vulnerability resource. + *
Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + *
For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final VulnerabilityReport getVulnerabilityReport(VulnerabilityReportName name) { + GetVulnerabilityReportRequest request = + GetVulnerabilityReportRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getVulnerabilityReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * String name = VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + * VulnerabilityReport response = osConfigZonalServiceClient.getVulnerabilityReport(name); + * } + * }+ * + * @param name Required. API resource name for vulnerability resource. + *
Format: + * `projects/{project}/locations/{location}/instances/{instance}/vulnerabilityReport` + *
For `{project}`, either `project-number` or `project-id` can be provided. For + * `{instance}`, either Compute Engine `instance-id` or `instance-name` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final VulnerabilityReport getVulnerabilityReport(String name) { + GetVulnerabilityReportRequest request = + GetVulnerabilityReportRequest.newBuilder().setName(name).build(); + return getVulnerabilityReport(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * GetVulnerabilityReportRequest request = + * GetVulnerabilityReportRequest.newBuilder() + * .setName( + * VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * VulnerabilityReport response = osConfigZonalServiceClient.getVulnerabilityReport(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final VulnerabilityReport getVulnerabilityReport(GetVulnerabilityReportRequest request) { + return getVulnerabilityReportCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets the vulnerability report for the specified VM instance. Only VMs with inventory data have + * vulnerability reports associated with them. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * GetVulnerabilityReportRequest request = + * GetVulnerabilityReportRequest.newBuilder() + * .setName( + * VulnerabilityReportName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * osConfigZonalServiceClient.getVulnerabilityReportCallable().futureCall(request); + * // Do something. + * VulnerabilityReport response = future.get(); + * } + * }
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * InstanceName parent = + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]"); + * for (VulnerabilityReport element : + * osConfigZonalServiceClient.listVulnerabilityReports(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent resource name. + *
Format: `projects/{project}/locations/{location}/instances/-` + *
For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVulnerabilityReportsPagedResponse listVulnerabilityReports(InstanceName parent) { + ListVulnerabilityReportsRequest request = + ListVulnerabilityReportsRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listVulnerabilityReports(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * String parent = + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]").toString(); + * for (VulnerabilityReport element : + * osConfigZonalServiceClient.listVulnerabilityReports(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The parent resource name. + *
Format: `projects/{project}/locations/{location}/instances/-` + *
For `{project}`, either `project-number` or `project-id` can be provided. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVulnerabilityReportsPagedResponse listVulnerabilityReports(String parent) { + ListVulnerabilityReportsRequest request = + ListVulnerabilityReportsRequest.newBuilder().setParent(parent).build(); + return listVulnerabilityReports(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * ListVulnerabilityReportsRequest request = + * ListVulnerabilityReportsRequest.newBuilder() + * .setParent( + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * for (VulnerabilityReport element : + * osConfigZonalServiceClient.listVulnerabilityReports(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListVulnerabilityReportsPagedResponse listVulnerabilityReports( + ListVulnerabilityReportsRequest request) { + return listVulnerabilityReportsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * List vulnerability reports for all VM instances in the specified zone. + * + *
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * ListVulnerabilityReportsRequest request = + * ListVulnerabilityReportsRequest.newBuilder() + * .setParent( + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * osConfigZonalServiceClient.listVulnerabilityReportsPagedCallable().futureCall(request); + * // Do something. + * for (VulnerabilityReport element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@code + * try (OsConfigZonalServiceClient osConfigZonalServiceClient = + * OsConfigZonalServiceClient.create()) { + * ListVulnerabilityReportsRequest request = + * ListVulnerabilityReportsRequest.newBuilder() + * .setParent( + * InstanceName.ofProjectZoneInstanceName("[PROJECT]", "[ZONE]", "[INSTANCE]") + * .toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .setFilter("filter-1274492040") + * .build(); + * while (true) { + * ListVulnerabilityReportsResponse response = + * osConfigZonalServiceClient.listVulnerabilityReportsCallable().call(request); + * for (VulnerabilityReport element : response.getResponsesList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
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 getInventory to 30 seconds: + * + *
{@code + * OsConfigZonalServiceSettings.Builder osConfigZonalServiceSettingsBuilder = + * OsConfigZonalServiceSettings.newBuilder(); + * osConfigZonalServiceSettingsBuilder + * .getInventorySettings() + * .setRetrySettings( + * osConfigZonalServiceSettingsBuilder + * .getInventorySettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * OsConfigZonalServiceSettings osConfigZonalServiceSettings = + * osConfigZonalServiceSettingsBuilder.build(); + * }+ */ +@Generated("by gapic-generator-java") +public class OsConfigZonalServiceSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= OsConfigZonalServiceClient =======================
+ *
+ * Service Description: Zonal OS Config API
+ *
+ * The OS Config service is the server-side component that allows users to manage package
+ * installations and patch jobs for Compute Engine VM instances.
+ *
+ * Sample for OsConfigZonalServiceClient:
+ *
+ * This class is for advanced usage.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcOsConfigZonalServiceCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public class GrpcOsConfigZonalServiceStub extends OsConfigZonalServiceStub {
+ private static final MethodDescriptor This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class OsConfigZonalServiceStub implements BackgroundResource {
+
+ public UnaryCallable 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 getInventory to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction{@code
+ * try (OsConfigZonalServiceClient osConfigZonalServiceClient =
+ * OsConfigZonalServiceClient.create()) {
+ * InventoryName name = InventoryName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ * Inventory response = osConfigZonalServiceClient.getInventory(name);
+ * }
+ * }
*/
@Generated("by gapic-generator-java")
package com.google.cloud.osconfig.v1;
diff --git a/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java
new file mode 100644
index 00000000..d3944581
--- /dev/null
+++ b/google-cloud-os-config/src/main/java/com/google/cloud/osconfig/v1/stub/GrpcOsConfigZonalServiceCallableFactory.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2021 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.osconfig.v1.stub;
+
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the OsConfigZonalService service API.
+ *
+ *
+ *
+ *
+ * {@code
+ * OsConfigZonalServiceStubSettings.Builder osConfigZonalServiceSettingsBuilder =
+ * OsConfigZonalServiceStubSettings.newBuilder();
+ * osConfigZonalServiceSettingsBuilder
+ * .getInventorySettings()
+ * .setRetrySettings(
+ * osConfigZonalServiceSettingsBuilder
+ * .getInventorySettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * OsConfigZonalServiceStubSettings osConfigZonalServiceSettings =
+ * osConfigZonalServiceSettingsBuilder.build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class OsConfigZonalServiceStubSettings
+ extends StubSettings