com.google.cloud
google-cloud-artifact-registry-bom
diff --git a/generation_config.yaml b/generation_config.yaml
index 1c0bd81d92dc..23d4b6c6dcd5 100644
--- a/generation_config.yaml
+++ b/generation_config.yaml
@@ -183,6 +183,23 @@ libraries:
rpc_documentation: https://cloud.google.com/app-hub/docs/reference/rpc
GAPICs:
- proto_path: google/cloud/apphub/v1
+- api_shortname: appoptimize
+ name_pretty: App Optimize API
+ product_documentation: https://docs.cloud.google.com/app-optimize/overview
+ api_description: The App Optimize API provides developers and platform teams with
+ tools to monitor, analyze, and improve the performance and cost-efficiency of
+ their cloud applications.
+ client_documentation:
+ https://cloud.google.com/java/docs/reference/google-cloud-appoptimize/latest/overview
+ release_level: preview
+ distribution_name: com.google.cloud:google-cloud-appoptimize
+ api_id: appoptimize.googleapis.com
+ library_type: GAPIC_AUTO
+ group_id: com.google.cloud
+ cloud_api: true
+ GAPICs:
+ - proto_path: google/cloud/appoptimize/v1beta
+ requires_billing: true
- api_shortname: area120tables
name_pretty: Area 120 Tables
product_documentation: https://area120.google.com/
diff --git a/java-appoptimize/.OwlBot-hermetic.yaml b/java-appoptimize/.OwlBot-hermetic.yaml
new file mode 100644
index 000000000000..99a0015f9b42
--- /dev/null
+++ b/java-appoptimize/.OwlBot-hermetic.yaml
@@ -0,0 +1,36 @@
+# Copyright 2024 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.
+
+
+deep-remove-regex:
+- "/java-appoptimize/grpc-google-.*/src"
+- "/java-appoptimize/proto-google-.*/src"
+- "/java-appoptimize/google-.*/src"
+- "/java-appoptimize/samples/snippets/generated"
+
+deep-preserve-regex:
+- "/java-appoptimize/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java"
+- "/java-appoptimize/google-.*/src/main/java/com/google/cloud/.*/v.*/stub/Version.java"
+
+deep-copy-regex:
+- source: "/google/cloud/appoptimize/(v.*)/.*-java/proto-google-.*/src"
+ dest: "/owl-bot-staging/java-appoptimize/$1/proto-google-cloud-appoptimize-$1/src"
+- source: "/google/cloud/appoptimize/(v.*)/.*-java/grpc-google-.*/src"
+ dest: "/owl-bot-staging/java-appoptimize/$1/grpc-google-cloud-appoptimize-$1/src"
+- source: "/google/cloud/appoptimize/(v.*)/.*-java/gapic-google-.*/src"
+ dest: "/owl-bot-staging/java-appoptimize/$1/google-cloud-appoptimize/src"
+- source: "/google/cloud/appoptimize/(v.*)/.*-java/samples/snippets/generated"
+ dest: "/owl-bot-staging/java-appoptimize/$1/samples/snippets/generated"
+
+api-name: appoptimize
\ No newline at end of file
diff --git a/java-appoptimize/.repo-metadata.json b/java-appoptimize/.repo-metadata.json
new file mode 100644
index 000000000000..ab1b1e92abd3
--- /dev/null
+++ b/java-appoptimize/.repo-metadata.json
@@ -0,0 +1,16 @@
+{
+ "api_shortname": "appoptimize",
+ "name_pretty": "App Optimize API",
+ "product_documentation": "https://docs.cloud.google.com/app-optimize/overview",
+ "api_description": "The App Optimize API provides developers and platform teams with tools to monitor, analyze, and improve the performance and cost-efficiency of their cloud applications.",
+ "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-appoptimize/latest/overview",
+ "release_level": "preview",
+ "transport": "both",
+ "language": "java",
+ "repo": "googleapis/google-cloud-java",
+ "repo_short": "java-appoptimize",
+ "distribution_name": "com.google.cloud:google-cloud-appoptimize",
+ "api_id": "appoptimize.googleapis.com",
+ "library_type": "GAPIC_AUTO",
+ "requires_billing": true
+}
\ No newline at end of file
diff --git a/java-appoptimize/README.md b/java-appoptimize/README.md
new file mode 100644
index 000000000000..2c9ce0d61010
--- /dev/null
+++ b/java-appoptimize/README.md
@@ -0,0 +1,205 @@
+# Google App Optimize API Client for Java
+
+Java idiomatic client for [App Optimize API][product-docs].
+
+[![Maven][maven-version-image]][maven-version-link]
+![Stability][stability-image]
+
+- [Product Documentation][product-docs]
+- [Client Library Documentation][javadocs]
+
+> Note: This client is a work-in-progress, and may occasionally
+> make backwards-incompatible changes.
+
+
+## Quickstart
+
+
+If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file:
+
+```xml
+
+
+
+ com.google.cloud
+ libraries-bom
+ 26.79.0
+ pom
+ import
+
+
+
+
+
+
+ com.google.cloud
+ google-cloud-appoptimize
+
+
+```
+
+If you are using Maven without the BOM, add this to your dependencies:
+
+
+```xml
+
+ com.google.cloud
+ google-cloud-appoptimize
+ 0.0.0
+
+```
+
+If you are using Gradle without BOM, add this to your dependencies:
+
+```Groovy
+implementation 'com.google.cloud:google-cloud-appoptimize:0.0.0'
+```
+
+If you are using SBT, add this to your dependencies:
+
+```Scala
+libraryDependencies += "com.google.cloud" % "google-cloud-appoptimize" % "0.0.0"
+```
+
+## Authentication
+
+See the [Authentication][authentication] section in the base directory's README.
+
+## Authorization
+
+The client application making API calls must be granted [authorization scopes][auth-scopes] required for the desired App Optimize API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the App Optimize API API calls.
+
+## Getting Started
+
+### Prerequisites
+
+You will need a [Google Cloud Platform Console][developer-console] project with the App Optimize API [API enabled][enable-api].
+You will need to [enable billing][enable-billing] to use Google App Optimize API.
+[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by
+[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line:
+`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`.
+
+### Installation and setup
+
+You'll need to obtain the `google-cloud-appoptimize` library. See the [Quickstart](#quickstart) section
+to add `google-cloud-appoptimize` as a dependency in your code.
+
+## About App Optimize API
+
+
+[App Optimize API][product-docs] The App Optimize API provides developers and platform teams with tools to monitor, analyze, and improve the performance and cost-efficiency of their cloud applications.
+
+See the [App Optimize API client library docs][javadocs] to learn how to
+use this App Optimize API Client Library.
+
+
+
+
+
+
+## Troubleshooting
+
+To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting].
+
+## Transport
+
+App Optimize API uses both gRPC and HTTP/JSON for the transport layer.
+
+## Supported Java Versions
+
+Java 8 or above is required for using this client.
+
+Google's Java client libraries,
+[Google Cloud Client Libraries][cloudlibs]
+and
+[Google Cloud API Libraries][apilibs],
+follow the
+[Oracle Java SE support roadmap][oracle]
+(see the Oracle Java SE Product Releases section).
+
+### For new development
+
+In general, new feature development occurs with support for the lowest Java
+LTS version covered by Oracle's Premier Support (which typically lasts 5 years
+from initial General Availability). If the minimum required JVM for a given
+library is changed, it is accompanied by a [semver][semver] major release.
+
+Java 11 and (in September 2021) Java 17 are the best choices for new
+development.
+
+### Keeping production systems current
+
+Google tests its client libraries with all current LTS versions covered by
+Oracle's Extended Support (which typically lasts 8 years from initial
+General Availability).
+
+#### Legacy support
+
+Google's client libraries support legacy versions of Java runtimes with long
+term stable libraries that don't receive feature updates on a best efforts basis
+as it may not be possible to backport all patches.
+
+Google provides updates on a best efforts basis to apps that continue to use
+Java 7, though apps might need to upgrade to current versions of the library
+that supports their JVM.
+
+#### Where to find specific information
+
+The latest versions and the supported Java versions are identified on
+the individual GitHub repository `github.com/GoogleAPIs/java-SERVICENAME`
+and on [google-cloud-java][g-c-j].
+
+## Versioning
+
+
+This library follows [Semantic Versioning](http://semver.org/).
+
+
+It is currently in major version zero (``0.y.z``), which means that anything may change at any time
+and the public API should not be considered stable.
+
+
+## Contributing
+
+
+Contributions to this library are always welcome and highly encouraged.
+
+See [CONTRIBUTING][contributing] for more information how to get started.
+
+Please note that this project is released with a Contributor Code of Conduct. By participating in
+this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more
+information.
+
+
+## License
+
+Apache 2.0 - See [LICENSE][license] for more information.
+
+Java is a registered trademark of Oracle and/or its affiliates.
+
+[product-docs]: https://docs.cloud.google.com/app-optimize/overview
+[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-appoptimize/latest/overview
+[stability-image]: https://img.shields.io/badge/stability-preview-yellow
+[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-appoptimize.svg
+[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-appoptimize/0.0.0
+[authentication]: https://github.com/googleapis/google-cloud-java#authentication
+[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
+[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
+[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy
+[developer-console]: https://console.developers.google.com/
+[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
+[cloud-cli]: https://cloud.google.com/cli
+[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md
+[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md
+[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct
+[license]: https://github.com/googleapis/google-cloud-java/blob/main/LICENSE
+[enable-billing]: https://cloud.google.com/apis/docs/getting-started#enabling_billing
+[enable-api]: https://console.cloud.google.com/flows/enableapi?apiid=appoptimize.googleapis.com
+[libraries-bom]: https://github.com/GoogleCloudPlatform/cloud-opensource-java/wiki/The-Google-Cloud-Platform-Libraries-BOM
+[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png
+
+[semver]: https://semver.org/
+[cloudlibs]: https://cloud.google.com/apis/docs/client-libraries-explained
+[apilibs]: https://cloud.google.com/apis/docs/client-libraries-explained#google_api_client_libraries
+[oracle]: https://www.oracle.com/java/technologies/java-se-support-roadmap.html
+[g-c-j]: http://github.com/googleapis/google-cloud-java
diff --git a/java-appoptimize/google-cloud-appoptimize-bom/pom.xml b/java-appoptimize/google-cloud-appoptimize-bom/pom.xml
new file mode 100644
index 000000000000..9ddde7d2b30a
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize-bom/pom.xml
@@ -0,0 +1,43 @@
+
+
+ 4.0.0
+ com.google.cloud
+ google-cloud-appoptimize-bom
+ 0.0.1-SNAPSHOT
+ pom
+
+ com.google.cloud
+ google-cloud-pom-parent
+ 1.83.0-SNAPSHOT
+ ../../google-cloud-pom-parent/pom.xml
+
+
+ Google App Optimize API BOM
+
+ BOM for App Optimize API
+
+
+
+ true
+
+
+
+
+
+ com.google.cloud
+ google-cloud-appoptimize
+ 0.0.1-SNAPSHOT
+
+
+ com.google.api.grpc
+ grpc-google-cloud-appoptimize-v1beta
+ 0.0.1-SNAPSHOT
+
+
+ com.google.api.grpc
+ proto-google-cloud-appoptimize-v1beta
+ 0.0.1-SNAPSHOT
+
+
+
+
diff --git a/java-appoptimize/google-cloud-appoptimize/pom.xml b/java-appoptimize/google-cloud-appoptimize/pom.xml
new file mode 100644
index 000000000000..59e4cf3416db
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/pom.xml
@@ -0,0 +1,115 @@
+
+
+ 4.0.0
+ com.google.cloud
+ google-cloud-appoptimize
+ 0.0.1-SNAPSHOT
+ jar
+ Google App Optimize API
+ App Optimize API The App Optimize API provides developers and platform teams with tools to monitor, analyze, and improve the performance and cost-efficiency of their cloud applications.
+
+ com.google.cloud
+ google-cloud-appoptimize-parent
+ 0.0.1-SNAPSHOT
+
+
+ google-cloud-appoptimize
+
+
+
+ io.grpc
+ grpc-api
+
+
+ io.grpc
+ grpc-stub
+
+
+ io.grpc
+ grpc-protobuf
+
+
+ com.google.api
+ api-common
+
+
+ com.google.protobuf
+ protobuf-java
+
+
+ com.google.api.grpc
+ proto-google-common-protos
+
+
+
+ com.google.api.grpc
+ proto-google-cloud-appoptimize-v1beta
+
+
+ com.google.guava
+ guava
+
+
+ com.google.api
+ gax
+
+
+ com.google.api
+ gax-grpc
+
+
+ com.google.api
+ gax-httpjson
+
+
+ com.google.api.grpc
+ proto-google-iam-v1
+
+
+ org.threeten
+ threetenbp
+
+
+
+
+ com.google.api.grpc
+ grpc-google-common-protos
+ test
+
+
+ com.google.api.grpc
+ grpc-google-iam-v1
+ test
+
+
+ junit
+ junit
+ test
+
+
+
+ com.google.api.grpc
+ grpc-google-cloud-appoptimize-v1beta
+ test
+
+
+
+ com.google.api
+ gax
+ testlib
+ test
+
+
+ com.google.api
+ gax-grpc
+ testlib
+ test
+
+
+ com.google.api
+ gax-httpjson
+ testlib
+ test
+
+
+
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClient.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClient.java
new file mode 100644
index 000000000000..e0be5f8de406
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeClient.java
@@ -0,0 +1,1515 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta;
+
+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.httpjson.longrunning.OperationsClient;
+import com.google.api.gax.longrunning.OperationFuture;
+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.OperationCallable;
+import com.google.api.gax.rpc.PageContext;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.appoptimize.v1beta.stub.AppOptimizeStub;
+import com.google.cloud.appoptimize.v1beta.stub.AppOptimizeStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.common.util.concurrent.MoreExecutors;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.ListValue;
+import java.io.IOException;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Service Description: Service for managing and querying optimization reports.
+ *
+ * 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
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
+ * Report response = appOptimizeClient.getReport(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the AppOptimizeClient object to clean up resources such as
+ * threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ *
+ * Methods
+ *
+ * | Method |
+ * Description |
+ * Method Variants |
+ *
+ *
+ * CreateReport |
+ * Creates a new report.
+ * This initiates a long-running operation that, upon completion, results in a report resource. Once the report is created, its results can be read via `ReadReport`. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
+ *
+ * createReportAsync(LocationName parent, Report report, String reportId)
+ * createReportAsync(String parent, Report report, String reportId)
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * GetReport |
+ * Retrieves the details of a report configuration. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * getReportCallable()
+ *
+ * |
+ *
+ *
+ * ListReports |
+ * Lists reports within a given project. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * DeleteReport |
+ * Deletes the specified report. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * ReadReport |
+ * Reads data within a specified report. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * ListLocations |
+ * Lists information about the supported locations for this service.
+ * This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name] field:
+ * * **Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *
+ * |
+ *
+ *
+ * GetLocation |
+ * Gets information about a location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *
+ * Callable method variants take no parameters and return 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 AppOptimizeSettings to
+ * create(). For example:
+ *
+ *
To customize credentials:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeSettings appOptimizeSettings =
+ * AppOptimizeSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * AppOptimizeClient appOptimizeClient = AppOptimizeClient.create(appOptimizeSettings);
+ * }
+ *
+ * To customize the endpoint:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeSettings appOptimizeSettings =
+ * AppOptimizeSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * AppOptimizeClient appOptimizeClient = AppOptimizeClient.create(appOptimizeSettings);
+ * }
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeSettings appOptimizeSettings = AppOptimizeSettings.newHttpJsonBuilder().build();
+ * AppOptimizeClient appOptimizeClient = AppOptimizeClient.create(appOptimizeSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class AppOptimizeClient implements BackgroundResource {
+ private final AppOptimizeSettings settings;
+ private final AppOptimizeStub stub;
+ private final OperationsClient httpJsonOperationsClient;
+ private final com.google.longrunning.OperationsClient operationsClient;
+
+ /** Constructs an instance of AppOptimizeClient with default settings. */
+ public static final AppOptimizeClient create() throws IOException {
+ return create(AppOptimizeSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of AppOptimizeClient, 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 AppOptimizeClient create(AppOptimizeSettings settings) throws IOException {
+ return new AppOptimizeClient(settings);
+ }
+
+ /**
+ * Constructs an instance of AppOptimizeClient, using the given stub for making calls. This is for
+ * advanced usage - prefer using create(AppOptimizeSettings).
+ */
+ public static final AppOptimizeClient create(AppOptimizeStub stub) {
+ return new AppOptimizeClient(stub);
+ }
+
+ /**
+ * Constructs an instance of AppOptimizeClient, 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 AppOptimizeClient(AppOptimizeSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((AppOptimizeStubSettings) settings.getStubSettings()).createStub();
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
+ }
+
+ protected AppOptimizeClient(AppOptimizeStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ this.operationsClient =
+ com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
+ this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
+ }
+
+ public final AppOptimizeSettings getSettings() {
+ return settings;
+ }
+
+ public AppOptimizeStub 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 com.google.longrunning.OperationsClient getOperationsClient() {
+ return operationsClient;
+ }
+
+ /**
+ * Returns the OperationsClient that can be used to query the status of a long-running operation
+ * returned by another API method call.
+ */
+ @BetaApi
+ public final OperationsClient getHttpJsonOperationsClient() {
+ return httpJsonOperationsClient;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new report.
+ *
+ *
This initiates a long-running operation that, upon completion, results in a report resource.
+ * Once the report is created, its results can be read via `ReadReport`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Report report = Report.newBuilder().build();
+ * String reportId = "reportId-427040401";
+ * Report response = appOptimizeClient.createReportAsync(parent, report, reportId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent Google Cloud project that will own the report.
+ * This value does not define the scope of the report data. See `Report.scope` for setting
+ * the data scope.
+ *
Format: `projects/{project}/locations/{location}`.
+ * @param report Required. The report resource to create.
+ * @param reportId Required. The ID to use for this report. This ID must be unique within the
+ * parent project and should comply with RFC 1034 restrictions (letters, numbers, and hyphen,
+ * with the first character a letter, the last a letter or a number, and a 63 character
+ * maximum).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture createReportAsync(
+ LocationName parent, Report report, String reportId) {
+ CreateReportRequest request =
+ CreateReportRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setReport(report)
+ .setReportId(reportId)
+ .build();
+ return createReportAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new report.
+ *
+ * This initiates a long-running operation that, upon completion, results in a report resource.
+ * Once the report is created, its results can be read via `ReadReport`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Report report = Report.newBuilder().build();
+ * String reportId = "reportId-427040401";
+ * Report response = appOptimizeClient.createReportAsync(parent, report, reportId).get();
+ * }
+ * }
+ *
+ * @param parent Required. The parent Google Cloud project that will own the report.
+ * This value does not define the scope of the report data. See `Report.scope` for setting
+ * the data scope.
+ *
Format: `projects/{project}/locations/{location}`.
+ * @param report Required. The report resource to create.
+ * @param reportId Required. The ID to use for this report. This ID must be unique within the
+ * parent project and should comply with RFC 1034 restrictions (letters, numbers, and hyphen,
+ * with the first character a letter, the last a letter or a number, and a 63 character
+ * maximum).
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture createReportAsync(
+ String parent, Report report, String reportId) {
+ CreateReportRequest request =
+ CreateReportRequest.newBuilder()
+ .setParent(parent)
+ .setReport(report)
+ .setReportId(reportId)
+ .build();
+ return createReportAsync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new report.
+ *
+ * This initiates a long-running operation that, upon completion, results in a report resource.
+ * Once the report is created, its results can be read via `ReadReport`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * CreateReportRequest request =
+ * CreateReportRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setReportId("reportId-427040401")
+ * .setReport(Report.newBuilder().build())
+ * .build();
+ * Report response = appOptimizeClient.createReportAsync(request).get();
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFuture createReportAsync(
+ CreateReportRequest request) {
+ return createReportOperationCallable().futureCall(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new report.
+ *
+ * This initiates a long-running operation that, upon completion, results in a report resource.
+ * Once the report is created, its results can be read via `ReadReport`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * CreateReportRequest request =
+ * CreateReportRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setReportId("reportId-427040401")
+ * .setReport(Report.newBuilder().build())
+ * .build();
+ * OperationFuture future =
+ * appOptimizeClient.createReportOperationCallable().futureCall(request);
+ * // Do something.
+ * Report response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallable
+ createReportOperationCallable() {
+ return stub.createReportOperationCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new report.
+ *
+ * This initiates a long-running operation that, upon completion, results in a report resource.
+ * Once the report is created, its results can be read via `ReadReport`.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * CreateReportRequest request =
+ * CreateReportRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setReportId("reportId-427040401")
+ * .setReport(Report.newBuilder().build())
+ * .build();
+ * ApiFuture future = appOptimizeClient.createReportCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable createReportCallable() {
+ return stub.createReportCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the details of a report configuration.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
+ * Report response = appOptimizeClient.getReport(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the report to retrieve.
+ * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Report getReport(ReportName name) {
+ GetReportRequest request =
+ GetReportRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the details of a report configuration.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * String name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString();
+ * Report response = appOptimizeClient.getReport(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the report to retrieve.
+ * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Report getReport(String name) {
+ GetReportRequest request = GetReportRequest.newBuilder().setName(name).build();
+ return getReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the details of a report configuration.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * GetReportRequest request =
+ * GetReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .build();
+ * Report response = appOptimizeClient.getReport(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 Report getReport(GetReportRequest request) {
+ return getReportCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the details of a report configuration.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * GetReportRequest request =
+ * GetReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .build();
+ * ApiFuture future = appOptimizeClient.getReportCallable().futureCall(request);
+ * // Do something.
+ * Report response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getReportCallable() {
+ return stub.getReportCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists reports within a given project.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Report element : appOptimizeClient.listReports(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent project whose reports are to be listed.
+ * Format: `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListReportsPagedResponse listReports(LocationName parent) {
+ ListReportsRequest request =
+ ListReportsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listReports(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists reports within a given project.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Report element : appOptimizeClient.listReports(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The parent project whose reports are to be listed.
+ * Format: `projects/{project}/locations/{location}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListReportsPagedResponse listReports(String parent) {
+ ListReportsRequest request = ListReportsRequest.newBuilder().setParent(parent).build();
+ return listReports(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists reports within a given project.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ListReportsRequest request =
+ * ListReportsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Report element : appOptimizeClient.listReports(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 ListReportsPagedResponse listReports(ListReportsRequest request) {
+ return listReportsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists reports within a given project.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ListReportsRequest request =
+ * ListReportsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future = appOptimizeClient.listReportsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Report element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listReportsPagedCallable() {
+ return stub.listReportsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists reports within a given project.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ListReportsRequest request =
+ * ListReportsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListReportsResponse response = appOptimizeClient.listReportsCallable().call(request);
+ * for (Report element : response.getReportsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listReportsCallable() {
+ return stub.listReportsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified report.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
+ * appOptimizeClient.deleteReport(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the report to delete.
+ * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteReport(ReportName name) {
+ DeleteReportRequest request =
+ DeleteReportRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified report.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * String name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString();
+ * appOptimizeClient.deleteReport(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the report to delete.
+ * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteReport(String name) {
+ DeleteReportRequest request = DeleteReportRequest.newBuilder().setName(name).build();
+ deleteReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified report.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * DeleteReportRequest request =
+ * DeleteReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .setAllowMissing(true)
+ * .build();
+ * appOptimizeClient.deleteReport(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 void deleteReport(DeleteReportRequest request) {
+ deleteReportCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified report.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * DeleteReportRequest request =
+ * DeleteReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .setAllowMissing(true)
+ * .build();
+ * ApiFuture future = appOptimizeClient.deleteReportCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable deleteReportCallable() {
+ return stub.deleteReportCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reads data within a specified report.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
+ * for (ListValue element : appOptimizeClient.readReport(name).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the report to query.
+ * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ReadReportPagedResponse readReport(ReportName name) {
+ ReadReportRequest request =
+ ReadReportRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return readReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reads data within a specified report.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * String name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString();
+ * for (ListValue element : appOptimizeClient.readReport(name).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param name Required. The resource name of the report to query.
+ * Format: `projects/{project}/locations/{location}/reports/{report_id}`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ReadReportPagedResponse readReport(String name) {
+ ReadReportRequest request = ReadReportRequest.newBuilder().setName(name).build();
+ return readReport(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reads data within a specified report.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReadReportRequest request =
+ * ReadReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (ListValue element : appOptimizeClient.readReport(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 ReadReportPagedResponse readReport(ReadReportRequest request) {
+ return readReportPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reads data within a specified report.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReadReportRequest request =
+ * ReadReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future = appOptimizeClient.readReportPagedCallable().futureCall(request);
+ * // Do something.
+ * for (ListValue element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable readReportPagedCallable() {
+ return stub.readReportPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Reads data within a specified report.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReadReportRequest request =
+ * ReadReportRequest.newBuilder()
+ * .setName(ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ReadReportResponse response = appOptimizeClient.readReportCallable().call(request);
+ * for (ListValue element : response.getRowsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable readReportCallable() {
+ return stub.readReportCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name] field:
+ *
+ *
* **Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ *
For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : appOptimizeClient.listLocations(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 ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name] field:
+ *
+ *
* **Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ *
For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * appOptimizeClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable
+ listLocationsPagedCallable() {
+ return stub.listLocationsPagedCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name] field:
+ *
+ *
* **Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ *
For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ *
Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = appOptimizeClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable listLocationsCallable() {
+ return stub.listLocationsCallable();
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = appOptimizeClient.getLocation(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 Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * Sample code:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = appOptimizeClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallable getLocationCallable() {
+ return stub.getLocationCallable();
+ }
+
+ @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 ListReportsPagedResponse
+ extends AbstractPagedListResponse<
+ ListReportsRequest,
+ ListReportsResponse,
+ Report,
+ ListReportsPage,
+ ListReportsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListReportsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage, input -> new ListReportsPagedResponse(input), MoreExecutors.directExecutor());
+ }
+
+ private ListReportsPagedResponse(ListReportsPage page) {
+ super(page, ListReportsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListReportsPage
+ extends AbstractPage {
+
+ private ListReportsPage(
+ PageContext context,
+ ListReportsResponse response) {
+ super(context, response);
+ }
+
+ private static ListReportsPage createEmptyPage() {
+ return new ListReportsPage(null, null);
+ }
+
+ @Override
+ protected ListReportsPage createPage(
+ PageContext context,
+ ListReportsResponse response) {
+ return new ListReportsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListReportsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListReportsRequest,
+ ListReportsResponse,
+ Report,
+ ListReportsPage,
+ ListReportsFixedSizeCollection> {
+
+ private ListReportsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListReportsFixedSizeCollection createEmptyCollection() {
+ return new ListReportsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListReportsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListReportsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ReadReportPagedResponse
+ extends AbstractPagedListResponse<
+ ReadReportRequest,
+ ReadReportResponse,
+ ListValue,
+ ReadReportPage,
+ ReadReportFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ReadReportPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage, input -> new ReadReportPagedResponse(input), MoreExecutors.directExecutor());
+ }
+
+ private ReadReportPagedResponse(ReadReportPage page) {
+ super(page, ReadReportFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ReadReportPage
+ extends AbstractPage {
+
+ private ReadReportPage(
+ PageContext context,
+ ReadReportResponse response) {
+ super(context, response);
+ }
+
+ private static ReadReportPage createEmptyPage() {
+ return new ReadReportPage(null, null);
+ }
+
+ @Override
+ protected ReadReportPage createPage(
+ PageContext context,
+ ReadReportResponse response) {
+ return new ReadReportPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ReadReportFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ReadReportRequest,
+ ReadReportResponse,
+ ListValue,
+ ReadReportPage,
+ ReadReportFixedSizeCollection> {
+
+ private ReadReportFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ReadReportFixedSizeCollection createEmptyCollection() {
+ return new ReadReportFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ReadReportFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ReadReportFixedSizeCollection(pages, collectionSize);
+ }
+ }
+
+ public static class ListLocationsPagedResponse
+ extends AbstractPagedListResponse<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ public static ApiFuture createAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ ApiFuture futurePage =
+ ListLocationsPage.createEmptyPage().createPageAsync(context, futureResponse);
+ return ApiFutures.transform(
+ futurePage,
+ input -> new ListLocationsPagedResponse(input),
+ MoreExecutors.directExecutor());
+ }
+
+ private ListLocationsPagedResponse(ListLocationsPage page) {
+ super(page, ListLocationsFixedSizeCollection.createEmptyCollection());
+ }
+ }
+
+ public static class ListLocationsPage
+ extends AbstractPage<
+ ListLocationsRequest, ListLocationsResponse, Location, ListLocationsPage> {
+
+ private ListLocationsPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ super(context, response);
+ }
+
+ private static ListLocationsPage createEmptyPage() {
+ return new ListLocationsPage(null, null);
+ }
+
+ @Override
+ protected ListLocationsPage createPage(
+ PageContext context,
+ ListLocationsResponse response) {
+ return new ListLocationsPage(context, response);
+ }
+
+ @Override
+ public ApiFuture createPageAsync(
+ PageContext context,
+ ApiFuture futureResponse) {
+ return super.createPageAsync(context, futureResponse);
+ }
+ }
+
+ public static class ListLocationsFixedSizeCollection
+ extends AbstractFixedSizeCollection<
+ ListLocationsRequest,
+ ListLocationsResponse,
+ Location,
+ ListLocationsPage,
+ ListLocationsFixedSizeCollection> {
+
+ private ListLocationsFixedSizeCollection(List pages, int collectionSize) {
+ super(pages, collectionSize);
+ }
+
+ private static ListLocationsFixedSizeCollection createEmptyCollection() {
+ return new ListLocationsFixedSizeCollection(null, 0);
+ }
+
+ @Override
+ protected ListLocationsFixedSizeCollection createCollection(
+ List pages, int collectionSize) {
+ return new ListLocationsFixedSizeCollection(pages, collectionSize);
+ }
+ }
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeSettings.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeSettings.java
new file mode 100644
index 000000000000..fc80fc8e8697
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/AppOptimizeSettings.java
@@ -0,0 +1,331 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta;
+
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListLocationsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListReportsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ReadReportPagedResponse;
+
+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.httpjson.InstantiatingHttpJsonChannelProvider;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientSettings;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.TransportChannelProvider;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.cloud.appoptimize.v1beta.stub.AppOptimizeStubSettings;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+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 AppOptimizeClient}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (appoptimize.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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getReport:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeSettings.Builder appOptimizeSettingsBuilder = AppOptimizeSettings.newBuilder();
+ * appOptimizeSettingsBuilder
+ * .getReportSettings()
+ * .setRetrySettings(
+ * appOptimizeSettingsBuilder
+ * .getReportSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * AppOptimizeSettings appOptimizeSettings = appOptimizeSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createReport:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeSettings.Builder appOptimizeSettingsBuilder = AppOptimizeSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * appOptimizeSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class AppOptimizeSettings extends ClientSettings {
+
+ /** Returns the object with the settings used for calls to createReport. */
+ public UnaryCallSettings createReportSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).createReportSettings();
+ }
+
+ /** Returns the object with the settings used for calls to createReport. */
+ public OperationCallSettings
+ createReportOperationSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).createReportOperationSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getReport. */
+ public UnaryCallSettings getReportSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).getReportSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listReports. */
+ public PagedCallSettings
+ listReportsSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).listReportsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to deleteReport. */
+ public UnaryCallSettings deleteReportSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).deleteReportSettings();
+ }
+
+ /** Returns the object with the settings used for calls to readReport. */
+ public PagedCallSettings
+ readReportSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).readReportSettings();
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).listLocationsSettings();
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return ((AppOptimizeStubSettings) getStubSettings()).getLocationSettings();
+ }
+
+ public static final AppOptimizeSettings create(AppOptimizeStubSettings stub) throws IOException {
+ return new AppOptimizeSettings.Builder(stub.toBuilder()).build();
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return AppOptimizeStubSettings.defaultExecutorProviderBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ public static String getDefaultEndpoint() {
+ return AppOptimizeStubSettings.getDefaultEndpoint();
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return AppOptimizeStubSettings.getDefaultServiceScopes();
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return AppOptimizeStubSettings.defaultCredentialsProviderBuilder();
+ }
+
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return AppOptimizeStubSettings.defaultGrpcTransportProviderBuilder();
+ }
+
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return AppOptimizeStubSettings.defaultHttpJsonTransportProviderBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return AppOptimizeStubSettings.defaultTransportChannelProvider();
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return AppOptimizeStubSettings.defaultApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
+ /** 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 AppOptimizeSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+ }
+
+ /** Builder for AppOptimizeSettings. */
+ public static class Builder extends ClientSettings.Builder {
+
+ protected Builder() throws IOException {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(AppOptimizeStubSettings.newBuilder(clientContext));
+ }
+
+ protected Builder(AppOptimizeSettings settings) {
+ super(settings.getStubSettings().toBuilder());
+ }
+
+ protected Builder(AppOptimizeStubSettings.Builder stubSettings) {
+ super(stubSettings);
+ }
+
+ private static Builder createDefault() {
+ return new Builder(AppOptimizeStubSettings.newBuilder());
+ }
+
+ private static Builder createHttpJsonDefault() {
+ return new Builder(AppOptimizeStubSettings.newHttpJsonBuilder());
+ }
+
+ public AppOptimizeStubSettings.Builder getStubSettingsBuilder() {
+ return ((AppOptimizeStubSettings.Builder) getStubSettings());
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(
+ getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater);
+ return this;
+ }
+
+ /** Returns the builder for the settings used for calls to createReport. */
+ public UnaryCallSettings.Builder createReportSettings() {
+ return getStubSettingsBuilder().createReportSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to createReport. */
+ public OperationCallSettings.Builder
+ createReportOperationSettings() {
+ return getStubSettingsBuilder().createReportOperationSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getReport. */
+ public UnaryCallSettings.Builder getReportSettings() {
+ return getStubSettingsBuilder().getReportSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listReports. */
+ public PagedCallSettings.Builder<
+ ListReportsRequest, ListReportsResponse, ListReportsPagedResponse>
+ listReportsSettings() {
+ return getStubSettingsBuilder().listReportsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to deleteReport. */
+ public UnaryCallSettings.Builder deleteReportSettings() {
+ return getStubSettingsBuilder().deleteReportSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to readReport. */
+ public PagedCallSettings.Builder
+ readReportSettings() {
+ return getStubSettingsBuilder().readReportSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return getStubSettingsBuilder().listLocationsSettings();
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getStubSettingsBuilder().getLocationSettings();
+ }
+
+ @Override
+ public AppOptimizeSettings build() throws IOException {
+ return new AppOptimizeSettings(this);
+ }
+ }
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/gapic_metadata.json b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/gapic_metadata.json
new file mode 100644
index 000000000000..ed9f9be59738
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/gapic_metadata.json
@@ -0,0 +1,39 @@
+{
+ "schema": "1.0",
+ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
+ "language": "java",
+ "protoPackage": "google.cloud.appoptimize.v1beta",
+ "libraryPackage": "com.google.cloud.appoptimize.v1beta",
+ "services": {
+ "AppOptimize": {
+ "clients": {
+ "grpc": {
+ "libraryClient": "AppOptimizeClient",
+ "rpcs": {
+ "CreateReport": {
+ "methods": ["createReportAsync", "createReportAsync", "createReportAsync", "createReportOperationCallable", "createReportCallable"]
+ },
+ "DeleteReport": {
+ "methods": ["deleteReport", "deleteReport", "deleteReport", "deleteReportCallable"]
+ },
+ "GetLocation": {
+ "methods": ["getLocation", "getLocationCallable"]
+ },
+ "GetReport": {
+ "methods": ["getReport", "getReport", "getReport", "getReportCallable"]
+ },
+ "ListLocations": {
+ "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"]
+ },
+ "ListReports": {
+ "methods": ["listReports", "listReports", "listReports", "listReportsPagedCallable", "listReportsCallable"]
+ },
+ "ReadReport": {
+ "methods": ["readReport", "readReport", "readReport", "readReportPagedCallable", "readReportCallable"]
+ }
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/package-info.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/package-info.java
new file mode 100644
index 000000000000..b3777f9f40eb
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/package-info.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2026 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 App Optimize API
+ *
+ * The interfaces provided are listed below, along with usage samples.
+ *
+ *
======================= AppOptimizeClient =======================
+ *
+ *
Service Description: Service for managing and querying optimization reports.
+ *
+ *
Sample for AppOptimizeClient:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (AppOptimizeClient appOptimizeClient = AppOptimizeClient.create()) {
+ * ReportName name = ReportName.of("[PROJECT]", "[LOCATION]", "[REPORT]");
+ * Report response = appOptimizeClient.getReport(name);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.appoptimize.v1beta;
+
+import javax.annotation.Generated;
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/AppOptimizeStub.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/AppOptimizeStub.java
new file mode 100644
index 000000000000..6fa6ef94c8e1
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/AppOptimizeStub.java
@@ -0,0 +1,111 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta.stub;
+
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListLocationsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListReportsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ReadReportPagedResponse;
+
+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.appoptimize.v1beta.CreateReportRequest;
+import com.google.cloud.appoptimize.v1beta.DeleteReportRequest;
+import com.google.cloud.appoptimize.v1beta.GetReportRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsResponse;
+import com.google.cloud.appoptimize.v1beta.OperationMetadata;
+import com.google.cloud.appoptimize.v1beta.ReadReportRequest;
+import com.google.cloud.appoptimize.v1beta.ReadReportResponse;
+import com.google.cloud.appoptimize.v1beta.Report;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the AppOptimize service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class AppOptimizeStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ public OperationCallable
+ createReportOperationCallable() {
+ throw new UnsupportedOperationException("Not implemented: createReportOperationCallable()");
+ }
+
+ public UnaryCallable createReportCallable() {
+ throw new UnsupportedOperationException("Not implemented: createReportCallable()");
+ }
+
+ public UnaryCallable getReportCallable() {
+ throw new UnsupportedOperationException("Not implemented: getReportCallable()");
+ }
+
+ public UnaryCallable listReportsPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listReportsPagedCallable()");
+ }
+
+ public UnaryCallable listReportsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listReportsCallable()");
+ }
+
+ public UnaryCallable deleteReportCallable() {
+ throw new UnsupportedOperationException("Not implemented: deleteReportCallable()");
+ }
+
+ public UnaryCallable readReportPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: readReportPagedCallable()");
+ }
+
+ public UnaryCallable readReportCallable() {
+ throw new UnsupportedOperationException("Not implemented: readReportCallable()");
+ }
+
+ public UnaryCallable
+ listLocationsPagedCallable() {
+ throw new UnsupportedOperationException("Not implemented: listLocationsPagedCallable()");
+ }
+
+ public UnaryCallable listLocationsCallable() {
+ throw new UnsupportedOperationException("Not implemented: listLocationsCallable()");
+ }
+
+ public UnaryCallable getLocationCallable() {
+ throw new UnsupportedOperationException("Not implemented: getLocationCallable()");
+ }
+
+ @Override
+ public abstract void close();
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/AppOptimizeStubSettings.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/AppOptimizeStubSettings.java
new file mode 100644
index 000000000000..c8729278e42c
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/AppOptimizeStubSettings.java
@@ -0,0 +1,770 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta.stub;
+
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListLocationsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListReportsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ReadReportPagedResponse;
+
+import com.google.api.core.ApiFunction;
+import com.google.api.core.ApiFuture;
+import com.google.api.core.BetaApi;
+import com.google.api.core.ObsoleteApi;
+import com.google.api.gax.core.GaxProperties;
+import com.google.api.gax.core.GoogleCredentialsProvider;
+import com.google.api.gax.core.InstantiatingExecutorProvider;
+import com.google.api.gax.grpc.GaxGrpcProperties;
+import com.google.api.gax.grpc.GrpcTransportChannel;
+import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
+import com.google.api.gax.grpc.ProtoOperationTransformers;
+import com.google.api.gax.httpjson.GaxHttpJsonProperties;
+import com.google.api.gax.httpjson.HttpJsonTransportChannel;
+import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider;
+import com.google.api.gax.longrunning.OperationSnapshot;
+import com.google.api.gax.longrunning.OperationTimedPollAlgorithm;
+import com.google.api.gax.retrying.RetrySettings;
+import com.google.api.gax.rpc.ApiCallContext;
+import com.google.api.gax.rpc.ApiClientHeaderProvider;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.LibraryMetadata;
+import com.google.api.gax.rpc.OperationCallSettings;
+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.appoptimize.v1beta.CreateReportRequest;
+import com.google.cloud.appoptimize.v1beta.DeleteReportRequest;
+import com.google.cloud.appoptimize.v1beta.GetReportRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsResponse;
+import com.google.cloud.appoptimize.v1beta.OperationMetadata;
+import com.google.cloud.appoptimize.v1beta.ReadReportRequest;
+import com.google.cloud.appoptimize.v1beta.ReadReportResponse;
+import com.google.cloud.appoptimize.v1beta.Report;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.ListValue;
+import java.io.IOException;
+import java.time.Duration;
+import java.util.List;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Settings class to configure an instance of {@link AppOptimizeStub}.
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ *
+ * - The default service address (appoptimize.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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getReport:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeStubSettings.Builder appOptimizeSettingsBuilder =
+ * AppOptimizeStubSettings.newBuilder();
+ * appOptimizeSettingsBuilder
+ * .getReportSettings()
+ * .setRetrySettings(
+ * appOptimizeSettingsBuilder
+ * .getReportSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * AppOptimizeStubSettings appOptimizeSettings = appOptimizeSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createReport:
+ *
+ *
{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * AppOptimizeStubSettings.Builder appOptimizeSettingsBuilder =
+ * AppOptimizeStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * appOptimizeSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+@SuppressWarnings("CanonicalDuration")
+public class AppOptimizeStubSettings extends StubSettings {
+ /** The default scopes of the service. */
+ private static final ImmutableList DEFAULT_SERVICE_SCOPES =
+ ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build();
+
+ private final UnaryCallSettings createReportSettings;
+ private final OperationCallSettings
+ createReportOperationSettings;
+ private final UnaryCallSettings getReportSettings;
+ private final PagedCallSettings
+ listReportsSettings;
+ private final UnaryCallSettings deleteReportSettings;
+ private final PagedCallSettings
+ readReportSettings;
+ private final PagedCallSettings<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings;
+ private final UnaryCallSettings getLocationSettings;
+
+ private static final PagedListDescriptor
+ LIST_REPORTS_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListReportsRequest injectToken(ListReportsRequest payload, String token) {
+ return ListReportsRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListReportsRequest injectPageSize(ListReportsRequest payload, int pageSize) {
+ return ListReportsRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListReportsRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListReportsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListReportsResponse payload) {
+ return payload.getReportsList();
+ }
+ };
+
+ private static final PagedListDescriptor
+ READ_REPORT_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ReadReportRequest injectToken(ReadReportRequest payload, String token) {
+ return ReadReportRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ReadReportRequest injectPageSize(ReadReportRequest payload, int pageSize) {
+ return ReadReportRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ReadReportRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ReadReportResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ReadReportResponse payload) {
+ return payload.getRowsList();
+ }
+ };
+
+ private static final PagedListDescriptor
+ LIST_LOCATIONS_PAGE_STR_DESC =
+ new PagedListDescriptor() {
+ @Override
+ public String emptyToken() {
+ return "";
+ }
+
+ @Override
+ public ListLocationsRequest injectToken(ListLocationsRequest payload, String token) {
+ return ListLocationsRequest.newBuilder(payload).setPageToken(token).build();
+ }
+
+ @Override
+ public ListLocationsRequest injectPageSize(ListLocationsRequest payload, int pageSize) {
+ return ListLocationsRequest.newBuilder(payload).setPageSize(pageSize).build();
+ }
+
+ @Override
+ public Integer extractPageSize(ListLocationsRequest payload) {
+ return payload.getPageSize();
+ }
+
+ @Override
+ public String extractNextToken(ListLocationsResponse payload) {
+ return payload.getNextPageToken();
+ }
+
+ @Override
+ public Iterable extractResources(ListLocationsResponse payload) {
+ return payload.getLocationsList();
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListReportsRequest, ListReportsResponse, ListReportsPagedResponse>
+ LIST_REPORTS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListReportsRequest, ListReportsResponse, ListReportsPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListReportsRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_REPORTS_PAGE_STR_DESC, request, context);
+ return ListReportsPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ReadReportRequest, ReadReportResponse, ReadReportPagedResponse>
+ READ_REPORT_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ReadReportRequest, ReadReportResponse, ReadReportPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ReadReportRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, READ_REPORT_PAGE_STR_DESC, request, context);
+ return ReadReportPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
+ private static final PagedListResponseFactory<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ LIST_LOCATIONS_PAGE_STR_FACT =
+ new PagedListResponseFactory<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>() {
+ @Override
+ public ApiFuture getFuturePagedResponse(
+ UnaryCallable callable,
+ ListLocationsRequest request,
+ ApiCallContext context,
+ ApiFuture futureResponse) {
+ PageContext pageContext =
+ PageContext.create(callable, LIST_LOCATIONS_PAGE_STR_DESC, request, context);
+ return ListLocationsPagedResponse.createAsync(pageContext, futureResponse);
+ }
+ };
+
+ /** Returns the object with the settings used for calls to createReport. */
+ public UnaryCallSettings createReportSettings() {
+ return createReportSettings;
+ }
+
+ /** Returns the object with the settings used for calls to createReport. */
+ public OperationCallSettings
+ createReportOperationSettings() {
+ return createReportOperationSettings;
+ }
+
+ /** Returns the object with the settings used for calls to getReport. */
+ public UnaryCallSettings getReportSettings() {
+ return getReportSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listReports. */
+ public PagedCallSettings
+ listReportsSettings() {
+ return listReportsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to deleteReport. */
+ public UnaryCallSettings deleteReportSettings() {
+ return deleteReportSettings;
+ }
+
+ /** Returns the object with the settings used for calls to readReport. */
+ public PagedCallSettings
+ readReportSettings() {
+ return readReportSettings;
+ }
+
+ /** Returns the object with the settings used for calls to listLocations. */
+ public PagedCallSettings
+ listLocationsSettings() {
+ return listLocationsSettings;
+ }
+
+ /** Returns the object with the settings used for calls to getLocation. */
+ public UnaryCallSettings getLocationSettings() {
+ return getLocationSettings;
+ }
+
+ public AppOptimizeStub createStub() throws IOException {
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(GrpcTransportChannel.getGrpcTransportName())) {
+ return GrpcAppOptimizeStub.create(this);
+ }
+ if (getTransportChannelProvider()
+ .getTransportName()
+ .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) {
+ return HttpJsonAppOptimizeStub.create(this);
+ }
+ throw new UnsupportedOperationException(
+ String.format(
+ "Transport not supported: %s", getTransportChannelProvider().getTransportName()));
+ }
+
+ /** Returns the default service name. */
+ @Override
+ public String getServiceName() {
+ return "appoptimize";
+ }
+
+ /** Returns a builder for the default ExecutorProvider for this service. */
+ public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() {
+ return InstantiatingExecutorProvider.newBuilder();
+ }
+
+ /** Returns the default service endpoint. */
+ @ObsoleteApi("Use getEndpoint() instead")
+ public static String getDefaultEndpoint() {
+ return "appoptimize.googleapis.com:443";
+ }
+
+ /** Returns the default mTLS service endpoint. */
+ public static String getDefaultMtlsEndpoint() {
+ return "appoptimize.mtls.googleapis.com:443";
+ }
+
+ /** Returns the default service scopes. */
+ public static List getDefaultServiceScopes() {
+ return DEFAULT_SERVICE_SCOPES;
+ }
+
+ /** Returns a builder for the default credentials for this service. */
+ public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() {
+ return GoogleCredentialsProvider.newBuilder()
+ .setScopesToApply(DEFAULT_SERVICE_SCOPES)
+ .setUseJwtAccessWithScope(true);
+ }
+
+ /** Returns a builder for the default gRPC ChannelProvider for this service. */
+ public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() {
+ return InstantiatingGrpcChannelProvider.newBuilder()
+ .setMaxInboundMessageSize(Integer.MAX_VALUE);
+ }
+
+ /** Returns a builder for the default REST ChannelProvider for this service. */
+ @BetaApi
+ public static InstantiatingHttpJsonChannelProvider.Builder
+ defaultHttpJsonTransportProviderBuilder() {
+ return InstantiatingHttpJsonChannelProvider.newBuilder();
+ }
+
+ public static TransportChannelProvider defaultTransportChannelProvider() {
+ return defaultGrpcTransportProviderBuilder().build();
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultGrpcApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(AppOptimizeStubSettings.class))
+ .setTransportToken(
+ GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultHttpJsonApiClientHeaderProviderBuilder() {
+ return ApiClientHeaderProvider.newBuilder()
+ .setGeneratedLibToken(
+ "gapic", GaxProperties.getLibraryVersion(AppOptimizeStubSettings.class))
+ .setTransportToken(
+ GaxHttpJsonProperties.getHttpJsonTokenName(),
+ GaxHttpJsonProperties.getHttpJsonVersion());
+ }
+
+ public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() {
+ return AppOptimizeStubSettings.defaultGrpcApiClientHeaderProviderBuilder();
+ }
+
+ /** Returns a new gRPC builder for this class. */
+ public static Builder newBuilder() {
+ return Builder.createDefault();
+ }
+
+ /** Returns a new REST builder for this class. */
+ public static Builder newHttpJsonBuilder() {
+ return Builder.createHttpJsonDefault();
+ }
+
+ /** 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 AppOptimizeStubSettings(Builder settingsBuilder) throws IOException {
+ super(settingsBuilder);
+
+ createReportSettings = settingsBuilder.createReportSettings().build();
+ createReportOperationSettings = settingsBuilder.createReportOperationSettings().build();
+ getReportSettings = settingsBuilder.getReportSettings().build();
+ listReportsSettings = settingsBuilder.listReportsSettings().build();
+ deleteReportSettings = settingsBuilder.deleteReportSettings().build();
+ readReportSettings = settingsBuilder.readReportSettings().build();
+ listLocationsSettings = settingsBuilder.listLocationsSettings().build();
+ getLocationSettings = settingsBuilder.getLocationSettings().build();
+ }
+
+ @Override
+ protected LibraryMetadata getLibraryMetadata() {
+ return LibraryMetadata.newBuilder()
+ .setArtifactName("com.google.cloud:google-cloud-appoptimize")
+ .setRepository("googleapis/google-cloud-java")
+ .setVersion(Version.VERSION)
+ .build();
+ }
+
+ /** Builder for AppOptimizeStubSettings. */
+ public static class Builder extends StubSettings.Builder {
+ private final ImmutableList> unaryMethodSettingsBuilders;
+ private final UnaryCallSettings.Builder createReportSettings;
+ private final OperationCallSettings.Builder
+ createReportOperationSettings;
+ private final UnaryCallSettings.Builder getReportSettings;
+ private final PagedCallSettings.Builder<
+ ListReportsRequest, ListReportsResponse, ListReportsPagedResponse>
+ listReportsSettings;
+ private final UnaryCallSettings.Builder deleteReportSettings;
+ private final PagedCallSettings.Builder<
+ ReadReportRequest, ReadReportResponse, ReadReportPagedResponse>
+ readReportSettings;
+ private final PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings;
+ private final UnaryCallSettings.Builder getLocationSettings;
+ private static final ImmutableMap>
+ RETRYABLE_CODE_DEFINITIONS;
+
+ static {
+ ImmutableMap.Builder> definitions =
+ ImmutableMap.builder();
+ definitions.put(
+ "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList()));
+ definitions.put(
+ "retry_policy_0_codes",
+ ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE)));
+ definitions.put("no_retry_codes", 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()
+ .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L))
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L))
+ .setTotalTimeoutDuration(Duration.ofMillis(60000L))
+ .build();
+ definitions.put("no_retry_1_params", settings);
+ settings =
+ RetrySettings.newBuilder()
+ .setInitialRetryDelayDuration(Duration.ofMillis(1000L))
+ .setRetryDelayMultiplier(1.3)
+ .setMaxRetryDelayDuration(Duration.ofMillis(10000L))
+ .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L))
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L))
+ .setTotalTimeoutDuration(Duration.ofMillis(60000L))
+ .build();
+ definitions.put("retry_policy_0_params", settings);
+ settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build();
+ definitions.put("no_retry_params", settings);
+ RETRY_PARAM_DEFINITIONS = definitions.build();
+ }
+
+ protected Builder() {
+ this(((ClientContext) null));
+ }
+
+ protected Builder(ClientContext clientContext) {
+ super(clientContext);
+
+ createReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ createReportOperationSettings = OperationCallSettings.newBuilder();
+ getReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ listReportsSettings = PagedCallSettings.newBuilder(LIST_REPORTS_PAGE_STR_FACT);
+ deleteReportSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+ readReportSettings = PagedCallSettings.newBuilder(READ_REPORT_PAGE_STR_FACT);
+ listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT);
+ getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder();
+
+ unaryMethodSettingsBuilders =
+ ImmutableList.>of(
+ createReportSettings,
+ getReportSettings,
+ listReportsSettings,
+ deleteReportSettings,
+ readReportSettings,
+ listLocationsSettings,
+ getLocationSettings);
+ initDefaults(this);
+ }
+
+ protected Builder(AppOptimizeStubSettings settings) {
+ super(settings);
+
+ createReportSettings = settings.createReportSettings.toBuilder();
+ createReportOperationSettings = settings.createReportOperationSettings.toBuilder();
+ getReportSettings = settings.getReportSettings.toBuilder();
+ listReportsSettings = settings.listReportsSettings.toBuilder();
+ deleteReportSettings = settings.deleteReportSettings.toBuilder();
+ readReportSettings = settings.readReportSettings.toBuilder();
+ listLocationsSettings = settings.listLocationsSettings.toBuilder();
+ getLocationSettings = settings.getLocationSettings.toBuilder();
+
+ unaryMethodSettingsBuilders =
+ ImmutableList.>of(
+ createReportSettings,
+ getReportSettings,
+ listReportsSettings,
+ deleteReportSettings,
+ readReportSettings,
+ listLocationsSettings,
+ getLocationSettings);
+ }
+
+ private static Builder createDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultTransportChannelProvider());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
+ private static Builder createHttpJsonDefault() {
+ Builder builder = new Builder(((ClientContext) null));
+
+ builder.setTransportChannelProvider(defaultHttpJsonTransportProviderBuilder().build());
+ builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build());
+ builder.setInternalHeaderProvider(defaultHttpJsonApiClientHeaderProviderBuilder().build());
+ builder.setMtlsEndpoint(getDefaultMtlsEndpoint());
+ builder.setSwitchToMtlsEndpointAllowed(true);
+
+ return initDefaults(builder);
+ }
+
+ private static Builder initDefaults(Builder builder) {
+ builder
+ .createReportSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
+
+ builder
+ .getReportSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
+
+ builder
+ .listReportsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
+
+ builder
+ .deleteReportSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"));
+
+ builder
+ .readReportSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params"));
+
+ builder
+ .listLocationsSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .getLocationSettings()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params"));
+
+ builder
+ .createReportOperationSettings()
+ .setInitialCallSettings(
+ UnaryCallSettings
+ .newUnaryCallSettingsBuilder()
+ .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes"))
+ .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params"))
+ .build())
+ .setResponseTransformer(
+ ProtoOperationTransformers.ResponseTransformer.create(Report.class))
+ .setMetadataTransformer(
+ ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class))
+ .setPollingAlgorithm(
+ OperationTimedPollAlgorithm.create(
+ RetrySettings.newBuilder()
+ .setInitialRetryDelayDuration(Duration.ofMillis(5000L))
+ .setRetryDelayMultiplier(1.5)
+ .setMaxRetryDelayDuration(Duration.ofMillis(45000L))
+ .setInitialRpcTimeoutDuration(Duration.ZERO)
+ .setRpcTimeoutMultiplier(1.0)
+ .setMaxRpcTimeoutDuration(Duration.ZERO)
+ .setTotalTimeoutDuration(Duration.ofMillis(300000L))
+ .build()));
+
+ return builder;
+ }
+
+ /**
+ * Applies the given settings updater function to all of the unary API methods in this service.
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction, Void> settingsUpdater) {
+ super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater);
+ return this;
+ }
+
+ public ImmutableList> unaryMethodSettingsBuilders() {
+ return unaryMethodSettingsBuilders;
+ }
+
+ /** Returns the builder for the settings used for calls to createReport. */
+ public UnaryCallSettings.Builder createReportSettings() {
+ return createReportSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to createReport. */
+ public OperationCallSettings.Builder
+ createReportOperationSettings() {
+ return createReportOperationSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to getReport. */
+ public UnaryCallSettings.Builder getReportSettings() {
+ return getReportSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listReports. */
+ public PagedCallSettings.Builder<
+ ListReportsRequest, ListReportsResponse, ListReportsPagedResponse>
+ listReportsSettings() {
+ return listReportsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to deleteReport. */
+ public UnaryCallSettings.Builder deleteReportSettings() {
+ return deleteReportSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to readReport. */
+ public PagedCallSettings.Builder
+ readReportSettings() {
+ return readReportSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to listLocations. */
+ public PagedCallSettings.Builder<
+ ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse>
+ listLocationsSettings() {
+ return listLocationsSettings;
+ }
+
+ /** Returns the builder for the settings used for calls to getLocation. */
+ public UnaryCallSettings.Builder getLocationSettings() {
+ return getLocationSettings;
+ }
+
+ @Override
+ public AppOptimizeStubSettings build() throws IOException {
+ return new AppOptimizeStubSettings(this);
+ }
+ }
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/GrpcAppOptimizeCallableFactory.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/GrpcAppOptimizeCallableFactory.java
new file mode 100644
index 000000000000..c09b5364d2e0
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/GrpcAppOptimizeCallableFactory.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcCallableFactory;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.BidiStreamingCallable;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.ClientStreamingCallable;
+import com.google.api.gax.rpc.OperationCallSettings;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.PagedCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallSettings;
+import com.google.api.gax.rpc.ServerStreamingCallable;
+import com.google.api.gax.rpc.StreamingCallSettings;
+import com.google.api.gax.rpc.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC callable factory implementation for the AppOptimize service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcAppOptimizeCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ GrpcCallSettings grpcCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ GrpcCallSettings grpcCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createPagedCallable(grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ GrpcCallSettings grpcCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBatchingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ GrpcCallSettings grpcCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ return GrpcCallableFactory.createOperationCallable(
+ grpcCallSettings, callSettings, clientContext, operationsStub);
+ }
+
+ @Override
+ public
+ BidiStreamingCallable createBidiStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createBidiStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createServerStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ ClientStreamingCallable createClientStreamingCallable(
+ GrpcCallSettings grpcCallSettings,
+ StreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return GrpcCallableFactory.createClientStreamingCallable(
+ grpcCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/GrpcAppOptimizeStub.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/GrpcAppOptimizeStub.java
new file mode 100644
index 000000000000..cccac7b588b8
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/GrpcAppOptimizeStub.java
@@ -0,0 +1,403 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta.stub;
+
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListLocationsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListReportsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ReadReportPagedResponse;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.grpc.GrpcCallSettings;
+import com.google.api.gax.grpc.GrpcStubCallableFactory;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.RequestParamsBuilder;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.appoptimize.v1beta.CreateReportRequest;
+import com.google.cloud.appoptimize.v1beta.DeleteReportRequest;
+import com.google.cloud.appoptimize.v1beta.GetReportRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsResponse;
+import com.google.cloud.appoptimize.v1beta.OperationMetadata;
+import com.google.cloud.appoptimize.v1beta.ReadReportRequest;
+import com.google.cloud.appoptimize.v1beta.ReadReportResponse;
+import com.google.cloud.appoptimize.v1beta.Report;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.GrpcOperationsStub;
+import com.google.protobuf.Empty;
+import io.grpc.MethodDescriptor;
+import io.grpc.protobuf.ProtoUtils;
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * gRPC stub implementation for the AppOptimize service API.
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcAppOptimizeStub extends AppOptimizeStub {
+ private static final MethodDescriptor
+ createReportMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/CreateReport")
+ .setRequestMarshaller(ProtoUtils.marshaller(CreateReportRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private static final MethodDescriptor getReportMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/GetReport")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetReportRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Report.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private static final MethodDescriptor
+ listReportsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/ListReports")
+ .setRequestMarshaller(ProtoUtils.marshaller(ListReportsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListReportsResponse.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private static final MethodDescriptor deleteReportMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/DeleteReport")
+ .setRequestMarshaller(ProtoUtils.marshaller(DeleteReportRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private static final MethodDescriptor
+ readReportMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.appoptimize.v1beta.AppOptimize/ReadReport")
+ .setRequestMarshaller(ProtoUtils.marshaller(ReadReportRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(ReadReportResponse.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private static final MethodDescriptor
+ listLocationsMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.location.Locations/ListLocations")
+ .setRequestMarshaller(
+ ProtoUtils.marshaller(ListLocationsRequest.getDefaultInstance()))
+ .setResponseMarshaller(
+ ProtoUtils.marshaller(ListLocationsResponse.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private static final MethodDescriptor getLocationMethodDescriptor =
+ MethodDescriptor.newBuilder()
+ .setType(MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName("google.cloud.location.Locations/GetLocation")
+ .setRequestMarshaller(ProtoUtils.marshaller(GetLocationRequest.getDefaultInstance()))
+ .setResponseMarshaller(ProtoUtils.marshaller(Location.getDefaultInstance()))
+ .setSampledToLocalTracing(true)
+ .build();
+
+ private final UnaryCallable createReportCallable;
+ private final OperationCallable
+ createReportOperationCallable;
+ private final UnaryCallable getReportCallable;
+ private final UnaryCallable listReportsCallable;
+ private final UnaryCallable
+ listReportsPagedCallable;
+ private final UnaryCallable deleteReportCallable;
+ private final UnaryCallable readReportCallable;
+ private final UnaryCallable readReportPagedCallable;
+ private final UnaryCallable listLocationsCallable;
+ private final UnaryCallable
+ listLocationsPagedCallable;
+ private final UnaryCallable getLocationCallable;
+
+ private final BackgroundResource backgroundResources;
+ private final GrpcOperationsStub operationsStub;
+ private final GrpcStubCallableFactory callableFactory;
+
+ public static final GrpcAppOptimizeStub create(AppOptimizeStubSettings settings)
+ throws IOException {
+ return new GrpcAppOptimizeStub(settings, ClientContext.create(settings));
+ }
+
+ public static final GrpcAppOptimizeStub create(ClientContext clientContext) throws IOException {
+ return new GrpcAppOptimizeStub(AppOptimizeStubSettings.newBuilder().build(), clientContext);
+ }
+
+ public static final GrpcAppOptimizeStub create(
+ ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException {
+ return new GrpcAppOptimizeStub(
+ AppOptimizeStubSettings.newBuilder().build(), clientContext, callableFactory);
+ }
+
+ /**
+ * Constructs an instance of GrpcAppOptimizeStub, 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 GrpcAppOptimizeStub(AppOptimizeStubSettings settings, ClientContext clientContext)
+ throws IOException {
+ this(settings, clientContext, new GrpcAppOptimizeCallableFactory());
+ }
+
+ /**
+ * Constructs an instance of GrpcAppOptimizeStub, 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 GrpcAppOptimizeStub(
+ AppOptimizeStubSettings settings,
+ ClientContext clientContext,
+ GrpcStubCallableFactory callableFactory)
+ throws IOException {
+ this.callableFactory = callableFactory;
+ this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory);
+
+ GrpcCallSettings createReportTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(createReportMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .setResourceNameExtractor(request -> request.getParent())
+ .build();
+ GrpcCallSettings getReportTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getReportMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .setResourceNameExtractor(request -> request.getName())
+ .build();
+ GrpcCallSettings listReportsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listReportsMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("parent", String.valueOf(request.getParent()));
+ return builder.build();
+ })
+ .setResourceNameExtractor(request -> request.getParent())
+ .build();
+ GrpcCallSettings deleteReportTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(deleteReportMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .setResourceNameExtractor(request -> request.getName())
+ .build();
+ GrpcCallSettings readReportTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(readReportMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .setResourceNameExtractor(request -> request.getName())
+ .build();
+ GrpcCallSettings listLocationsTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(listLocationsMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+ GrpcCallSettings getLocationTransportSettings =
+ GrpcCallSettings.newBuilder()
+ .setMethodDescriptor(getLocationMethodDescriptor)
+ .setParamsExtractor(
+ request -> {
+ RequestParamsBuilder builder = RequestParamsBuilder.create();
+ builder.add("name", String.valueOf(request.getName()));
+ return builder.build();
+ })
+ .build();
+
+ this.createReportCallable =
+ callableFactory.createUnaryCallable(
+ createReportTransportSettings, settings.createReportSettings(), clientContext);
+ this.createReportOperationCallable =
+ callableFactory.createOperationCallable(
+ createReportTransportSettings,
+ settings.createReportOperationSettings(),
+ clientContext,
+ operationsStub);
+ this.getReportCallable =
+ callableFactory.createUnaryCallable(
+ getReportTransportSettings, settings.getReportSettings(), clientContext);
+ this.listReportsCallable =
+ callableFactory.createUnaryCallable(
+ listReportsTransportSettings, settings.listReportsSettings(), clientContext);
+ this.listReportsPagedCallable =
+ callableFactory.createPagedCallable(
+ listReportsTransportSettings, settings.listReportsSettings(), clientContext);
+ this.deleteReportCallable =
+ callableFactory.createUnaryCallable(
+ deleteReportTransportSettings, settings.deleteReportSettings(), clientContext);
+ this.readReportCallable =
+ callableFactory.createUnaryCallable(
+ readReportTransportSettings, settings.readReportSettings(), clientContext);
+ this.readReportPagedCallable =
+ callableFactory.createPagedCallable(
+ readReportTransportSettings, settings.readReportSettings(), clientContext);
+ this.listLocationsCallable =
+ callableFactory.createUnaryCallable(
+ listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
+ this.listLocationsPagedCallable =
+ callableFactory.createPagedCallable(
+ listLocationsTransportSettings, settings.listLocationsSettings(), clientContext);
+ this.getLocationCallable =
+ callableFactory.createUnaryCallable(
+ getLocationTransportSettings, settings.getLocationSettings(), clientContext);
+
+ this.backgroundResources =
+ new BackgroundResourceAggregation(clientContext.getBackgroundResources());
+ }
+
+ public GrpcOperationsStub getOperationsStub() {
+ return operationsStub;
+ }
+
+ @Override
+ public UnaryCallable createReportCallable() {
+ return createReportCallable;
+ }
+
+ @Override
+ public OperationCallable
+ createReportOperationCallable() {
+ return createReportOperationCallable;
+ }
+
+ @Override
+ public UnaryCallable getReportCallable() {
+ return getReportCallable;
+ }
+
+ @Override
+ public UnaryCallable listReportsCallable() {
+ return listReportsCallable;
+ }
+
+ @Override
+ public UnaryCallable listReportsPagedCallable() {
+ return listReportsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable deleteReportCallable() {
+ return deleteReportCallable;
+ }
+
+ @Override
+ public UnaryCallable readReportCallable() {
+ return readReportCallable;
+ }
+
+ @Override
+ public UnaryCallable readReportPagedCallable() {
+ return readReportPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable listLocationsCallable() {
+ return listLocationsCallable;
+ }
+
+ @Override
+ public UnaryCallable
+ listLocationsPagedCallable() {
+ return listLocationsPagedCallable;
+ }
+
+ @Override
+ public UnaryCallable getLocationCallable() {
+ return getLocationCallable;
+ }
+
+ @Override
+ public final void close() {
+ try {
+ backgroundResources.close();
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new IllegalStateException("Failed to close resource", e);
+ }
+ }
+
+ @Override
+ public void shutdown() {
+ backgroundResources.shutdown();
+ }
+
+ @Override
+ public boolean isShutdown() {
+ return backgroundResources.isShutdown();
+ }
+
+ @Override
+ public boolean isTerminated() {
+ return backgroundResources.isTerminated();
+ }
+
+ @Override
+ public void shutdownNow() {
+ backgroundResources.shutdownNow();
+ }
+
+ @Override
+ public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
+ return backgroundResources.awaitTermination(duration, unit);
+ }
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/HttpJsonAppOptimizeCallableFactory.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/HttpJsonAppOptimizeCallableFactory.java
new file mode 100644
index 000000000000..2930e12d4744
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/HttpJsonAppOptimizeCallableFactory.java
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta.stub;
+
+import com.google.api.core.BetaApi;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonCallableFactory;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.longrunning.stub.OperationsStub;
+import com.google.api.gax.rpc.BatchingCallSettings;
+import com.google.api.gax.rpc.ClientContext;
+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.UnaryCallSettings;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.longrunning.Operation;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST callable factory implementation for the AppOptimize service API.
+ *
+ * This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class HttpJsonAppOptimizeCallableFactory
+ implements HttpJsonStubCallableFactory {
+
+ @Override
+ public UnaryCallable createUnaryCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ UnaryCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createUnaryCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ UnaryCallable createPagedCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ PagedCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createPagedCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public UnaryCallable createBatchingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ BatchingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createBatchingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+
+ @Override
+ public
+ OperationCallable createOperationCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ OperationCallSettings callSettings,
+ ClientContext clientContext,
+ OperationsStub operationsStub) {
+ UnaryCallable innerCallable =
+ HttpJsonCallableFactory.createBaseUnaryCallable(
+ httpJsonCallSettings, callSettings.getInitialCallSettings(), clientContext);
+ HttpJsonOperationSnapshotCallable initialCallable =
+ new HttpJsonOperationSnapshotCallable(
+ innerCallable,
+ httpJsonCallSettings.getMethodDescriptor().getOperationSnapshotFactory());
+ return HttpJsonCallableFactory.createOperationCallable(
+ callSettings, clientContext, operationsStub.longRunningClient(), initialCallable);
+ }
+
+ @Override
+ public
+ ServerStreamingCallable createServerStreamingCallable(
+ HttpJsonCallSettings httpJsonCallSettings,
+ ServerStreamingCallSettings callSettings,
+ ClientContext clientContext) {
+ return HttpJsonCallableFactory.createServerStreamingCallable(
+ httpJsonCallSettings, callSettings, clientContext);
+ }
+}
diff --git a/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/HttpJsonAppOptimizeStub.java b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/HttpJsonAppOptimizeStub.java
new file mode 100644
index 000000000000..7c687236c3c5
--- /dev/null
+++ b/java-appoptimize/google-cloud-appoptimize/src/main/java/com/google/cloud/appoptimize/v1beta/stub/HttpJsonAppOptimizeStub.java
@@ -0,0 +1,650 @@
+/*
+ * Copyright 2026 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.appoptimize.v1beta.stub;
+
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListLocationsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ListReportsPagedResponse;
+import static com.google.cloud.appoptimize.v1beta.AppOptimizeClient.ReadReportPagedResponse;
+
+import com.google.api.HttpRule;
+import com.google.api.core.BetaApi;
+import com.google.api.core.InternalApi;
+import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.core.BackgroundResourceAggregation;
+import com.google.api.gax.httpjson.ApiMethodDescriptor;
+import com.google.api.gax.httpjson.HttpJsonCallSettings;
+import com.google.api.gax.httpjson.HttpJsonOperationSnapshot;
+import com.google.api.gax.httpjson.HttpJsonStubCallableFactory;
+import com.google.api.gax.httpjson.ProtoMessageRequestFormatter;
+import com.google.api.gax.httpjson.ProtoMessageResponseParser;
+import com.google.api.gax.httpjson.ProtoRestSerializer;
+import com.google.api.gax.httpjson.longrunning.stub.HttpJsonOperationsStub;
+import com.google.api.gax.rpc.ClientContext;
+import com.google.api.gax.rpc.OperationCallable;
+import com.google.api.gax.rpc.RequestParamsBuilder;
+import com.google.api.gax.rpc.UnaryCallable;
+import com.google.cloud.appoptimize.v1beta.CreateReportRequest;
+import com.google.cloud.appoptimize.v1beta.DeleteReportRequest;
+import com.google.cloud.appoptimize.v1beta.GetReportRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsRequest;
+import com.google.cloud.appoptimize.v1beta.ListReportsResponse;
+import com.google.cloud.appoptimize.v1beta.OperationMetadata;
+import com.google.cloud.appoptimize.v1beta.ReadReportRequest;
+import com.google.cloud.appoptimize.v1beta.ReadReportResponse;
+import com.google.cloud.appoptimize.v1beta.Report;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.common.collect.ImmutableMap;
+import com.google.longrunning.Operation;
+import com.google.protobuf.Empty;
+import com.google.protobuf.TypeRegistry;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * REST stub implementation for the AppOptimize service API.
+ *
+ *